Boost logo

Boost Users :

Subject: Re: [Boost-users] [statechart] Non-Const Machine Pass-throughs andstate_cast
From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2009-08-10 13:23:09


> Initially, the machine and, in turn, the internal timer object appeared to
> be destructed before the state, causing an assertion when I tried to stop
> the destructed object.

You can avoid that by calling terminate() from Timer::~Timer(). You do not
need to wrap the machine into another object for this purpose.

> Through iterating on the const state_cast issue, I had also revised the
> base
> of the Running state to 'state' rather than 'simple_state' which
> eliminated
> the construction assertion for that state.

Ok, in this case you probably called a state machine function from the state
constructor, most likely context<>. This is not allowed, please see:

<http://www.boost.org/doc/libs/1_39_0/libs/statechart/doc/reference.html#ClassTemplatesimple_state>

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