Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamgroupstrap_at_[hidden])
Date: 2006-03-10 14:10:55


Oliver.Kowalke_at_[hidden] wrote:
> I want to pass data from outside into the state machine and pass the
> data from one state to the next state during state transition.
> But it seams that statechart doesn't support this.

The only means of passing data around in a state machine are events. All
the FSM frameworks I have seen do it this way and Boost.Statechart is no
different here.

> Could this feature be added?

In theory, I guess one could do something along the lines of your
example but it would require a very conforming (SFINAE) compiler.
However, I'm not sure it would be a good idea because that means
introducing another communication channel that is very similar to
communicating with events.

> What is the preferred way which
> statechart suggests?

The preferred way is by posting an internal event and reacting to that
event with an in-state reaction in the destination state. Often you can
repost the event you've just received.

HTH & Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net