Boost::statechart: state reaction returned result

Could someone suggest me the recomended way of communicating error from fsm to the fsm user application? Assume state reaction unable to process event due to error and returns with discard_event(). As application calls process_event() to post an event which is of type "void". How do I make sure that my event was processed successfuly and not discarded? Thanks, Rajpal

Hi
Could someone suggest me the recomended way of communicating error from fsm to the fsm user application? Assume state reaction unable to process event due to error and returns with discard_event(). As application calls process_event() to post an event which is of type "void". How do I make sure that my event was processed successfuly and not discarded?
There's a facility designed for exactly this purpose: <http://thread.gmane.org/gmane.comp.lib.boost.user/16894> (see also documentation on unconsumed_event in the reference) For your specific problem it's probably best to let the unconsumed_event function throw an exception instead of posting a special event. Hope that works for you, if not please let me know. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
participants (2)
-
Andreas Huber
-
Rajpal Dangi