Subject: Re: [Boost-users] [StateChart] Accessing machine and state members from within state constructor
From: Andre Puschmann (andre.puschmann_at_[hidden])
Date: 2012-07-12 08:53:02


On 07/11/2012 10:13 PM, Andreas Huber wrote:
> Please try ...
>
> StateBase( my_context ctx ) : base_type( ctx )
> {
> std::cout << "StateBase cst" << std::endl;
> this->outermost_context().fsmValue++;
> this->template context<Active>().stateValue++;
> }
>
> ... and let me know whether that works for you.

Works like a charm, excellent. Thanks.
And

this->template context<Context>().stateValue++;

lets me access the templated state.

Thanks Andreas and Igor

BR
-Andre