Boost logo

Boost :

Subject: Re: [boost] Boost::statechart: state reaction returned result
From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2008-10-22 05:27:35


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.

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