Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2007-12-21 14:22:05


Hi

>> Now the action called transitioning from Passive to Active throws
>> std exception.
>> I am expecting Started state to transit to Exception but it is not
>> happenning...
>> Any comments appreciated...

and

>> class SomeClass : public sc::state_machine<SomeClass, Stopped>

By default, a state_machine does not translate exceptions but just
propagates them to the state machine client, please see

<http://www.boost.org/libs/statechart/doc/tutorial.html#ExceptionHandling>

You need to pass an instantiation of exception_translator<> as
additional parameter to state_machine<>, as follows:

class SomeClass : public sc::state_machine<
  SomeClass, Stopped, std::allocator<void>,
  sc::exception_translator<> > { ... };

Please see
<http://www.boost.org/libs/statechart/doc/reference.html#ClassTemplateexception_translator>
for more information.

HTH,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net