|
Boost Users : |
From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2007-08-13 17:56:49
Hi Chris
> I would like to create a state_machine class that contains some
> context
> information that can be written by orthogonal<0> and read by
> orthogonal<1>.
> Graphically:
> _______________
> | State Machine |
> |_______________|______________
> | |
> | StateA1 <------> StateA2 |
> | - - - - - - - - - - - - - - |
> | StateB1 <------> StateB2 |
> |_______________________________|
>
> I declare using
>
> struct StateA1, StateB1;
> struct MyStateMachine : sc::state_machine< MyStateMachine,
> mpl::list<StateA1, StateB1> > {};
The InitialState parameter of the state_machine class template cannot be an
mpl::list<>. Please see
<http://www.boost.org/libs/statechart/doc/reference.html#ClassTemplatestate_machine>
as opposed to
<http://www.boost.org/libs/statechart/doc/reference.html#ClassTemplatesimple_state>
> struct StateA1 : sc::simple_state<StateA1,
> MyStateMachine::orthogonal<0> >
> {};
>
> but get a compile error on line 2 as "orthogonal not a member of
> MyStateMachine". Do I need to declare one state in MyStateMachine,
> and make
> the mpl::list a second template argument to it in order to get what
> I want?
Yes, only a state can contain orthogonal regions.
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