
13 Sep
2004
13 Sep
'04
5:47 p.m.
Alexander Nasonov wrote:
Comments?
This all looks very nice. Is it possible to use this scheme with polymorphic states, as follows: struct Active {}; struct Stopped : Active {}; struct Running : Active {}; struct EvStartStop {}; struct EvReset {}; struct Fsm { Stopped operator()( Running, EvStartStop ) { return Stopped(); } Running operator()( Stopped, EvStartStop ) { return Running(); } Stopped operator()( Active, EvReset ) { return Stopped(); } }; Note that the EvReset transition should be triggered when the state machine currently resides in either Stopped *or* Running. ? Regards, Andreas