Boost logo

Boost :

From: Andreas Huber (ah2003_at_[hidden])
Date: 2004-09-13 12:47:08


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk