开发者

C++ Implementing scripting (Repeatable Actions)

I have a desktop app written in C++. It does a variety of different things 开发者_如何学Pythonand interacts with a database. I have made most actions that need to be performed selectable from a list. Actions are performed serially on data sets and need to be saved and played back at a later time on a different result set.

The actions are typically performed from a drop down menus and there are no load/save to disk operations. I dont' necessarily need scripting capability, but if thats the easiest way to go that's fine.

How would you approach this?

Added, This application is NOT written in OOP style


Lua

It's a great, simple scripting language, easily embedded into your apps.


Sounds like the GoF Command design pattern:

http://en.wikipedia.org/wiki/Command_pattern

http://www.oodesign.com/command-pattern.html


  • lua with LuaBind is quite widely used
  • Python with boost::python is also widely used but heavier on space

Now I know less know scripting languages that are useful in game programming, so useful in whatever application you need scripting for:

  • Falcon : the more versatile and flexible solution I know and use
  • ChaiScript : the easier to integrate I know
  • AngelScript : didn't try yet
  • GameMonkey : didn't try yet
  • IO : didn't try yet
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜