Boost logo

Boost Users :

From: Igor R (boost.lists_at_[hidden])
Date: 2008-08-06 14:49:32


According to the manual, you have to inherit such states from
state_chart::state - not simple_state (see the Tutorial)

> struct TopState : simple_state< TopState, Machine >
> {
> TopState(void)
> {
> int z = outermost_context().unique;
> cout << z << endl;
> }
> };
>
> int main (int argc, char *argv[])
> {
> Machine machine1(1);
> Machine machine2(2);
> machine1.initiate();
> }
>
> ################################################################
>
> When I run this code, I get the following error message when machine1 is
> initiated:
>
> app: /usr/include/boost/statechart/simple_state.hpp:217: typename
> Context::inner_context_type::outermost_context_type&
> boost::statechart::simple_state<MostDerived, Context, InnerInitial,
> historyMode>::outermost_context() [with MostDerived = TopState, Context
> = Machine, InnerInitial = boost::mpl::list<mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na,
> mpl_::na, mpl_::na, mpl_::na>, boost::statechart::history_mode
> historyMode = has_no_history]: Assertion `get_pointer( pContext_ ) != 0'
> failed.
>
> It is as if the outermost context doesn't exist yet (or hasn't been
> fully initialized yet?) when the initial state is entered.
>
> Am I doing something wrong?
>
> Thank you for your time,
> Tim Crews
> GECO, Inc.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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