Hi,
I have a question about optimization regarding guard conditions. How can one optimize the states and guard-checking??
<snip>
Is it possible to use MSM to create a parentstate "StateEval" with substates "StateEven", "StateOdd", "StateFloat" ?, the idea being to make transition_table as short as possible.
Something like this maby (but it does not work
struct transition_table : mpl::vector< Row
, Row , Row {};
Basically: is it possible to create a parentstate, that listens to events (even when an inner substate is already active)?
Thanks.
nicesw123
I think what you want is a composite state / submachine (http://www.boost.org/doc/libs/1_58_0/libs/msm/doc/HTML/ch02s02.html#d0e151). You want a submachine named StateEval and 3 substates inside, called StateEven, StateOdd, and StateFloat. Then you want 3 direct entries (which I dislike as it is a fsm goto, please consider direct entry transitions, on the above page). Then you save some transitions by having in your current fsm transitions originate from StateEval instead of substates. Correct? Then yes, it works of course. See: http://www.boost.org/doc/libs/1_58_0/libs/msm/doc/HTML/ch03s02.html#d0e529. There is also an example (http://www.boost.org/doc/libs/1_58_0/libs/msm/doc/HTML/examples/CompositeTut...) which also supports the functor front end. About entries, you could look at: http://www.boost.org/doc/libs/1_58_0/libs/msm/doc/HTML/ch03s02.html#d0e875. HTH, Christophe