| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567 |
- // Copyright 2008 Christophe Henry
- // henry UNDERSCORE christophe AT hotmail DOT com
- // This is an extended version of the state machine available in the boost::mpl library
- // Distributed under the same license as the original.
- // Copyright for the original version:
- // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
- // under the Boost Software License, Version 1.0. (See accompanying
- // file LICENSE_1_0.txt or copy at
- // http://www.boost.org/LICENSE_1_0.txt)
- #ifndef BOOST_MSM_FRONT_EUML_OPERATOR_H
- #define BOOST_MSM_FRONT_EUML_OPERATOR_H
- #include <iterator>
- #include <boost/msm/front/euml/common.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/mpl/has_key.hpp>
- #include <boost/mpl/eval_if.hpp>
- #include <boost/mpl/set.hpp>
- #include <boost/type_traits.hpp>
- BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
- BOOST_MPL_HAS_XXX_TRAIT_DEF(key_type)
- namespace boost { namespace msm { namespace front { namespace euml
- {
- template <class T1,class T2>
- struct Or_ : euml_action<Or_<T1,T2> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
- {
- return (T1()(evt,fsm,src,tgt) || T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)
- {
- return (T1()(evt,fsm,state) || T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct And_ : euml_action<And_<T1,T2> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
- {
- return (T1()(evt,fsm,src,tgt) && T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)
- {
- return (T1()(evt,fsm,state) && T2()(evt,fsm,state));
- }
- };
- template <class T1>
- struct Not_ : euml_action<Not_<T1> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
- {
- return !(T1()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)
- {
- return !(T1()(evt,fsm,state));
- }
- };
- template <class Condition,class Action1,class Action2, class Enable=void >
- struct If_Else_ : euml_action<If_Else_<Condition,Action1,Action2,Enable> > {};
- template <class Condition,class Action1,class Action2>
- struct If_Else_<Condition,Action1,Action2
- , typename ::boost::enable_if<typename has_tag_type<Action1>::type >::type>
- : euml_action<If_Else_<Condition,Action1,Action2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<Action1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<Action1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename Action1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- if (Condition()(evt,fsm,src,tgt))
- {
- return Action1()(evt,fsm,src,tgt);
- }
- return Action2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename Action1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- if (Condition()(evt,fsm,state))
- {
- return Action1()(evt,fsm,state);
- }
- return Action2()(evt,fsm,state);
- }
- };
- template <class Condition,class Action1,class Action2>
- struct If_Else_<Condition,Action1,Action2
- , typename ::boost::disable_if<typename has_tag_type<Action1>::type >::type>
- : euml_action<If_Else_<Condition,Action1,Action2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- if (Condition()(evt,fsm,src,tgt))
- {
- return Action1()(evt,fsm,src,tgt);
- }
- return Action2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- if (Condition()(evt,fsm,state))
- {
- return Action1()(evt,fsm,state);
- }
- return Action2()(evt,fsm,state);
- }
- };
- struct if_tag
- {
- };
- struct If : proto::extends<proto::terminal<if_tag>::type, If, boost::msm::sm_domain>
- {
- If(){}
- using proto::extends< proto::terminal<if_tag>::type, If, boost::msm::sm_domain>::operator=;
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef If_Else_<Arg1,Arg2,Arg3> type;
- };
- };
- If const if_then_else_;
- template <class Condition,class Action1, class Enable=void >
- struct If_Then_ : euml_action<If_Then_<Condition,Action1,Enable> > {};
- template <class Condition,class Action1>
- struct If_Then_<Condition,Action1
- , typename ::boost::enable_if<typename has_tag_type<Action1>::type >::type>
- : euml_action<If_Then_<Condition,Action1> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<Action1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<Action1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename Action1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- if (Condition()(evt,fsm,src,tgt))
- {
- return Action1()(evt,fsm,src,tgt);
- }
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename Action1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- if (Condition()(evt,fsm,state))
- {
- return Action1()(evt,fsm,state);
- }
- }
- };
- template <class Condition,class Action1>
- struct If_Then_<Condition,Action1
- , typename ::boost::disable_if<typename has_tag_type<Action1>::type >::type>
- : euml_action<If_Then_<Condition,Action1> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- if (Condition()(evt,fsm,src,tgt))
- {
- return Action1()(evt,fsm,src,tgt);
- }
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- if (Condition()(evt,fsm,state))
- {
- return Action1()(evt,fsm,state);
- }
- }
- };
- struct if_then_tag
- {
- };
- struct If_Then : proto::extends< proto::terminal<if_then_tag>::type, If_Then, boost::msm::sm_domain>
- {
- If_Then(){}
- using proto::extends< proto::terminal<if_then_tag>::type, If_Then, boost::msm::sm_domain>::operator=;
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef If_Then_<Arg1,Arg2> type;
- };
- };
- If_Then const if_then_;
- template <class Condition,class Body>
- struct While_Do_ : euml_action<While_Do_<Condition,Body> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef void type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef void type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- Body body_;
- Condition cond_;
- while (cond_(evt,fsm,src,tgt))
- {
- body_(evt,fsm,src,tgt);
- }
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- Body body_;
- Condition cond_;
- while (cond_(evt,fsm,state))
- {
- body_(evt,fsm,state);
- }
- }
- };
- struct while_do_tag
- {
- };
- struct While_Do_Helper : proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, boost::msm::sm_domain>
- {
- While_Do_Helper(){}
- using proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, boost::msm::sm_domain>::operator=;
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef While_Do_<Arg1,Arg2> type;
- };
- };
- While_Do_Helper const while_;
- template <class Condition,class Body>
- struct Do_While_ : euml_action<Do_While_<Condition,Body> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef void type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef void type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- Condition cond_;
- Body body_;
- do
- {
- body_(evt,fsm,src,tgt);
- } while (cond_(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- Condition cond_;
- Body body_;
- do
- {
- body_(evt,fsm,state);
- } while (cond_(evt,fsm,state));
- }
- };
- struct do_while_tag
- {
- };
- struct Do_While_Helper : proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, boost::msm::sm_domain>
- {
- Do_While_Helper(){}
- using proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, boost::msm::sm_domain>::operator=;
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef Do_While_<Arg1,Arg2> type;
- };
- };
- Do_While_Helper const do_while_;
- template <class Begin,class End,class EndLoop,class Body>
- struct For_Loop_ : euml_action<For_Loop_<Begin,End,EndLoop,Body> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef void type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef void type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- End end_;
- EndLoop end_loop_;
- Body body_;
- for(Begin()(evt,fsm,src,tgt);end_(evt,fsm,src,tgt);end_loop_(evt,fsm,src,tgt))
- {
- body_(evt,fsm,src,tgt);
- }
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- End end_;
- EndLoop end_loop_;
- Body body_;
- for(Begin()(evt,fsm,state);end_(evt,fsm,state);end_loop_(evt,fsm,state))
- {
- body_(evt,fsm,state);
- }
- }
- };
- struct for_loop_tag
- {
- };
- struct For_Loop_Helper : proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, boost::msm::sm_domain>
- {
- For_Loop_Helper(){}
- using proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, boost::msm::sm_domain>::operator=;
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef For_Loop_<Arg1,Arg2,Arg3,Arg4> type;
- };
- };
- For_Loop_Helper const for_;
- template <class T>
- struct Deref_ : euml_action<Deref_<T> >
- {
- Deref_(){}
- using euml_action<Deref_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::add_reference<
- typename std::iterator_traits <
- typename ::boost::remove_reference<
- typename get_result_type2<T,Event,FSM,STATE>::type>::type>::value_type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::add_reference<
- typename std::iterator_traits<
- typename ::boost::remove_reference<
- typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type
- >::value_type
- >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return *(T()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return *(T()(evt,fsm,state));
- }
- };
- template <class T>
- struct Pre_inc_ : euml_action<Pre_inc_<T> >
- {
- using euml_action<Pre_inc_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return ++T()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return ++T()(evt,fsm,state);
- }
- };
- template <class T>
- struct Pre_dec_ : euml_action<Pre_dec_<T> >
- {
- using euml_action<Pre_dec_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return --T()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return --T()(evt,fsm,state);
- }
- };
- template <class T>
- struct Post_inc_ : euml_action<Post_inc_<T> >
- {
- using euml_action<Post_inc_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T()(evt,fsm,src,tgt)++;
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T()(evt,fsm,state)++;
- }
- };
- template <class T>
- struct Post_dec_ : euml_action<Post_dec_<T> >
- {
- using euml_action<Post_dec_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T()(evt,fsm,src,tgt)--;
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T()(evt,fsm,state)--;
- }
- };
- template <class T1,class T2>
- struct Plus_ : euml_action<Plus_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)+T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)+T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Minus_ : euml_action<Minus_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)-T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)-T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Multiplies_ : euml_action<Multiplies_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)*T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)*T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Divides_ : euml_action<Divides_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)/T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)/T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Modulus_ : euml_action<Modulus_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)%T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)%T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Bitwise_And_ : euml_action<Bitwise_And_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)&T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)&T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Bitwise_Or_ : euml_action<Bitwise_Or_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)|T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)|T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Bitwise_Xor_ : euml_action<Bitwise_Xor_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)^T2()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)^T2()(evt,fsm,state);
- }
- };
- template <class T1,class T2>
- struct Subscript_ : euml_action<Subscript_<T1,T2> >
- {
- template <class T>
- struct get_reference
- {
- typedef typename T::reference type;
- };
- template <class T>
- struct get_mapped_type
- {
- typedef typename T::value_type::second_type& type;
- };
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type container_type;
- typedef typename ::boost::mpl::eval_if<
- typename has_key_type<container_type>::type,
- get_mapped_type<container_type>,
- ::boost::mpl::eval_if<
- typename ::boost::is_pointer<container_type>::type,
- ::boost::add_reference<typename ::boost::remove_pointer<container_type>::type >,
- get_reference<container_type>
- >
- >::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type container_type;
- typedef typename ::boost::mpl::eval_if<
- typename has_key_type<container_type>::type,
- get_mapped_type<container_type>,
- ::boost::mpl::eval_if<
- typename ::boost::is_pointer<container_type>::type,
- ::boost::add_reference<typename ::boost::remove_pointer<container_type>::type >,
- get_reference<container_type>
- >
- >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return T1()(evt,fsm,src,tgt)[T2()(evt,fsm,src,tgt)];
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return T1()(evt,fsm,state)[T2()(evt,fsm,state)];
- }
- };
- template <class T1,class T2>
- struct Plus_Assign_ : euml_action<Plus_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)+=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)+=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Minus_Assign_ : euml_action<Minus_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)-=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)-=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Multiplies_Assign_ : euml_action<Multiplies_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)*=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)*=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Divides_Assign_ : euml_action<Divides_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)/=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)/=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Modulus_Assign_ : euml_action<Modulus_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)%=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)%=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct ShiftLeft_Assign_ : euml_action<ShiftLeft_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)<<=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)<<=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct ShiftRight_Assign_ : euml_action<ShiftRight_Assign_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)>>=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)>>=T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct ShiftLeft_ : euml_action<ShiftLeft_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)<<T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)<<T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct ShiftRight_ : euml_action<ShiftRight_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)>>T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)>>T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Assign_ : euml_action<Assign_<T1,T2> >
- {
- using euml_action< Assign_<T1,T2> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt)=T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return (T1()(evt,fsm,state)=T2()(evt,fsm,state));
- }
- };
- template <class T1>
- struct Unary_Plus_ : euml_action<Unary_Plus_<T1> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return +T1()(evt,fsm,src,tgt);
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return +T1()(evt,fsm,state);
- }
- };
- template <class T1>
- struct Unary_Minus_ : euml_action<Unary_Minus_<T1> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::remove_reference<
- typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,action_tag>::type,
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
- operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return -(T1()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename T1::tag_type,state_action_tag>::type,
- typename state_action_result<Event,FSM,STATE>::type >::type
- operator()(Event const& evt,FSM& fsm,STATE& state )const
- {
- return -(T1()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Less_ : euml_action<Less_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt) < T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (T1()(evt,fsm,state) < T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct LessEqual_ : euml_action<LessEqual_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt) <= T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (T1()(evt,fsm,state) <= T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct Greater_ : euml_action<Greater_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt) > T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (T1()(evt,fsm,state) > T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct GreaterEqual_ : euml_action<GreaterEqual_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt) >= T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (T1()(evt,fsm,state) >= T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct EqualTo_ : euml_action<EqualTo_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt) == T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (T1()(evt,fsm,state) == T2()(evt,fsm,state));
- }
- };
- template <class T1,class T2>
- struct NotEqualTo_ : euml_action<NotEqualTo_<T1,T2> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (T1()(evt,fsm,src,tgt) != T2()(evt,fsm,src,tgt));
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (T1()(evt,fsm,state) != T2()(evt,fsm,state));
- }
- };
- }}}}
- #endif // BOOST_MSM_FRONT_EUML_OPERATOR_H
|