
Oliver.Kowalke@infineon.com 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.