Boost logo

Boost Users :

Subject: Re: [Boost-users] [StateChart] How to fix "the outer state does not have inner states."
From: Igor R (boost.lists_at_[hidden])
Date: 2011-12-08 14:07:42


> #include <boost/statechart/state_machine.hpp>
> #include <boost/statechart/state.hpp>
> namespace fsm = boost::statechart;
> class HandlingFileState;
> class PlayerFsm : public fsm::state_machine< PlayerFsm,  HandlingFileState >
> {};
>
> class HandlingFileState: public fsm::state< HandlingFileState, PlayerFsm/*,
> PlayingState*/>
> //if the initial state is uncoment, it can be compiled success. But I don't
> want this.
> {};
>
> class NormalPlayingState;
> class PlayingState: public fsm::state< PlayingState, HandlingFileState,
> NormalPlayingState >
> {};
>
> class NormalPlayingState: public fsm::state< NormalPlayingState,
> PlayingState>
> {};

You declared HandlingFileState as the direct outer state of
PlayingState. So you *have to* declare PlayingState as a direct inner
state of HandlingFileState.
Otherwise your scheme is not consistent -- and StateChart catches this
inconsistency in compile-time.


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