
:-) You won't get any flames from me. Yes, I don't agree with some of the points in MsmSession_Handout.pdf (e.g. 2.4, a user in his right mind would put Stopped, Open, Paused and Playing into an outer CDLoaded state and then only say if (state_downcast<const CDLoaded *> != 0)).
True, it is a possible solution. But 1) you don't always want to refactor your state machine and
But you'd have to refactor an equivalent MSM Machine too (you'd need to introduce the flag), right?
2) sometimes you can't. For example, to take the example in the Statechart documentation(http://www.boost.org/doc/libs/1_40_0/libs/statechart/doc/tutorial.html#State...),
if ( ( state_downcast< const NumLockOff * >() != 0 ) && ( state_downcast< const CapsLockOff * >() != 0 ) && ( state_downcast< const ScrollLockOff * >() != 0 ) )
could have been replaced by if(fsm.is_flag_active<IsOffState,Active::Flag_AND>()). And in this case I don't see a working refactoring solution.
Agreed. The example is somewhat far-fetched, but such queries are needed sometimes (mostly to work around the limitation that statechart doesn't offer join bars). Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.