Hi Andreas,
In the scenario I'm thinking of, we have an event which says "data is available" from a data source. We don't want to put the data itself in the event, because it's very large and/or very expensive to obtain, and it might or might not be of interest. Instead, the event contains a token that can be used to request the data if it turns out to be needed. So on receipt of that "data is available" event, we'll transition to a new state that can determine whether it needs to obtain the data or not, and if so, to use the token to get it. But as it stands now, the new state doesn't have access to the token.
In the meantime, what would be a good way to approach this? The only option I can think of is to save the token somewhere so the destination state can get it.
Thanks,
Bill
Hi BillThat's a pretty common request, see item 3 on the to-do list:
I'd like to be able to communicate the data from an event to the state(s)
that get constructed as a result of a transition.
http://www.boost.org/libs/statechart/doc/future_and_history.html#ToDoList
As stated in the todo-item, passing event data to the state constructor is not as straight-forward as it might seem. You are bound to lose event type-safety. However, if you have a compelling use-case, I'm willing to finally implement this feature.
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 mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users