diff --git a/doc/index.html b/doc/index.html index 0571809..597a875 100644 --- a/doc/index.html +++ b/doc/index.html @@ -22,7 +22,7 @@

(formerly known as boost::fsm)

Overview

Version: - 2005/05/10 + 2005/05/12


@@ -77,18 +77,11 @@ include:

  • Generic design allowing for the customization of memory management, error handling and threading
  • -

    Warning: The interface of this library will change -in the near future (see the to-do list for more -information)!

    Supported platforms

    All code has been tested on the following platforms using boost distribution 1.32.0:

    In addition, previous versions of the library have also been tested on @@ -96,6 +89,10 @@ the following platforms (I expect the current version to work, but it hasn't been tested yet):


    Revised -10 May, 2005

    +12 May, 2005

    © Copyright Andreas Huber Dönni 2003-2005. The link refers to a spam honeypot. Please remove the words spam and trap diff --git a/example/BitMachine/BitMachine.cpp b/example/BitMachine/BitMachine.cpp index f9ceeba..73b783d 100644 --- a/example/BitMachine/BitMachine.cpp +++ b/example/BitMachine/BitMachine.cpp @@ -260,15 +260,15 @@ struct FlipTransitionList ////////////////////////////////////////////////////////////////////////////// template< unsigned int stateNo > -struct BitState : - sc::simple_state< BitState< stateNo >, BitMachine, - typename FlipTransitionList< stateNo >::type >, +struct BitState : sc::simple_state< BitState< stateNo >, BitMachine >, #ifdef CUSTOMIZE_MEMORY_MANAGEMENT IDisplay, UniqueObject< BitState< stateNo > > #else IDisplay #endif { + typedef typename FlipTransitionList< stateNo >::type reactions; + virtual void Display() const { DisplayBits( stateNo ); diff --git a/example/Camera/Camera.hpp b/example/Camera/Camera.hpp index 0e8bc77..be779d4 100644 --- a/example/Camera/Camera.hpp +++ b/example/Camera/Camera.hpp @@ -40,18 +40,20 @@ struct Camera : sc::state_machine< Camera, NotShooting > struct Idle; -struct NotShooting : sc::simple_state< NotShooting, Camera, - sc::custom_reaction< EvShutterHalf >, Idle > +struct NotShooting : sc::simple_state< NotShooting, Camera, Idle > { + typedef sc::custom_reaction< EvShutterHalf > reactions; + NotShooting(); ~NotShooting(); sc::result react( const EvShutterHalf & ); }; - struct Idle : sc::simple_state< Idle, NotShooting, - sc::custom_reaction< EvConfig > > + struct Idle : sc::simple_state< Idle, NotShooting > { + typedef sc::custom_reaction< EvConfig > reactions; + Idle(); ~Idle(); diff --git a/example/Camera/Configuring.hpp b/example/Camera/Configuring.hpp index bd45318..7bb9b67 100644 --- a/example/Camera/Configuring.hpp +++ b/example/Camera/Configuring.hpp @@ -25,9 +25,10 @@ namespace sc = boost::statechart; -struct Configuring : sc::simple_state< Configuring, NotShooting, - sc::transition< EvConfig, Idle > > +struct Configuring : sc::simple_state< Configuring, NotShooting > { + typedef sc::transition< EvConfig, Idle > reactions; + Configuring(); ~Configuring(); }; diff --git a/example/Camera/Shooting.cpp b/example/Camera/Shooting.cpp index 357d954..1d81122 100644 --- a/example/Camera/Shooting.cpp +++ b/example/Camera/Shooting.cpp @@ -38,9 +38,10 @@ struct Storing : sc::simple_state< Storing, Shooting > }; -struct Focused : sc::simple_state< Focused, Shooting, - sc::custom_reaction< EvShutterFull > > +struct Focused : sc::simple_state< Focused, Shooting > { + typedef sc::custom_reaction< EvShutterFull > reactions; + sc::result react( const EvShutterFull & ); }; diff --git a/example/Camera/Shooting.hpp b/example/Camera/Shooting.hpp index 06a4285..7031bc5 100644 --- a/example/Camera/Shooting.hpp +++ b/example/Camera/Shooting.hpp @@ -34,9 +34,10 @@ namespace mpl = boost::mpl; struct EvInFocus : sc::event< EvInFocus > {}; struct Focusing; -struct Shooting : sc::simple_state< Shooting, Camera, - sc::transition< EvShutterRelease, NotShooting >, Focusing > +struct Shooting : sc::simple_state< Shooting, Camera, Focusing > { + typedef sc::transition< EvShutterRelease, NotShooting > reactions; + Shooting(); ~Shooting(); @@ -46,9 +47,13 @@ struct Shooting : sc::simple_state< Shooting, Camera, } }; - struct Focusing : sc::state< Focusing, Shooting, mpl::list< - sc::custom_reaction< EvInFocus >, sc::deferral< EvShutterFull > > > + struct Focusing : sc::state< Focusing, Shooting > { + typedef mpl::list< + sc::custom_reaction< EvInFocus >, + sc::deferral< EvShutterFull > + > reactions; + Focusing( my_context ctx ); sc::result react( const EvInFocus & ); }; diff --git a/example/Keyboard/Keyboard.cpp b/example/Keyboard/Keyboard.cpp index a2e2c41..d64eb50 100644 --- a/example/Keyboard/Keyboard.cpp +++ b/example/Keyboard/Keyboard.cpp @@ -50,35 +50,42 @@ struct NumLockOff; struct CapsLockOff; struct ScrollLockOff; struct Active: sc::simple_state< - Active, Keyboard, sc::custom_reaction< EvRequestShutdown >, - mpl::list< NumLockOff, CapsLockOff, ScrollLockOff > > + Active, Keyboard, mpl::list< NumLockOff, CapsLockOff, ScrollLockOff > > { + typedef sc::custom_reaction< EvRequestShutdown > reactions; + sc::result react( const EvRequestShutdown & ); }; - struct NumLockOn : sc::simple_state< - NumLockOn, Active::orthogonal< 0 >, - sc::transition< EvNumLockPressed, NumLockOff > > {}; + struct NumLockOn : sc::simple_state< NumLockOn, Active::orthogonal< 0 > > + { + typedef sc::transition< EvNumLockPressed, NumLockOff > reactions; + }; - struct NumLockOff : sc::simple_state< - NumLockOff, Active::orthogonal< 0 >, - sc::transition< EvNumLockPressed, NumLockOn > > {}; + struct NumLockOff : sc::simple_state< NumLockOff, Active::orthogonal< 0 > > + { + typedef sc::transition< EvNumLockPressed, NumLockOn > reactions; + }; - struct CapsLockOn : sc::simple_state< - CapsLockOn, Active::orthogonal< 1 >, - sc::transition< EvCapsLockPressed, CapsLockOff > > {}; + struct CapsLockOn : sc::simple_state< CapsLockOn, Active::orthogonal< 1 > > + { + typedef sc::transition< EvCapsLockPressed, CapsLockOff > reactions; + }; - struct CapsLockOff : sc::simple_state< - CapsLockOff, Active::orthogonal< 1 >, - sc::transition< EvCapsLockPressed, CapsLockOn > > {}; + struct CapsLockOff : sc::simple_state< CapsLockOff, Active::orthogonal< 1 > > + { + typedef sc::transition< EvCapsLockPressed, CapsLockOn > reactions; + }; - struct ScrollLockOn : sc::simple_state< - ScrollLockOn, Active::orthogonal< 2 >, - sc::transition< EvScrollLockPressed, ScrollLockOff > > {}; + struct ScrollLockOn : sc::simple_state< ScrollLockOn, Active::orthogonal< 2 > > + { + typedef sc::transition< EvScrollLockPressed, ScrollLockOff > reactions; + }; - struct ScrollLockOff : sc::simple_state< - ScrollLockOff, Active::orthogonal< 2 >, - sc::transition< EvScrollLockPressed, ScrollLockOn > > {}; + struct ScrollLockOff : sc::simple_state< ScrollLockOff, Active::orthogonal< 2 > > + { + typedef sc::transition< EvScrollLockPressed, ScrollLockOn > reactions; + }; sc::result Active::react( const EvRequestShutdown & ) { diff --git a/example/PingPong/PingPong.cpp b/example/PingPong/PingPong.cpp index f1feb97..ea0a91b 100644 --- a/example/PingPong/PingPong.cpp +++ b/example/PingPong/PingPong.cpp @@ -159,10 +159,14 @@ struct Player : sc::asynchronous_state_machine< unsigned int Player::totalNoOfProcessedEvents_ = 0; -struct Waiting : sc::state< Waiting, Player, mpl::list< - sc::custom_reaction< BallReturned >, - sc::custom_reaction< GameAborted > > > +struct Waiting : sc::state< Waiting, Player > { + public: + typedef mpl::list< + sc::custom_reaction< BallReturned >, + sc::custom_reaction< GameAborted > + > reactions; + Waiting( my_context ctx ) : my_base( ctx ), noOfReturns_( 0 ), diff --git a/example/StopWatch/StopWatch.cpp b/example/StopWatch/StopWatch.cpp index 53ea6d8..0dc5da0 100644 --- a/example/StopWatch/StopWatch.cpp +++ b/example/StopWatch/StopWatch.cpp @@ -75,10 +75,11 @@ struct StopWatch : sc::state_machine< StopWatch, Active > {}; struct Stopped; -struct Active : sc::simple_state< Active, StopWatch, - sc::transition< EvReset, Active >, Stopped > +struct Active : sc::simple_state< Active, StopWatch, Stopped > { public: + typedef sc::transition< EvReset, Active > reactions; + Active() : elapsedTime_( 0.0 ) {} double & ElapsedTime() @@ -95,12 +96,11 @@ struct Active : sc::simple_state< Active, StopWatch, double elapsedTime_; }; - struct Running : - IElapsedTime, - sc::simple_state< Running, Active, - sc::transition< EvStartStop, Stopped > > + struct Running : IElapsedTime, sc::simple_state< Running, Active > { public: + typedef sc::transition< EvStartStop, Stopped > reactions; + Running() : startTime_( std::time( 0 ) ) {} ~Running() @@ -118,11 +118,10 @@ struct Active : sc::simple_state< Active, StopWatch, std::time_t startTime_; }; - struct Stopped : - IElapsedTime, - sc::simple_state< Stopped, Active, - sc::transition< EvStartStop, Running > > + struct Stopped : IElapsedTime, sc::simple_state< Stopped, Active > { + typedef sc::transition< EvStartStop, Running > reactions; + virtual double ElapsedTime() const { return context< Active >().ElapsedTime(); diff --git a/example/StopWatch/StopWatch2.cpp b/example/StopWatch/StopWatch2.cpp index 687dd31..7ea3aaa 100644 --- a/example/StopWatch/StopWatch2.cpp +++ b/example/StopWatch/StopWatch2.cpp @@ -86,10 +86,11 @@ struct StopWatch : sc::state_machine< StopWatch, Active > {}; struct Stopped; -struct Active : sc::simple_state< Active, StopWatch, - sc::transition< EvReset, Active >, Stopped > +struct Active : sc::simple_state< Active, StopWatch, Stopped > { public: + typedef sc::transition< EvReset, Active > reactions; + Active() : elapsedTime_( 0.0 ) {} double & ElapsedTime() @@ -106,12 +107,14 @@ struct Active : sc::simple_state< Active, StopWatch, double elapsedTime_; }; -struct Running : - sc::simple_state< Running, Active, mpl::list< - sc::custom_reaction< EvGetElapsedTime >, - sc::transition< EvStartStop, Stopped > > > +struct Running : sc::simple_state< Running, Active > { public: + typedef mpl::list< + sc::custom_reaction< EvGetElapsedTime >, + sc::transition< EvStartStop, Stopped > + > reactions; + Running() : startTime_( std::time( 0 ) ) {} ~Running() @@ -135,11 +138,13 @@ struct Running : std::time_t startTime_; }; -struct Stopped : - sc::simple_state< Stopped, Active, mpl::list< - sc::custom_reaction< EvGetElapsedTime >, - sc::transition< EvStartStop, Running > > > +struct Stopped : sc::simple_state< Stopped, Active > { + typedef mpl::list< + sc::custom_reaction< EvGetElapsedTime >, + sc::transition< EvStartStop, Running > + > reactions; + sc::result react( const EvGetElapsedTime & evt ) { evt.Assign( context< Active >().ElapsedTime() ); diff --git a/include/boost/statechart/simple_state.hpp b/include/boost/statechart/simple_state.hpp index 869d782..80de39f 100644 --- a/include/boost/statechart/simple_state.hpp +++ b/include/boost/statechart/simple_state.hpp @@ -165,9 +165,6 @@ struct deep_history_storer< true, true > -////////////////////////////////////////////////////////////////////////////// -typedef mpl::list<> no_reactions; - ////////////////////////////////////////////////////////////////////////////// enum history_mode { @@ -182,7 +179,6 @@ enum history_mode ////////////////////////////////////////////////////////////////////////////// template< class MostDerived, class Context, - class Reactions = no_reactions, class InnerInitial = mpl::list<>, history_mode historyMode = has_no_history > class simple_state : public detail::simple_state_base_type< MostDerived, @@ -194,6 +190,8 @@ class simple_state : public detail::simple_state_base_type< MostDerived, public: ////////////////////////////////////////////////////////////////////////// + typedef mpl::list<> reactions; + typedef typename Context::inner_context_type context_type; template< detail::orthogonal_position_type innerOrthogonalPosition > @@ -452,7 +450,7 @@ class simple_state : public detail::simple_state_base_type< MostDerived, typename rtti_policy_type::id_type eventType ) { this->enable_reaction(); - typedef typename detail::make_list< Reactions >::type reaction_list; + typedef typename detail::make_list< typename MostDerived::reactions >::type reaction_list; result reactionResult = local_react< reaction_list >( evt, eventType ); // At this point we can only safely access pContext_ if the handler did @@ -944,10 +942,10 @@ class simple_state : public detail::simple_state_base_type< MostDerived, -template< class MostDerived, class Context, class Reactions, +template< class MostDerived, class Context, class InnerInitial, history_mode historyMode > inline void intrusive_ptr_release( const ::boost::statechart::simple_state< - MostDerived, Context, Reactions, InnerInitial, historyMode > * pBase ) + MostDerived, Context, InnerInitial, historyMode > * pBase ) { if ( pBase->release() ) { diff --git a/include/boost/statechart/state.hpp b/include/boost/statechart/state.hpp index c37b96f..6913cca 100644 --- a/include/boost/statechart/state.hpp +++ b/include/boost/statechart/state.hpp @@ -23,14 +23,14 @@ namespace statechart template< class MostDerived, class Context, - class Reactions = no_reactions, class InnerInitial = mpl::list<>, history_mode historyMode = has_no_history > class state : public simple_state< - MostDerived, Context, Reactions, InnerInitial, historyMode > + MostDerived, Context, InnerInitial, historyMode > { - typedef simple_state< - MostDerived, Context, Reactions, InnerInitial, historyMode > base_type; + typedef simple_state< MostDerived, Context, InnerInitial, historyMode > + base_type; + protected: ////////////////////////////////////////////////////////////////////////// struct my_context diff --git a/test/CustomReactionTest.cpp b/test/CustomReactionTest.cpp index a131e19..029c3f4 100644 --- a/test/CustomReactionTest.cpp +++ b/test/CustomReactionTest.cpp @@ -96,15 +96,18 @@ struct CustomReactionTest : sc::state_machine< CustomReactionTest, A > }; struct B; -struct A : sc::simple_state< A, CustomReactionTest, mpl::list< - sc::custom_reaction< EvTransit >, - sc::custom_reaction< EvTransitWithAction >, - sc::custom_reaction< EvDefer >, - sc::custom_reaction< EvTerminate >, - sc::custom_reaction< EvDiscardNever >, - sc::custom_reaction< EvDiscardInB >, - sc::custom_reaction< EvDiscardInD > >, B > +struct A : sc::simple_state< A, CustomReactionTest, B > { + typedef mpl::list< + sc::custom_reaction< EvTransit >, + sc::custom_reaction< EvTransitWithAction >, + sc::custom_reaction< EvDefer >, + sc::custom_reaction< EvTerminate >, + sc::custom_reaction< EvDiscardNever >, + sc::custom_reaction< EvDiscardInB >, + sc::custom_reaction< EvDiscardInD > + > reactions; + sc::result react( const EvDiscardNever & ) { outermost_context().Visited( *this ); @@ -151,11 +154,14 @@ struct A : sc::simple_state< A, CustomReactionTest, mpl::list< }; struct C; - struct B : sc::simple_state< B, A, mpl::list< - sc::custom_reaction< EvDiscardNever >, - sc::custom_reaction< EvDiscardInB >, - sc::custom_reaction< EvDiscardInD > >, C > + struct B : sc::simple_state< B, A, C > { + typedef mpl::list< + sc::custom_reaction< EvDiscardNever >, + sc::custom_reaction< EvDiscardInB >, + sc::custom_reaction< EvDiscardInD > + > reactions; + sc::result react( const EvDiscardNever & ) { outermost_context().Visited( *this ); @@ -177,12 +183,15 @@ struct A : sc::simple_state< A, CustomReactionTest, mpl::list< struct E; struct F; - struct D : sc::simple_state< D, B, mpl::list< - sc::transition< EvToC, C >, - sc::custom_reaction< EvDiscardNever >, - sc::custom_reaction< EvDiscardInB >, - sc::custom_reaction< EvDiscardInD > >, mpl::list< E, F > > + struct D : sc::simple_state< D, B, mpl::list< E, F > > { + typedef mpl::list< + sc::transition< EvToC, C >, + sc::custom_reaction< EvDiscardNever >, + sc::custom_reaction< EvDiscardInB >, + sc::custom_reaction< EvDiscardInD > + > reactions; + sc::result react( const EvDiscardNever & ) { outermost_context().Visited( *this ); @@ -202,11 +211,14 @@ struct A : sc::simple_state< A, CustomReactionTest, mpl::list< } }; - struct E : sc::simple_state< E, D::orthogonal< 0 >, mpl::list< - sc::custom_reaction< EvDiscardNever >, - sc::custom_reaction< EvDiscardInB >, - sc::custom_reaction< EvDiscardInD > > > + struct E : sc::simple_state< E, D::orthogonal< 0 > > { + typedef mpl::list< + sc::custom_reaction< EvDiscardNever >, + sc::custom_reaction< EvDiscardInB >, + sc::custom_reaction< EvDiscardInD > + > reactions; + sc::result react( const EvDiscardNever & ) { outermost_context().Visited( *this ); @@ -226,11 +238,14 @@ struct A : sc::simple_state< A, CustomReactionTest, mpl::list< } }; - struct F : sc::simple_state< F, D::orthogonal< 1 >, mpl::list< - sc::custom_reaction< EvDiscardNever >, - sc::custom_reaction< EvDiscardInB >, - sc::custom_reaction< EvDiscardInD > > > + struct F : sc::simple_state< F, D::orthogonal< 1 > > { + typedef mpl::list< + sc::custom_reaction< EvDiscardNever >, + sc::custom_reaction< EvDiscardInB >, + sc::custom_reaction< EvDiscardInD > + > reactions; + sc::result react( const EvDiscardNever & ) { outermost_context().Visited( *this ); @@ -250,12 +265,15 @@ struct A : sc::simple_state< A, CustomReactionTest, mpl::list< } }; - struct C : sc::simple_state< C, B, mpl::list< - sc::transition< EvToD, D >, - sc::custom_reaction< EvDiscardNever >, - sc::custom_reaction< EvDiscardInB >, - sc::custom_reaction< EvDiscardInD > > > + struct C : sc::simple_state< C, B > { + typedef mpl::list< + sc::transition< EvToD, D >, + sc::custom_reaction< EvDiscardNever >, + sc::custom_reaction< EvDiscardInB >, + sc::custom_reaction< EvDiscardInD > + > reactions; + sc::result react( const EvDiscardNever & ) { outermost_context().Visited( *this ); diff --git a/test/DeferralTest.cpp b/test/DeferralTest.cpp index ed4afed..a17c258 100644 --- a/test/DeferralTest.cpp +++ b/test/DeferralTest.cpp @@ -57,9 +57,10 @@ struct DeferralTest : sc::state_machine< DeferralTest, Active > unsigned int processedCount_; }; -struct Dead : sc::simple_state< - Dead, DeferralTest, sc::custom_reaction< EvNodeDeferred > > +struct Dead : sc::simple_state< Dead, DeferralTest > { + typedef sc::custom_reaction< EvNodeDeferred > reactions; + sc::result react( const EvNodeDeferred & ) { outermost_context().IncrementProcessedCount(); @@ -68,11 +69,14 @@ struct Dead : sc::simple_state< }; struct Idle; -struct Active : sc::simple_state< Active, DeferralTest, mpl::list< - sc::custom_reaction< EvLeafDeferred >, - sc::deferral< EvNodeDeferred >, - sc::transition< EvDestroy, Dead > >, Idle > +struct Active : sc::simple_state< Active, DeferralTest, Idle > { + typedef mpl::list< + sc::custom_reaction< EvLeafDeferred >, + sc::deferral< EvNodeDeferred >, + sc::transition< EvDestroy, Dead > + > reactions; + sc::result react( const EvLeafDeferred & ) { outermost_context().IncrementProcessedCount(); @@ -80,15 +84,17 @@ struct Active : sc::simple_state< Active, DeferralTest, mpl::list< } }; - struct Running : sc::simple_state< Running, Active, - sc::transition< EvSwitch, Idle > > + struct Running : sc::simple_state< Running, Active > { + typedef sc::transition< EvSwitch, Idle > reactions; }; - struct Idle : sc::simple_state< Idle, Active, mpl::list< - sc::transition< EvSwitch, Running >, - sc::deferral< EvLeafDeferred > > > + struct Idle : sc::simple_state< Idle, Active > { + typedef mpl::list< + sc::transition< EvSwitch, Running >, + sc::deferral< EvLeafDeferred > + > reactions; }; diff --git a/test/FifoSchedulerTest.cpp b/test/FifoSchedulerTest.cpp index 43ef30b..c3d71aa 100644 --- a/test/FifoSchedulerTest.cpp +++ b/test/FifoSchedulerTest.cpp @@ -114,11 +114,14 @@ boost::intrusive_ptr< const sc::event_base > MakeEvent( return boost::intrusive_ptr< const sc::event_base >( pEvent ); } -struct Initial : sc::simple_state< Initial, FifoSchedulerTest, mpl::list< - sc::custom_reaction< EvCheckCtorArgs >, - sc::termination< EvTerminate >, - sc::custom_reaction< EvFail > > > +struct Initial : sc::simple_state< Initial, FifoSchedulerTest > { + typedef mpl::list< + sc::custom_reaction< EvCheckCtorArgs >, + sc::termination< EvTerminate >, + sc::custom_reaction< EvFail > + > reactions; + sc::result react( const EvCheckCtorArgs & ev ) { BOOST_REQUIRE( ev.expectedArgs_ == outermost_context().CtorArgs() ); diff --git a/test/HistoryTest.cpp b/test/HistoryTest.cpp index 35dfdbc..dd18a0a 100644 --- a/test/HistoryTest.cpp +++ b/test/HistoryTest.cpp @@ -51,53 +51,50 @@ struct H; struct I; struct M; struct Q; -struct A : sc::simple_state< A, HistoryTest, mpl::list< - sc::transition< EvToB, B >, - sc::transition< EvToD, D >, - sc::transition< EvToDShallow, sc::shallow_history< D > >, - sc::transition< EvToDDeep, sc::deep_history< D > >, - sc::transition< EvToF, F >, - sc::transition< EvToFShallow, sc::shallow_history< F > >, - sc::transition< EvToFDeep, sc::deep_history< F > >, - sc::transition< EvToH, H >, - sc::transition< EvToI, I >, - sc::transition< EvToM, M >, - sc::transition< EvToQ, Q > >, B > +struct A : sc::simple_state< A, HistoryTest, B > { + typedef mpl::list< + sc::transition< EvToB, B >, + sc::transition< EvToD, D >, + sc::transition< EvToDShallow, sc::shallow_history< D > >, + sc::transition< EvToDDeep, sc::deep_history< D > >, + sc::transition< EvToF, F >, + sc::transition< EvToFShallow, sc::shallow_history< F > >, + sc::transition< EvToFDeep, sc::deep_history< F > >, + sc::transition< EvToH, H >, + sc::transition< EvToI, I >, + sc::transition< EvToM, M >, + sc::transition< EvToQ, Q > + > reactions; }; struct J; struct N; struct B : sc::simple_state< - B, A, sc::no_reactions, - mpl::list< sc::shallow_history< J >, sc::deep_history< N > >, + B, A, mpl::list< sc::shallow_history< J >, sc::deep_history< N > >, sc::has_full_history > {}; struct J : sc::simple_state< J, B::orthogonal< 0 > > {}; struct L; - struct K : sc::simple_state< - K, B::orthogonal< 0 >, sc::no_reactions, L > {}; + struct K : sc::simple_state< K, B::orthogonal< 0 >, L > {}; struct L : sc::simple_state< L, K > {}; struct M : sc::simple_state< M, K > {}; struct N : sc::simple_state< N, B::orthogonal< 1 > > {}; struct P; - struct O : sc::simple_state< - O, B::orthogonal< 1 >, sc::no_reactions, P > {}; + struct O : sc::simple_state< O, B::orthogonal< 1 >, P > {}; struct P : sc::simple_state< P, O > {}; struct Q : sc::simple_state< Q, O > {}; - struct C : sc::simple_state< - C, A, sc::no_reactions, D, sc::has_full_history > {}; + struct C : sc::simple_state< C, A, D, sc::has_full_history > {}; struct D : sc::simple_state< D, C > {}; - struct E : sc::simple_state< - E, C, sc::no_reactions, F, sc::has_full_history > {}; + struct E : sc::simple_state< E, C, F, sc::has_full_history > {}; struct F : sc::simple_state< F, E > {}; - struct G : sc::simple_state< G, E, sc::no_reactions, H > {}; + struct G : sc::simple_state< G, E, H > {}; struct H : sc::simple_state< H, G > {}; struct I : sc::simple_state< I, G > {}; diff --git a/test/InconsistentHistoryTest1.cpp b/test/InconsistentHistoryTest1.cpp index b81fd68..259baef 100644 --- a/test/InconsistentHistoryTest1.cpp +++ b/test/InconsistentHistoryTest1.cpp @@ -26,7 +26,7 @@ struct InconsistentHistoryTest : sc::state_machine< struct B; // A does not have history struct A : sc::simple_state< A, InconsistentHistoryTest, - sc::no_reactions, mpl::list< sc::shallow_history< B > > > {}; + mpl::list< sc::shallow_history< B > > > {}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InconsistentHistoryTest2.cpp b/test/InconsistentHistoryTest2.cpp index 3fc5b22..9f182ba 100644 --- a/test/InconsistentHistoryTest2.cpp +++ b/test/InconsistentHistoryTest2.cpp @@ -26,9 +26,11 @@ struct InconsistentHistoryTest : sc::state_machine< struct B; // A only has deep history -struct A : sc::simple_state< A, InconsistentHistoryTest, - sc::transition< EvX, sc::shallow_history< B > >, - B, sc::has_deep_history > {}; +struct A : sc::simple_state< + A, InconsistentHistoryTest, B, sc::has_deep_history > +{ + typedef sc::transition< EvX, sc::shallow_history< B > > reactions; +}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InconsistentHistoryTest3.cpp b/test/InconsistentHistoryTest3.cpp index b911bdc..5324dc7 100644 --- a/test/InconsistentHistoryTest3.cpp +++ b/test/InconsistentHistoryTest3.cpp @@ -25,8 +25,8 @@ struct InconsistentHistoryTest : sc::state_machine< struct B; // A does not have history -struct A : sc::simple_state< A, InconsistentHistoryTest, - sc::no_reactions, mpl::list< sc::deep_history< B > > > {}; +struct A : sc::simple_state< + A, InconsistentHistoryTest, mpl::list< sc::deep_history< B > > > {}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InconsistentHistoryTest4.cpp b/test/InconsistentHistoryTest4.cpp index 0f98adc..c3969e9 100644 --- a/test/InconsistentHistoryTest4.cpp +++ b/test/InconsistentHistoryTest4.cpp @@ -26,9 +26,11 @@ struct InconsistentHistoryTest : sc::state_machine< struct B; // A only has shallow history -struct A : sc::simple_state< A, InconsistentHistoryTest, - sc::transition< EvX, sc::deep_history< B > >, - B, sc::has_shallow_history > {}; +struct A : sc::simple_state< + A, InconsistentHistoryTest, B, sc::has_shallow_history > +{ + typedef sc::transition< EvX, sc::deep_history< B > > reactions; +}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InconsistentHistoryTest5.cpp b/test/InconsistentHistoryTest5.cpp index ca9acb8..5db9d7d 100644 --- a/test/InconsistentHistoryTest5.cpp +++ b/test/InconsistentHistoryTest5.cpp @@ -21,8 +21,7 @@ struct InconsistentHistoryTest : sc::state_machine< InconsistentHistoryTest, A > {}; struct B; -struct A : sc::simple_state< - A, InconsistentHistoryTest, sc::no_reactions, B > {}; +struct A : sc::simple_state< A, InconsistentHistoryTest, B > {}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InconsistentHistoryTest6.cpp b/test/InconsistentHistoryTest6.cpp index 82d2bb0..6a6dd48 100644 --- a/test/InconsistentHistoryTest6.cpp +++ b/test/InconsistentHistoryTest6.cpp @@ -25,9 +25,11 @@ struct InconsistentHistoryTest : sc::state_machine< struct B; // A only has deep history -struct A : sc::simple_state< A, InconsistentHistoryTest, - sc::custom_reaction< EvX >, B, sc::has_deep_history > +struct A : sc::simple_state< + A, InconsistentHistoryTest, B, sc::has_deep_history > { + typedef sc::custom_reaction< EvX > reactions; + sc::result react( const EvX & ) { // A only has deep history diff --git a/test/InconsistentHistoryTest7.cpp b/test/InconsistentHistoryTest7.cpp index 48e1d4b..57c2728 100644 --- a/test/InconsistentHistoryTest7.cpp +++ b/test/InconsistentHistoryTest7.cpp @@ -21,8 +21,7 @@ struct InconsistentHistoryTest : sc::state_machine< InconsistentHistoryTest, A > {}; struct B; -struct A : sc::simple_state< - A, InconsistentHistoryTest, sc::no_reactions, B > {}; +struct A : sc::simple_state< A, InconsistentHistoryTest, B > {}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InconsistentHistoryTest8.cpp b/test/InconsistentHistoryTest8.cpp index 76e8068..cde391f 100644 --- a/test/InconsistentHistoryTest8.cpp +++ b/test/InconsistentHistoryTest8.cpp @@ -25,9 +25,11 @@ struct InconsistentHistoryTest : sc::state_machine< struct B; // A only has deep history -struct A : sc::simple_state< A, InconsistentHistoryTest, - sc::custom_reaction< EvX >, B, sc::has_shallow_history > +struct A : sc::simple_state< + A, InconsistentHistoryTest, B, sc::has_shallow_history > { + typedef sc::custom_reaction< EvX > reactions; + sc::result react( const EvX & ) { // A only has shallow history diff --git a/test/InnermostDefault.hpp b/test/InnermostDefault.hpp index 60de542..7483b76 100644 --- a/test/InnermostDefault.hpp +++ b/test/InnermostDefault.hpp @@ -17,10 +17,10 @@ namespace sc = boost::statechart; ////////////////////////////////////////////////////////////////////////////// -template< class MostDerived, class Context, class Reactions = sc::no_reactions > -struct InnermostDefault : sc::state< MostDerived, Context, Reactions > +template< class MostDerived, class Context > +struct InnermostDefault : sc::state< MostDerived, Context > { - typedef sc::state< MostDerived, Context, Reactions > base_type; + typedef sc::state< MostDerived, Context > base_type; typedef typename base_type::my_context my_context; typedef InnermostDefault my_base; diff --git a/test/InvalidChartTest2.cpp b/test/InvalidChartTest2.cpp index bc18666..2fd7fa9 100644 --- a/test/InvalidChartTest2.cpp +++ b/test/InvalidChartTest2.cpp @@ -19,7 +19,7 @@ struct A; struct InvalidChartTest : sc::state_machine< InvalidChartTest, A > {}; struct B; -struct A : sc::simple_state< A, InvalidChartTest, sc::no_reactions, B > {}; +struct A : sc::simple_state< A, InvalidChartTest, B > {}; struct B : sc::simple_state< B, A > {}; diff --git a/test/InvalidChartTest3.cpp b/test/InvalidChartTest3.cpp index 7a84367..3fc4d2a 100644 --- a/test/InvalidChartTest3.cpp +++ b/test/InvalidChartTest3.cpp @@ -22,8 +22,7 @@ struct A; struct InvalidChartTest : sc::state_machine< InvalidChartTest, A > {}; struct B; struct C; -struct A : sc::simple_state< - A, InvalidChartTest, sc::no_reactions, mpl::list< B, C > > {}; +struct A : sc::simple_state< A, InvalidChartTest, mpl::list< B, C > > {}; // B resides in the 0th region not the 1st struct B : sc::simple_state< B, A::orthogonal< 1 > > {}; diff --git a/test/InvalidTransitionTest1.cpp b/test/InvalidTransitionTest1.cpp index a6bb5a9..be9f696 100644 --- a/test/InvalidTransitionTest1.cpp +++ b/test/InvalidTransitionTest1.cpp @@ -28,14 +28,15 @@ struct InvalidTransitionTest : sc::state_machine< struct Idle0; struct Idle1; -struct Active : sc::simple_state< Active, InvalidTransitionTest, - sc::no_reactions, mpl::list< Idle0, Idle1 > > -{ -}; +struct Active : sc::simple_state< + Active, InvalidTransitionTest, mpl::list< Idle0, Idle1 > > {}; // Invalid transition between different orthogonal regions. - struct Idle0 : sc::simple_state< Idle0, Active::orthogonal< 0 >, - sc::transition< EvX, Idle1 > > {}; + struct Idle0 : sc::simple_state< Idle0, Active::orthogonal< 0 > > + { + typedef sc::transition< EvX, Idle1 > reactions; + }; + struct Idle1 : sc::simple_state< Idle1, Active::orthogonal< 1 > > {}; diff --git a/test/InvalidTransitionTest2.cpp b/test/InvalidTransitionTest2.cpp index ac032dd..36dcbe1 100644 --- a/test/InvalidTransitionTest2.cpp +++ b/test/InvalidTransitionTest2.cpp @@ -28,29 +28,23 @@ struct InvalidTransitionTest : sc::state_machine< struct Idle0; struct Idle1; -struct Active : sc::simple_state< Active, InvalidTransitionTest, - sc::no_reactions, mpl::list< Idle0, Idle1 > > -{ -}; +struct Active : sc::simple_state< + Active, InvalidTransitionTest, mpl::list< Idle0, Idle1 > > {}; struct Idle00; - struct Idle0 : sc::simple_state< Idle0, Active::orthogonal< 0 >, - sc::no_reactions, Idle00 > - { - }; + struct Idle0 : sc::simple_state< + Idle0, Active::orthogonal< 0 >, Idle00 > {}; struct Idle00 : sc::simple_state< Idle00, Idle0 > {}; struct Idle10; - struct Idle1 : sc::simple_state< Idle1, Active::orthogonal< 1 >, - sc::no_reactions, Idle10 > - { - }; + struct Idle1 : sc::simple_state< + Idle1, Active::orthogonal< 1 >, Idle10 > {}; // Invalid transition between different orthogonal regions. - struct Idle10 : sc::simple_state< Idle10, Idle1, - sc::transition< EvX, Idle00 > > + struct Idle10 : sc::simple_state< Idle10, Idle1 > { + typedef sc::transition< EvX, Idle00 > reactions; }; diff --git a/test/InvalidTransitionTest3.cpp b/test/InvalidTransitionTest3.cpp index 687eabb..dd1d4a8 100644 --- a/test/InvalidTransitionTest3.cpp +++ b/test/InvalidTransitionTest3.cpp @@ -25,16 +25,14 @@ struct InvalidTransitionTest : sc::state_machine< InvalidTransitionTest, Active > {}; struct Idle; -struct Active : sc::simple_state< Active, InvalidTransitionTest, - sc::no_reactions, Idle, sc::has_shallow_history > -{ -}; +struct Active : sc::simple_state< + Active, InvalidTransitionTest, Idle, sc::has_shallow_history > {}; // Invalid transition to shallow history from a state residing on the same // level as the history connector. - struct Idle : sc::simple_state< Idle, Active, - sc::transition< EvX, sc::shallow_history< Idle > > > + struct Idle : sc::simple_state< Idle, Active > { + typedef sc::transition< EvX, sc::shallow_history< Idle > > reactions; }; diff --git a/test/InvalidTransitionTest4.cpp b/test/InvalidTransitionTest4.cpp index 8fb5ac2..007abe9 100644 --- a/test/InvalidTransitionTest4.cpp +++ b/test/InvalidTransitionTest4.cpp @@ -25,18 +25,16 @@ struct InvalidTransitionTest : sc::state_machine< InvalidTransitionTest, Active > {}; struct Idle0; -struct Active : sc::simple_state< Active, InvalidTransitionTest, - sc::no_reactions, Idle0, sc::has_deep_history > -{ -}; +struct Active : sc::simple_state< + Active, InvalidTransitionTest, Idle0, sc::has_deep_history > {}; struct Running0 : sc::simple_state< Running0, Active > {}; // Invalid transition to deep history from a state residing on the same // level as the history connector. - struct Idle0 : sc::simple_state< Idle0, Active, - sc::transition< EvX, sc::deep_history< Running0 > > > + struct Idle0 : sc::simple_state< Idle0, Active > { + typedef sc::transition< EvX, sc::deep_history< Running0 > > reactions; }; diff --git a/test/OuterOrthogonal.hpp b/test/OuterOrthogonal.hpp index 7d82801..88c48d7 100644 --- a/test/OuterOrthogonal.hpp +++ b/test/OuterOrthogonal.hpp @@ -21,16 +21,15 @@ namespace mpl = boost::mpl; ////////////////////////////////////////////////////////////////////////////// -template< - class MostDerived, class Context, class Reactions, class InitialState0 > -struct Orthogonal0 : sc::state< MostDerived, Context, Reactions, +template< class MostDerived, class Context, class InitialState0 > +struct Orthogonal0 : sc::state< MostDerived, Context, mpl::list< InitialState0, Default1< MostDerived >, Default2< MostDerived > > > { typedef sc::state< - MostDerived, Context, Reactions, mpl::list< InitialState0, + MostDerived, Context, mpl::list< InitialState0, Default1< MostDerived >, Default2< MostDerived > > > base_type; typedef typename base_type::my_context my_context; typedef Orthogonal0 my_base; @@ -52,16 +51,15 @@ struct Orthogonal0 : sc::state< MostDerived, Context, Reactions, }; ////////////////////////////////////////////////////////////////////////////// -template< - class MostDerived, class Context, class Reactions, class InitialState1 > -struct Orthogonal1 : sc::state< MostDerived, Context, Reactions, +template< class MostDerived, class Context, class InitialState1 > +struct Orthogonal1 : sc::state< MostDerived, Context, mpl::list< Default0< MostDerived >, InitialState1, Default2< MostDerived > > > { typedef sc::state< - MostDerived, Context, Reactions, mpl::list< Default0< MostDerived >, + MostDerived, Context, mpl::list< Default0< MostDerived >, InitialState1, Default2< MostDerived > > > base_type; typedef typename base_type::my_context my_context; typedef Orthogonal1 my_base; @@ -83,16 +81,15 @@ struct Orthogonal1 : sc::state< MostDerived, Context, Reactions, }; ////////////////////////////////////////////////////////////////////////////// -template< - class MostDerived, class Context, class Reactions, class InitialState2 > -struct Orthogonal2 : sc::state< MostDerived, Context, Reactions, +template< class MostDerived, class Context, class InitialState2 > +struct Orthogonal2 : sc::state< MostDerived, Context, mpl::list< Default0< MostDerived >, Default1< MostDerived >, InitialState2 > > { typedef sc::state< - MostDerived, Context, Reactions, mpl::list< Default0< MostDerived >, + MostDerived, Context, mpl::list< Default0< MostDerived >, Default1< MostDerived >, InitialState2 > > base_type; typedef typename base_type::my_context my_context; typedef Orthogonal2 my_base; diff --git a/test/StateCastTest.cpp b/test/StateCastTest.cpp index ff6e14b..852c83e 100644 --- a/test/StateCastTest.cpp +++ b/test/StateCastTest.cpp @@ -76,14 +76,18 @@ void AssertNotInState( const FromState & theState ) struct B; struct C; struct D; -struct A : sc::simple_state< - A, StateCastTest, sc::transition< EvToB, B >, mpl::list< C, D > > {}; +struct A : sc::simple_state< A, StateCastTest, mpl::list< C, D > > +{ + typedef sc::transition< EvToB, B > reactions; +}; struct E; - struct C : sc::simple_state< C, A::orthogonal< 0 >, sc::no_reactions, E > {}; + struct C : sc::simple_state< C, A::orthogonal< 0 >, E > {}; - struct E : sc::state< E, C, sc::custom_reaction< EvCheck > > + struct E : sc::state< E, C > { + typedef sc::custom_reaction< EvCheck > reactions; + E( my_context ctx ) : my_base( ctx ) { post_event( boost::intrusive_ptr< EvCheck >( new EvCheck() ) ); @@ -92,8 +96,10 @@ struct A : sc::simple_state< sc::result react( const EvCheck & ); }; - struct F : sc::state< F, C, sc::custom_reaction< EvCheck > > + struct F : sc::state< F, C > { + typedef sc::custom_reaction< EvCheck > reactions; + F( my_context ctx ) : my_base( ctx ) { post_event( boost::intrusive_ptr< EvCheck >( new EvCheck() ) ); @@ -103,12 +109,15 @@ struct A : sc::simple_state< }; struct G; - struct D : sc::simple_state< D, A::orthogonal< 1 >, sc::no_reactions, G > {}; + struct D : sc::simple_state< D, A::orthogonal< 1 >, G > {}; struct G : sc::simple_state< G, D > {}; struct H : sc::simple_state< H, D > {}; -struct B : sc::simple_state< B, StateCastTest, sc::transition< EvToF, F > > {}; +struct B : sc::simple_state< B, StateCastTest > +{ + typedef sc::transition< EvToF, F > reactions; +}; sc::result E::react( const EvCheck & ) { diff --git a/test/StateIterationTest.cpp b/test/StateIterationTest.cpp index d8e9471..5147857 100644 --- a/test/StateIterationTest.cpp +++ b/test/StateIterationTest.cpp @@ -74,23 +74,31 @@ struct StateIterationTest : sc::state_machine< StateIterationTest, A > struct C; struct D; -struct B : sc::simple_state< B, StateIterationTest, - sc::transition< EvToA, A >, mpl::list< C, D > > {}; +struct B : sc::simple_state< B, StateIterationTest, mpl::list< C, D > > +{ + typedef sc::transition< EvToA, A > reactions; +}; -struct A : sc::simple_state< A, StateIterationTest, - sc::transition< EvToB, B > > {}; +struct A : sc::simple_state< A, StateIterationTest > +{ + typedef sc::transition< EvToB, B > reactions; +}; struct F; struct G; - struct E : sc::simple_state< E, B::orthogonal< 1 >, - sc::transition< EvToD, D >, mpl::list< F, G > > {}; + struct E : sc::simple_state< E, B::orthogonal< 1 >, mpl::list< F, G > > + { + typedef sc::transition< EvToD, D > reactions; + }; struct F : sc::simple_state< F, E::orthogonal< 0 > > {}; struct G : sc::simple_state< G, E::orthogonal< 1 > > {}; struct C : sc::simple_state< C, B::orthogonal< 0 > > {}; - struct D : sc::simple_state< D, B::orthogonal< 1 >, - sc::transition< EvToE, E > > {}; + struct D : sc::simple_state< D, B::orthogonal< 1 > > + { + typedef sc::transition< EvToE, E > reactions; + }; StateIterationTest::StateIterationTest() { diff --git a/test/TerminationTest.cpp b/test/TerminationTest.cpp index 6a75dff..aa8a746 100644 --- a/test/TerminationTest.cpp +++ b/test/TerminationTest.cpp @@ -91,10 +91,8 @@ struct TerminationTest : sc::state_machine< TerminationTest, A > template< class MostDerived, class Context, - class Reactions, class InnerInitial = mpl::list<> > -struct MyState : sc::simple_state< - MostDerived, Context, Reactions, InnerInitial > +struct MyState : sc::simple_state< MostDerived, Context, InnerInitial > { public: MyState() : exitCalled_( false ) {} @@ -119,29 +117,44 @@ struct MyState : sc::simple_state< struct B; struct C; -struct A : MyState< A, TerminationTest, - sc::termination< EvTerminateA >, mpl::list< B, C > > {}; +struct A : MyState< A, TerminationTest, mpl::list< B, C > > +{ + typedef sc::termination< EvTerminateA > reactions; +}; - struct B : MyState< B, A::orthogonal< 0 >, - sc::termination< EvTerminateB > > {}; + struct B : MyState< B, A::orthogonal< 0 > > + { + typedef sc::termination< EvTerminateB > reactions; + }; struct D; struct E; - struct C : MyState< C, A::orthogonal< 1 >, - sc::termination< EvTerminateC >, mpl::list< D, E > > {}; + struct C : MyState< C, A::orthogonal< 1 >, mpl::list< D, E > > + { + typedef sc::termination< EvTerminateC > reactions; + }; - struct D : MyState< D, C::orthogonal< 0 >, - sc::termination< EvTerminateD > > {}; + struct D : MyState< D, C::orthogonal< 0 > > + { + typedef sc::termination< EvTerminateD > reactions; + }; struct F; struct G; - struct E : MyState< E, C::orthogonal< 1 >, - sc::termination< EvTerminateE >, mpl::list< F, G > > {}; + struct E : MyState< E, C::orthogonal< 1 >, mpl::list< F, G > > + { + typedef sc::termination< EvTerminateE > reactions; + }; - struct F : MyState< F, E::orthogonal< 0 >, - sc::termination< EvTerminateF > > {}; - struct G : MyState< G, E::orthogonal< 1 >, - sc::termination< EvTerminateG > > {}; + struct F : MyState< F, E::orthogonal< 0 > > + { + typedef sc::termination< EvTerminateF > reactions; + }; + + struct G : MyState< G, E::orthogonal< 1 > > + { + typedef sc::termination< EvTerminateG > reactions; + }; TerminationTest::TerminationTest() { diff --git a/test/TransitionTest.cpp b/test/TransitionTest.cpp index 1fe4aea..f205bc8 100644 --- a/test/TransitionTest.cpp +++ b/test/TransitionTest.cpp @@ -250,8 +250,10 @@ struct TransitionTest : sc::state_machine< TransitionTest, S0 > struct S1; struct S211; -struct S0 : Orthogonal0< S0, TransitionTest, sc::transition< E, S211 >, S1 > +struct S0 : Orthogonal0< S0, TransitionTest, S1 > { + typedef sc::transition< E, S211 > reactions; + S0( my_context ctx ) : my_base( ctx ) {} template< class Event > @@ -263,41 +265,56 @@ struct S0 : Orthogonal0< S0, TransitionTest, sc::transition< E, S211 >, S1 > struct S11; struct S21; - struct S2 : Orthogonal2< S2, S0, mpl::list< - sc::transition< C, S1, S0, &S0::Transit< C > >, - sc::transition< F, S11, S0, &S0::Transit< F > > >, S21 > + struct S2 : Orthogonal2< S2, S0, S21 > { + typedef mpl::list< + sc::transition< C, S1, S0, &S0::Transit< C > >, + sc::transition< F, S11, S0, &S0::Transit< F > > + > reactions; + S2( my_context ctx ) : my_base( ctx ) {} }; - struct S21 : Orthogonal1< S21, S2::orthogonal< 2 >, mpl::list< - sc::transition< H, S21, S0, &S0::Transit< H > >, - sc::transition< B, S211, S0, &S0::Transit< B > > >, S211 > + struct S21 : Orthogonal1< S21, S2::orthogonal< 2 >, S211 > { + typedef mpl::list< + sc::transition< H, S21, S0, &S0::Transit< H > >, + sc::transition< B, S211, S0, &S0::Transit< B > > + > reactions; + S21( my_context ctx ) : my_base( ctx ) {} }; - struct S211 : InnermostDefault< S211, S21::orthogonal< 1 >, mpl::list< - sc::transition< D, S21, S0, &S0::Transit< D > >, - sc::transition< G, S0 > > > + struct S211 : InnermostDefault< S211, S21::orthogonal< 1 > > { + typedef mpl::list< + sc::transition< D, S21, S0, &S0::Transit< D > >, + sc::transition< G, S0 > + > reactions; + S211( my_context ctx ) : my_base( ctx ) {} }; - struct S1 : Orthogonal1< S1, S0, mpl::list< - sc::transition< A, S1, S0, &S0::Transit< A > >, - sc::transition< B, S11, S0, &S0::Transit< B > >, - sc::transition< C, S2, S0, &S0::Transit< C > >, - sc::transition< D, S0 >, - sc::transition< F, S211, S0, &S0::Transit< F > > >, S11 > + struct S1 : Orthogonal1< S1, S0, S11 > { + typedef mpl::list< + sc::transition< A, S1, S0, &S0::Transit< A > >, + sc::transition< B, S11, S0, &S0::Transit< B > >, + sc::transition< C, S2, S0, &S0::Transit< C > >, + sc::transition< D, S0 >, + sc::transition< F, S211, S0, &S0::Transit< F > > + > reactions; + S1( my_context ctx ) : my_base( ctx ) {} }; - struct S11 : InnermostDefault< S11, S1::orthogonal< 1 >, mpl::list< - sc::transition< G, S211, S0, &S0::Transit< G > >, - sc::custom_reaction< H > > > + struct S11 : InnermostDefault< S11, S1::orthogonal< 1 > > { + typedef mpl::list< + sc::transition< G, S211, S0, &S0::Transit< G > >, + sc::custom_reaction< H > + > reactions; + S11( my_context ctx ) : my_base( ctx ) {} sc::result react( const H & ) diff --git a/test/TypeInfoTest.cpp b/test/TypeInfoTest.cpp index 319bbfa..53d017f 100644 --- a/test/TypeInfoTest.cpp +++ b/test/TypeInfoTest.cpp @@ -21,7 +21,7 @@ struct A; struct TypeInfoTest : sc::state_machine< TypeInfoTest, A > {}; struct B; -struct A : sc::simple_state< A, TypeInfoTest, sc::no_reactions, B > {}; +struct A : sc::simple_state< A, TypeInfoTest, B > {}; struct B : sc::simple_state< B, A > {}; diff --git a/test/UnsupportedDeepHistoryTest.cpp b/test/UnsupportedDeepHistoryTest.cpp index 2261c6b..221e7a2 100644 --- a/test/UnsupportedDeepHistoryTest.cpp +++ b/test/UnsupportedDeepHistoryTest.cpp @@ -24,12 +24,12 @@ struct UnsupportedDeepHistoryTest : sc::state_machine< UnsupportedDeepHistoryTest, A > {}; struct B; -struct A : sc::simple_state< A, UnsupportedDeepHistoryTest, - sc::no_reactions, B, sc::has_deep_history > {}; +struct A : sc::simple_state< + A, UnsupportedDeepHistoryTest, B, sc::has_deep_history > {}; struct C; struct D; - struct B : sc::simple_state< B, A, sc::no_reactions, mpl::list< C, D > > {}; + struct B : sc::simple_state< B, A, mpl::list< C, D > > {}; struct C : sc::simple_state< C, B::orthogonal< 0 > > {}; struct D : sc::simple_state< D, B::orthogonal< 1 > > {};