Implementing event conditions in a C ++ state machine

I use hierarchical FSM for the built-in C ++ application interface. I would like to use small functions to determine whether certain interstate events can be triggered, and also use them to change changes in the database: however, creating a new class with different event functions for each state is complicated, as well as setting pointers to them like callbacks. (here we are talking about 300 functions.)

If C ++ supports lambda functions, I would use them, but I don’t have much weight in the project architecture, so I’m reluctant to use third-party solutions that require large library integration (for example, boost) or the inclusion of additional preprocessor steps.

Any ideas?

+3
source share
3 answers

In fact, if you use the Boost / TR1 library, there is support for the Lambda function . Details can be found on the Boost website .

+2
source

++ 0x . , ++ 09, . - . ++ Visual Studio 2010 Lambda Visual ++ Team Blog.

Lua FSM , . , FSM ++. , Lambda ( ) Lua. Lua coroutines , FSM.

0
0

All Articles