Re: [Boost-users] [statechart] Event handlers and state reusage

Tim Milward wrote:
Johan Nilsson wrote:
1. For a state, is it possible to specify a method that will be called when an event with no defined handlers is received?
Interesting question. Can all events inherit from a common base class, to which a state could define a (default) reaction, and override this with reactions to specific event sub-classes?
Should be possible from my point of view. Not sure how the framework would handle that even though it sounds reasonable. It's a bit limiting
though,
and should be possible have support for in the library.
By default statechart ignores a event with no handlers in the statemachine. Statechart allows to catch the event by adding following function to your state_machine class: void unconsumed_event( sc::event_base const& ev) { ... } Oliver

Oliver.Kowalke@qimonda.com wrote: [snip]
By default statechart ignores a event with no handlers in the statemachine. Statechart allows to catch the event by adding following function to your state_machine class:
void unconsumed_event( sc::event_base const& ev) { ... }
Thanks, I can use that. // Johan
participants (2)
-
Johan Nilsson
-
Oliver.Kowalke@qimonda.com