12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714 |
- // 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_COMMON_H
- #define BOOST_MSM_FRONT_EUML_COMMON_H
- #include <boost/config.hpp>
- #include <boost/msm/proto_config.hpp>
- #include <iterator>
- #include <utility>
- #include <boost/proto/core.hpp>
- #include <boost/proto/transform.hpp>
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/is_same.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/type_traits/add_const.hpp>
- #include <boost/mpl/vector.hpp>
- #include <boost/mpl/set.hpp>
- #include <boost/mpl/has_key.hpp>
- #include <boost/mpl/int.hpp>
- #include <boost/mpl/less_equal.hpp>
- #if BOOST_VERSION >= 104000
- #include <boost/mpl/string.hpp>
- #endif
- #include <boost/fusion/container/vector.hpp>
- #include <boost/fusion/include/at_c.hpp>
- #include <boost/fusion/include/make_map.hpp>
- #include <boost/fusion/include/pair.hpp>
- #include <boost/fusion/include/as_vector.hpp>
- #include <boost/fusion/include/pair.hpp>
- #include <boost/fusion/include/is_sequence.hpp>
- #include <boost/type_traits/remove_reference.hpp>
- #include <boost/preprocessor/repetition/enum_params.hpp>
- #include <boost/preprocessor/arithmetic/sub.hpp>
- #include <boost/preprocessor/punctuation/comma_if.hpp>
- #include <boost/preprocessor/control/expr_if.hpp>
- #include <boost/preprocessor/punctuation/comma.hpp>
- #include <boost/preprocessor/arithmetic/add.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/preprocessor/comparison/less.hpp>
- #include <boost/preprocessor/arithmetic/dec.hpp>
- #include <boost/preprocessor/repetition/repeat_from_to.hpp>
- #include <boost/preprocessor/cat.hpp>
- #include <boost/msm/msm_grammar.hpp>
- #include <boost/msm/active_state_switching_policies.hpp>
- #include <boost/msm/event_traits.hpp>
- #include <boost/msm/front/functor_row.hpp>
- namespace proto = boost::proto;
- BOOST_MPL_HAS_XXX_TRAIT_DEF(tag_type)
- BOOST_MPL_HAS_XXX_TRAIT_DEF(action_name)
- BOOST_MPL_HAS_XXX_TRAIT_DEF(not_intern_euml_state)
- namespace boost { namespace msm { namespace front { namespace euml
- {
- template <class T>
- struct get_iterator
- {
- typedef typename T::iterator type;
- };
- template <class T>
- struct get_reverse_iterator
- {
- typedef typename T::reverse_iterator type;
- };
- template <class T>
- struct get_reference
- {
- typedef typename T::reference type;
- };
- template <class T>
- struct get_size_type
- {
- typedef typename T::size_type type;
- };
- template <class T>
- struct get_value_type
- {
- typedef typename T::value_type type;
- };
- template <class T>
- struct get_first_type
- {
- typedef typename T::first_type type;
- };
- template <class T>
- struct get_second_type
- {
- typedef typename T::second_type type;
- };
- template <class T>
- struct get_action_tag_type
- {
- typedef typename ::boost::mpl::has_key<
- typename T::tag_type,action_tag>::type type;
- };
- template <class T>
- struct get_state_action_tag_type
- {
- typedef typename ::boost::mpl::has_key<
- typename T::tag_type,state_action_tag>::type type;
- };
- template <class T,class EVT,class FSM,class SourceState,class TargetState>
- struct get_result_type
- {
- typedef typename T::template transition_action_result<EVT,FSM,SourceState,TargetState>::type type;
- };
- template <class T,class Event,class FSM,class STATE>
- struct get_result_type2
- {
- typedef typename T::template state_action_result<Event,FSM,STATE>::type type;
- };
- template<class SEQ>
- struct get_sequence
- {
- typedef typename SEQ::sequence type;
- };
- template <class T>
- struct get_attributes_type
- {
- typedef typename T::attributes_type type;
- };
- template <class T>
- struct get_euml_tag_type
- {
- typedef typename T::euml_tag_type type;
- };
- template <class T,class Arg1=void,class Arg2=void,class Arg3=void,class Arg4=void,class Arg5=void
- #ifdef BOOST_MSVC
- ,class Arg6=void
- #endif
- >
- struct get_fct
- {
- typedef typename T::template In<Arg1,Arg2,Arg3,Arg4,Arg5
- #ifdef BOOST_MSVC
- ,Arg6
- #endif
- >::type type;
- };
- // used to differentiate between different types of euml_state's
- template <class T,class Enable=void>
- struct get_state_name
- {
- typedef T type;
- };
- template <class T>
- struct get_state_name<T,typename ::boost::enable_if<has_not_intern_euml_state<T> >::type>
- {
- typedef typename T::In::type type;
- };
- template <class T>
- struct get_action_name
- {
- typedef typename T::action_name type;
- };
- template <class T>
- struct get_event_name
- {
- typedef typename T::event_name type;
- };
- template <class EVT>
- struct euml_event: proto::extends<typename proto::terminal<event_tag>::type, EVT, boost::msm::sm_domain>
- {
- typedef event_tag euml_tag_type;
- typedef EVT event_name;
- using proto::extends<typename proto::terminal<event_tag>::type, EVT, 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 EVT type;
- };
- };
- template <class STATE>
- struct euml_state_intern: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, boost::msm::state_domain>
- {
- typedef state_tag euml_tag_type;
- using proto::extends<typename proto::terminal<state_tag>::type, STATE, boost::msm::state_domain>::operator=;
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef STATE type;
- };
- };
- template <class STATE>
- struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, boost::msm::state_domain>
- {
- typedef state_tag euml_tag_type;
- typedef int not_intern_euml_state;
- using proto::extends<typename proto::terminal<state_tag>::type, STATE, boost::msm::state_domain>::operator=;
- struct In
- {
- typedef STATE type;
- };
- };
- template <class ACTION>
- struct euml_action: proto::extends<typename proto::terminal<action_tag>::type, ACTION, boost::msm::sm_domain>
- {
- typedef action_tag euml_tag_type;
- typedef ACTION action_name;
- using proto::extends<typename proto::terminal<action_tag>::type, ACTION, 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 ACTION type;
- };
- };
- template <class FLAG>
- struct euml_flag: proto::extends<typename proto::terminal<flag_tag>::type, FLAG, boost::msm::sm_domain>
- {
- typedef flag_tag euml_tag_type;
- using proto::extends<typename proto::terminal<flag_tag>::type, FLAG, 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 FLAG type;
- };
- };
- template <class CONFIG>
- struct euml_config: proto::extends<typename proto::terminal<config_tag>::type, CONFIG, boost::msm::sm_domain>
- {
- typedef config_tag euml_tag_type;
- using proto::extends<typename proto::terminal<config_tag>::type, CONFIG, 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 CONFIG type;
- };
- };
- struct No_Exception : euml_config<No_Exception>
- {
- typedef int no_exception_thrown;
- No_Exception(){}
- };
- struct No_Msg_Queue : euml_config<No_Msg_Queue>
- {
- typedef int no_message_queue;
- No_Msg_Queue(){}
- };
- struct Deferred_Events : euml_config<Deferred_Events>
- {
- typedef int activate_deferred_events;
- Deferred_Events(){}
- };
- No_Exception const no_exception=No_Exception();
- No_Msg_Queue const no_msg_queue=No_Msg_Queue();
- Deferred_Events const deferred_events=Deferred_Events();
- struct ActiveStateSwitchBeforeTransition : euml_config<ActiveStateSwitchBeforeTransition>
- {
- typedef boost::msm::active_state_switch_before_transition active_state_switch_policy;
- ActiveStateSwitchBeforeTransition(){}
- };
- ActiveStateSwitchBeforeTransition const switch_active_before_transition = ActiveStateSwitchBeforeTransition();
- struct ActiveStateSwitchAfterExit : euml_config<ActiveStateSwitchAfterExit>
- {
- typedef boost::msm::active_state_switch_after_exit active_state_switch_policy;
- ActiveStateSwitchAfterExit(){}
- };
- ActiveStateSwitchAfterExit const switch_active_after_exit = ActiveStateSwitchAfterExit();
- struct ActiveStateSwitchAfterAction : euml_config<ActiveStateSwitchAfterAction>
- {
- typedef boost::msm::active_state_switch_after_transition_action active_state_switch_policy;
- ActiveStateSwitchAfterAction(){}
- };
- ActiveStateSwitchAfterAction const switch_active_after_action = ActiveStateSwitchAfterAction();
- struct invalid_type{};
- struct make_invalid_type
- {
- typedef invalid_type type;
- };
- template <class ROW>
- struct make_vector_one_row
- {
- typedef boost::mpl::vector<ROW> type;
- };
- template <class T>
- T make_T(T t) {return t;}
- struct make_vector_no_row
- {
- typedef boost::mpl::vector0<> type;
- };
- struct NoAction : euml_action<NoAction>
- {
- NoAction(){}
- // return value if used inside a state action (entry/exit)
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef bool type;
- };
- // return value if used inside a transition (action/guard)
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef bool type;
- };
- // this functor can be used in both modes, state action and transition action
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- bool operator()(Event const&,FSM&,STATE& )
- {
- // does nothing
- return true;
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- bool operator()(EVT const& ,FSM& ,SourceState& ,TargetState&)const
- {
- // does nothing
- return true;
- }
- };
- NoAction const no_action = NoAction();
- struct fsm_artefact_tag {};
- template <class Index=void>
- struct GetSource_ : euml_action<GetSource_<Index> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::fusion::result_of::at_key<typename SourceState::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& ,FSM& ,SourceState& src,TargetState&)const
- {
- return src.get_attribute(Index());
- }
- };
- template<>
- struct GetSource_<void> : euml_action<GetSource_<void> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef SourceState& type;
- };
- typedef ::boost::mpl::set<action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
- {
- return src;
- }
- };
- struct GetSource_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetSource_Helper, boost::msm::sm_domain>
- {
- GetSource_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef GetSource_<Arg1> type;
- };
- };
- GetSource_Helper const source_ = GetSource_Helper();
- template <class Index=void>
- struct GetTarget_ : euml_action<GetTarget_<Index> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::fusion::result_of::at_key<typename TargetState::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
- {
- return tgt.get_attribute(Index());
- }
- };
- template<>
- struct GetTarget_<void> : euml_action<GetTarget_<void> >
- {
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef TargetState& type;
- };
- typedef ::boost::mpl::set<action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& , FSM&,SourceState& ,TargetState& tgt)const
- {
- return tgt;
- }
- };
- struct GetTarget_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetTarget_Helper, boost::msm::sm_domain>
- {
- GetTarget_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef GetTarget_<Arg1> type;
- };
- };
- GetTarget_Helper const target_ = GetTarget_Helper();
- template <class Index=void>
- struct GetState_ : euml_action<GetState_<Index> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::fusion::result_of::at_key<typename STATE::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& ,STATE& state )
- {
- return state.get_attribute(Index());
- }
- };
- template<>
- struct GetState_<void> : euml_action<GetState_<void> >
- {
- using euml_action<GetState_ >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef STATE& type;
- };
- typedef ::boost::mpl::set<state_action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& ,STATE& state )
- {
- return state;
- }
- };
- struct GetState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetState_Helper, boost::msm::sm_domain>
- {
- GetState_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef GetState_<Arg1> type;
- };
- };
- GetState_Helper const state_ = GetState_Helper();
- template <class Index=void>
- struct GetEvent_ : euml_action<GetEvent_<Index> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::add_const<
- typename ::boost::fusion::result_of::at_key<typename Event::attributes_type,
- Index >::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::add_const<
- typename ::boost::fusion::result_of::at_key<typename EVT::attributes_type,
- Index >::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const& evt,FSM& ,STATE& )
- {
- return evt.get_attribute(Index());
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
- {
- return evt.get_attribute(Index());
- }
- };
- template <>
- struct GetEvent_<void> : euml_action<GetEvent_<void> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef Event const& type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef EVT const& type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const& evt,FSM& ,STATE& )
- {
- return evt;
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
- {
- return evt;
- }
- };
- struct GetEvent_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetEvent_Helper, boost::msm::sm_domain>
- {
- GetEvent_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef GetEvent_<Arg1> type;
- };
- };
- GetEvent_Helper const event_ = GetEvent_Helper();
- template <class Index=void>
- struct GetFsm_ : euml_action<GetFsm_<Index> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
- Index >::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& fsm,STATE& )
- {
- return fsm.get_attribute(Index());
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
- {
- return fsm.get_attribute(Index());
- }
- };
- template<>
- struct GetFsm_<void> : euml_action<GetFsm_<void> >
- {
- using euml_action<GetFsm_>::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef FSM& type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef FSM& type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& fsm,STATE& )
- {
- return fsm;
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
- {
- return fsm;
- }
- };
- struct GetFsm_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetFsm_Helper, boost::msm::sm_domain>
- {
- GetFsm_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef GetFsm_<Arg1> type;
- };
- };
- GetFsm_Helper const fsm_ = GetFsm_Helper();
- template <class StateName,class Param1>
- struct SubState_ : euml_action<SubState_<StateName, Param1> >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef StateName& type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef StateName& type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- StateName& operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
- {
- return (Param1()(evt,fsm,src,tgt)).template get_state<StateName&>();
- }
- template <class Event,class FSM,class STATE>
- StateName& operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (Param1()(evt,fsm,state)).template get_state<StateName&>();
- }
- };
- template <class StateName>
- struct SubState_ <StateName,void>
- : euml_action<SubState_<StateName, void > >
- {
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef StateName& type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef StateName& type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- StateName& operator()(EVT const&,FSM& fsm,SourceState& ,TargetState& )const
- {
- return fsm.template get_state<StateName&>();
- }
- template <class Event,class FSM,class STATE>
- StateName& operator()(Event const& ,FSM& fsm,STATE& )const
- {
- return fsm.template get_state<StateName&>();
- }
- };
- struct SubState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, boost::msm::sm_domain>
- {
- SubState_Helper(){}
- using proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_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 SubState_<Arg1,Arg2> type;
- };
- };
- SubState_Helper const substate_ = SubState_Helper();
- template <class Target,class Index>
- struct GetAttribute_ : euml_action<GetAttribute_<Target, Index> >
- {
- using euml_action<GetAttribute_<Target,Index> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<
- typename get_attributes_type<
- typename ::boost::remove_reference<
- typename get_result_type2<Target,Event,FSM,STATE>::type>::type>::type,
- Index >::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<
- typename get_attributes_type<
- typename ::boost::remove_reference<
- typename get_result_type<Target,EVT,FSM,SourceState,TargetState>::type>::type>::type,
- Index >::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 Target::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 (Target()(evt,fsm,src,tgt)).get_attribute(Index());
- }
- template <class Event,class FSM,class STATE>
- typename ::boost::enable_if<
- typename ::boost::mpl::has_key<
- typename Target::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 (Target()(evt,fsm,state)).get_attribute(Index());
- }
- };
- struct GetAttribute_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetAttribute_Helper, boost::msm::sm_domain>
- {
- GetAttribute_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef GetAttribute_<Arg1,Arg2> type;
- };
- };
- GetAttribute_Helper const attribute_ = GetAttribute_Helper();
- template <class Index>
- struct Source_ : euml_action<Source_<Index> >
- {
- using euml_action<Source_<Index> >::operator=;
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<typename SourceState::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
- {
- return src.get_attribute(Index());
- }
- };
- template <class Index>
- struct Target_ : euml_action<Target_<Index> >
- {
- using euml_action<Target_<Index> >::operator=;
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<typename TargetState::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
- {
- return tgt.get_attribute(Index());
- }
- };
- template <class Index>
- struct State_ : euml_action<State_<Index> >
- {
- using euml_action<State_<Index> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<typename STATE::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& ,STATE& state )
- {
- return state.get_attribute(Index());
- }
- };
- template <class Index>
- struct Event_ : euml_action<Event_<Index> >
- {
- using euml_action<Event_<Index> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename ::boost::add_const<
- typename ::boost::fusion::result_of::at_key<typename Event::attributes_type,
- Index >::type>::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename ::boost::add_const<
- typename ::boost::fusion::result_of::at_key<typename EVT::attributes_type,
- Index >::type>::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const& evt,FSM& ,STATE& )
- {
- return evt.get_attribute(Index());
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
- {
- return evt.get_attribute(Index());
- }
- };
- template <class StateType,class Index>
- struct State_Attribute_ : euml_action<State_Attribute_<StateType,Index> >
- {
- using euml_action<State_Attribute_<StateType,Index> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<typename StateType::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& fsm,STATE& )
- {
- return fsm.template get_state<StateType&>().get_attribute(Index());
- }
- };
- template <class Index>
- struct Fsm_ : euml_action<Fsm_<Index> >
- {
- using euml_action<Fsm_<Index> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
- Index >::type type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef typename
- ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
- Index >::type type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class Event,class FSM,class STATE>
- typename state_action_result<Event,FSM,STATE>::type
- operator()(Event const&,FSM& fsm,STATE& )
- {
- return fsm.get_attribute(Index());
- }
- template <class EVT,class FSM,class SourceState,class TargetState>
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
- operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
- {
- return fsm.get_attribute(Index());
- }
- };
- struct True_ : euml::euml_action<True_>
- {
- using euml_action<True_>::operator=;
- True_(){}
- 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&,FSM&,SourceState& ,TargetState& )
- {
- return true;
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const&,FSM&,STATE& )
- {
- return true;
- }
- };
- True_ const true_ = True_();
- struct False_ : euml::euml_action<False_>
- {
- using euml_action<False_>::operator=;
- False_(){}
- 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&,FSM&,SourceState& ,TargetState& )
- {
- return false;
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const&,FSM&,STATE& )
- {
- return false;
- }
- };
- False_ const false_ = False_();
- template <int Val>
- struct Int_ : euml_action<Int_<Val> >
- {
- using euml_action<Int_<Val> >::operator=;
- typedef ::boost::mpl::int_<Val> value_type;
- enum {value = Val};
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef int type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef int type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- int operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
- {
- return Val;
- }
- template <class Event,class FSM,class STATE>
- int operator()(Event const& ,FSM& ,STATE& )
- {
- return Val;
- }
- };
- template <char Val>
- struct Char_ : euml_action<Char_<Val> >
- {
- using euml_action<Char_<Val> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef char type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef char type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- char operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
- {
- return Val;
- }
- template <class Event,class FSM,class STATE>
- char operator()(Event const& ,FSM& ,STATE& )
- {
- return Val;
- }
- };
- template <size_t Val>
- struct Size_t_ : euml_action<Size_t_<Val> >
- {
- using euml_action<Size_t_<Val> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef size_t type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef size_t type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- size_t operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
- {
- return Val;
- }
- template <class Event,class FSM,class STATE>
- size_t operator()(Event const& ,FSM& ,STATE& )
- {
- return Val;
- }
- };
- #if BOOST_VERSION >= 104000
- template <class T>
- struct String_ : euml_action<String_<T> >
- {
- using euml_action<String_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef char const* type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef char const* type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- char const* operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
- {
- return ::boost::mpl::c_str<T>::value;
- }
- template <class Event,class FSM,class STATE>
- char const* operator()(Event const& ,FSM& ,STATE& )
- {
- return ::boost::mpl::c_str<T>::value;
- }
- };
- #endif
- template <class T>
- struct Predicate_ : euml_action<Predicate_<T> >
- {
- using euml_action<Predicate_<T> >::operator=;
- template <class Event,class FSM,class STATE >
- struct state_action_result
- {
- typedef T type;
- };
- template <class EVT,class FSM,class SourceState,class TargetState>
- struct transition_action_result
- {
- typedef T type;
- };
- typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
- template <class EVT,class FSM,class SourceState,class TargetState>
- T operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
- {
- return T();
- }
- template <class Event,class FSM,class STATE>
- T operator()(Event const& ,FSM& ,STATE& )
- {
- return T();
- }
- };
- template <class ToProcessEvt,class Param1, class Param2, class Param3, class Param4>
- struct Process_ : euml_action<Process_<ToProcessEvt, Param1, Param2, Param3, Param4> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- (Param3()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- (Param4()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
- (Param2()(evt,fsm,state)).process_event(ToProcessEvt());
- (Param3()(evt,fsm,state)).process_event(ToProcessEvt());
- (Param4()(evt,fsm,state)).process_event(ToProcessEvt());
- }
- };
- template <class ToProcessEvt>
- struct Process_ <ToProcessEvt,void,void,void,void>
- : euml_action<Process_<ToProcessEvt, void, void, void, void > >
- {
- 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&,FSM& fsm,SourceState& ,TargetState& )const
- {
- fsm.process_event(ToProcessEvt());
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& ,FSM& fsm,STATE& )const
- {
- fsm.process_event(ToProcessEvt());
- }
- };
- template <class ToProcessEvt,class Param1>
- struct Process_ <ToProcessEvt,Param1,void,void,void>
- : euml_action<Process_<ToProcessEvt, Param1, void, void, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
- }
- };
- template <class ToProcessEvt,class Param1, class Param2>
- struct Process_ <ToProcessEvt,Param1,Param2,void,void>
- : euml_action<Process_<ToProcessEvt, Param1, Param2, void, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
- (Param2()(evt,fsm,state)).process_event(ToProcessEvt());
- }
- };
- template <class ToProcessEvt,class Param1, class Param2, class Param3>
- struct Process_ <ToProcessEvt,Param1,Param2,Param3,void>
- : euml_action<Process_<ToProcessEvt, Param1, Param2, Param3, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- (Param3()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
- (Param2()(evt,fsm,state)).process_event(ToProcessEvt());
- (Param3()(evt,fsm,state)).process_event(ToProcessEvt());
- }
- };
- //version for process_(event_)
- template <>
- struct Process_ <GetEvent_<void>,void,void,void,void>
- : euml_action<Process_<GetEvent_<void>, void, void, void, void > >
- {
- 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& ,TargetState& )const
- {
- fsm.process_event(evt);
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& )const
- {
- fsm.process_event(evt);
- }
- };
- struct process_tag {};
- struct Process_Helper: proto::extends< proto::terminal<process_tag>::type, Process_Helper, boost::msm::sm_domain>
- {
- Process_Helper(){}
- using proto::extends< proto::terminal<process_tag>::type, Process_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 Process_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
- };
- };
- Process_Helper const process_ = Process_Helper();
- template <class Param1, class Param2, class Param3, class Param4>
- struct Reprocess_ : euml_action<Reprocess_<Param1, Param2, Param3, Param4> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(evt);
- (Param2()(evt,fsm,src,tgt)).process_event(evt);
- (Param3()(evt,fsm,src,tgt)).process_event(evt);
- (Param4()(evt,fsm,src,tgt)).process_event(evt);
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(evt);
- (Param2()(evt,fsm,state)).process_event(evt);
- (Param3()(evt,fsm,state)).process_event(evt);
- (Param4()(evt,fsm,state)).process_event(evt);
- }
- };
- template <>
- struct Reprocess_ <void,void,void,void>
- : euml_action<Reprocess_<void, void, void, void > >
- {
- 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& ,TargetState& )const
- {
- fsm.process_event(evt);
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& )const
- {
- fsm.process_event(evt);
- }
- };
- template <class Param1>
- struct Reprocess_ <Param1,void,void,void>
- : euml_action<Reprocess_<Param1, void, void, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(evt);
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(evt);
- }
- };
- template <class Param1, class Param2>
- struct Reprocess_ <Param1,Param2,void,void>
- : euml_action<Reprocess_<Param1, Param2, void, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(evt);
- (Param2()(evt,fsm,src,tgt)).process_event(evt);
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(evt);
- (Param2()(evt,fsm,state)).process_event(evt);
- }
- };
- template <class Param1, class Param2, class Param3>
- struct Reprocess_ <Param1,Param2,Param3,void>
- : euml_action<Reprocess_<Param1, Param2, Param3, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(evt);
- (Param2()(evt,fsm,src,tgt)).process_event(evt);
- (Param3()(evt,fsm,src,tgt)).process_event(evt);
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(evt);
- (Param2()(evt,fsm,state)).process_event(evt);
- (Param3()(evt,fsm,state)).process_event(evt);
- }
- };
- struct reprocess_tag {};
- struct Reprocess_Helper: proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, boost::msm::sm_domain>
- {
- Reprocess_Helper(){}
- using proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_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 Reprocess_<Arg1,Arg2,Arg3,Arg4> type;
- };
- };
- Reprocess_Helper const reprocess_ = Reprocess_Helper();
- template <class ToProcessEvt,class Value,class Param1, class Param2, class Param3>
- struct Process2_ : euml_action<Process2_<ToProcessEvt,Value, Param1, Param2, Param3> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- (Param3()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
- (Param2()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
- (Param3()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
- }
- };
- template <class ToProcessEvt,class Value>
- struct Process2_ <ToProcessEvt,Value,void,void,void>
- : euml_action<Process2_<ToProcessEvt,Value, void, void, void > >
- {
- 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
- {
- fsm.process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- fsm.process_event(ToProcessEvt(Value()(evt,fsm,state)));
- }
- };
- template <class ToProcessEvt,class Value,class Param1>
- struct Process2_ <ToProcessEvt,Value,Param1,void,void>
- : euml_action<Process2_<ToProcessEvt,Value, Param1, void, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
- }
- };
- template <class ToProcessEvt,class Value,class Param1, class Param2>
- struct Process2_ <ToProcessEvt,Value,Param1,Param2,void>
- : euml_action<Process2_<ToProcessEvt,Value, Param1, Param2, void> >
- {
- 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
- {
- (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
- }
- template <class Event,class FSM,class STATE>
- void operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- (Param1()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
- (Param2()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
- }
- };
- struct process2_tag {};
- struct Process2_Helper : proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, boost::msm::sm_domain>
- {
- Process2_Helper(){}
- using proto::extends< proto::terminal<process2_tag>::type, Process2_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 Process2_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
- };
- };
- Process2_Helper const process2_ = Process2_Helper();
- template <class Flag,class Param1=void, class Enable=void >
- struct Get_Flag_ : euml_action<Get_Flag_<Flag,Param1,Enable> > {};
- template <class Flag,class Param1>
- struct Get_Flag_ <Flag,Param1
- , typename ::boost::enable_if<typename ::boost::is_same<Param1,void>::type >::type>
- : euml_action<Get_Flag_<Flag, Param1> >
- {
- 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&,FSM& fsm,SourceState& ,TargetState& )const
- {
- return fsm.template is_flag_active<Flag>();
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& ,FSM& fsm,STATE& )const
- {
- return fsm.template is_flag_active<Flag>();
- }
- };
- template <class Flag,class Param1>
- struct Get_Flag_ <Flag,Param1
- , typename ::boost::disable_if<
- typename ::boost::is_same<Param1,void>::type
- >::type>
- : euml_action<Get_Flag_<Flag, Param1> >
- {
- 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 (Param1()(evt,fsm,src,tgt)).template is_flag_active<Flag>();
- }
- template <class Event,class FSM,class STATE>
- bool operator()(Event const& evt,FSM& fsm,STATE& state)const
- {
- return (Param1()(evt,fsm,state)).template is_flag_active<Flag>();
- }
- };
- struct Get_Flag_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, Get_Flag_Helper, boost::msm::sm_domain>
- {
- Get_Flag_Helper(){}
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
- #ifdef BOOST_MSVC
- ,class Arg6
- #endif
- >
- struct In
- {
- typedef Get_Flag_<Arg1,Arg2> type;
- };
- };
- Get_Flag_Helper const is_flag_ = Get_Flag_Helper();
- // deferring an event
- struct DeferEvent_ : euml_action< DeferEvent_ >
- {
- typedef ::boost::mpl::set<action_tag> tag_type;
- // mark as deferring to avoid stack overflows in certain conditions
- typedef int deferring_action;
- template <class EVT,class FSM,class SourceState,class TargetState>
- void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& ) const
- {
- fsm.defer_event(evt);
- }
- };
- struct Defer_Helper : proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, boost::msm::sm_domain>
- {
- Defer_Helper(){}
- using proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_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 DeferEvent_ type;
- };
- };
- Defer_Helper const defer_ = Defer_Helper();
- struct explicit_tag {};
- struct Explicit_Helper : proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, boost::msm::sm_domain>
- {
- Explicit_Helper(){}
- using proto::extends< proto::terminal<explicit_tag>::type, Explicit_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 typename Arg1::template direct<Arg2> type;
- };
- };
- Explicit_Helper const explicit_ = Explicit_Helper();
- struct entry_pt_tag {};
- struct Entry_Pt_Helper : proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, boost::msm::sm_domain>
- {
- Entry_Pt_Helper(){}
- using proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_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 typename Arg1::template entry_pt<Arg2> type;
- };
- };
- Entry_Pt_Helper const entry_pt_ = Entry_Pt_Helper();
- struct exit_pt_tag {};
- struct Exit_Pt_Helper : proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, boost::msm::sm_domain>
- {
- Exit_Pt_Helper(){}
- using proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_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 typename Arg1::template exit_pt<Arg2> type;
- };
- };
- Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
- #ifdef BOOST_MSVC
- #define BOOST_MSM_EUML_FUNCTION(functor,function,function_name,result_trans,result_state) \
- template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
- class Param5=void,class Param6=void,class Enable=void > \
- struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6,Enable> > {}; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::enable_if<typename ::boost::is_same<Param1,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename transition_action_result<EVT,FSM,SourceState,TargetState>::type \
- operator()(EVT const& , FSM& ,SourceState& ,TargetState& )const { \
- return function ();} \
- template <class Event,class FSM,class STATE> \
- typename state_action_result<Event,FSM,STATE>::type \
- operator()(Event const& ,FSM& ,STATE& )const { \
- return function ();} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param1,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param2,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param5,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param6,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::is_same<Param6,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt),Param6()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state),Param5()(evt,fsm,state),Param6()(evt,fsm,state));} }; \
- struct function_name ## tag{}; \
- struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5,class Arg6> \
- struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> type;}; }; \
- functor ## Helper const function_name = functor ## Helper ();
- #define BOOST_MSM_EUML_METHOD(functor,function,function_name,result_trans,result_state) \
- template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
- class Param5=void,class Param6=void,class Enable=void > \
- struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6,Enable> > {}; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::enable_if<typename ::boost::is_same<Param2,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function();} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function();} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param5,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param6,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
- struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
- typename ::boost::disable_if<typename ::boost::is_same<Param6,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt),Param6()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state),Param5()(evt,fsm,state),Param6()(evt,fsm,state));} }; \
- struct function_name ## tag{}; \
- struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5,class Arg6> \
- struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> type;}; }; \
- functor ## Helper const function_name = functor ## Helper ();
- #else
- #define BOOST_MSM_EUML_FUNCTION(functor,function,function_name,result_trans,result_state) \
- template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
- class Param5=void,class Enable=void > \
- struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Enable> > {}; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param1,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param2,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::is_same<Param5,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
- struct function_name ## tag{}; \
- struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5> \
- struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5> type;}; }; \
- functor ## Helper const function_name = functor ## Helper ();
- #define BOOST_MSM_EUML_METHOD(functor,function,function_name,result_trans,result_state) \
- template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
- class Param5=void,class Enable=void > \
- struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Enable> > {}; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::enable_if<typename ::boost::is_same<Param2,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function();} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function();} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::mpl::or_< \
- typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
- typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state));} }; \
- template <class Param1, class Param2, class Param3, class Param4, class Param5> \
- struct functor<Param1,Param2,Param3,Param4,Param5, \
- typename ::boost::disable_if<typename ::boost::is_same<Param5,void>::type>::type> \
- : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
- template <class Event,class FSM,class STATE > struct state_action_result { \
- typedef result_state type;} ; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- struct transition_action_result { typedef result_trans type;}; \
- typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
- template <class EVT,class FSM,class SourceState,class TargetState> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::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 (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
- ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
- template <class Event,class FSM,class STATE> \
- typename ::boost::enable_if<typename ::boost::mpl::has_key< \
- typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
- typename state_action_result<Event,FSM,STATE>::type >::type \
- operator()(Event const& evt,FSM& fsm,STATE& state )const { \
- return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
- ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
- struct function_name ## tag{}; \
- struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
- functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
- template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5> \
- struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5> type;}; }; \
- functor ## Helper const function_name = functor ## Helper ();
- #endif
- #define RESULT_TYPE2_PARAM1 typename get_result_type2<Param1,Event,FSM,STATE>::type
- #define RESULT_TYPE_PARAM1 typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type
- #define RESULT_TYPE2_PARAM2 typename get_result_type2<Param2,Event,FSM,STATE>::type
- #define RESULT_TYPE_PARAM2 typename get_result_type<Param2,EVT,FSM,SourceState,TargetState>::type
- #define RESULT_TYPE2_PARAM3 typename get_result_type2<Param3,Event,FSM,STATE>::type
- #define RESULT_TYPE_PARAM3 typename get_result_type<Param3,EVT,FSM,SourceState,TargetState>::type
- #define RESULT_TYPE2_PARAM4 typename get_result_type2<Param4,Event,FSM,STATE>::type
- #define RESULT_TYPE_PARAM4 typename get_result_type<Param4,EVT,FSM,SourceState,TargetState>::type
- #define RESULT_TYPE2_PARAM5 typename get_result_type2<Param5,Event,FSM,STATE>::type
- #define RESULT_TYPE_PARAM5 typename get_result_type<Param5,EVT,FSM,SourceState,TargetState>::type
- #define RESULT_TYPE2_PARAM6 typename get_result_type2<Param6,Event,FSM,STATE>::type
- #define RESULT_TYPE_PARAM6 typename get_result_type<Param6,EVT,FSM,SourceState,TargetState>::type
- #define RESULT_TYPE2_DIFF_TYPE_ITER_TRAITS_PARAM1 typename std::iterator_traits<typename get_result_type2<Param1,Event,FSM,STATE>::type>::difference_type
- #define RESULT_TYPE_DIFF_TYPE_ITER_TRAITS_PARAM1 typename std::iterator_traits<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::difference_type
- #define RESULT_TYPE2_REMOVE_REF_PARAM1 typename ::boost::remove_reference<typename get_result_type2<Param1,Event,FSM,STATE>::type>::type
- #define RESULT_TYPE_REMOVE_REF_PARAM1 typename ::boost::remove_reference<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::type
- #define RESULT_TYPE2_PAIR_REMOVE_REF_PARAM1 std::pair<RESULT_TYPE2_REMOVE_REF_PARAM1,RESULT_TYPE2_REMOVE_REF_PARAM1>
- #define RESULT_TYPE_PAIR_REMOVE_REF_PARAM1 std::pair<RESULT_TYPE_REMOVE_REF_PARAM1,RESULT_TYPE_REMOVE_REF_PARAM1>
- #define RESULT_TYPE2_GET_REF_REMOVE_REF_PARAM1 typename get_reference<typename ::boost::remove_reference<typename get_result_type2<Param1,Event,FSM,STATE>::type>::type>::type
- #define RESULT_TYPE_GET_REF_REMOVE_REF_PARAM1 typename get_reference<typename ::boost::remove_reference<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::type>::type
- #define RESULT_TYPE2_GET_ITERATOR_REMOVE_REF_PARAM1 typename get_iterator<typename ::boost::remove_reference<typename get_result_type2<Param1,Event,FSM,STATE>::type>::type>::type
- #define RESULT_TYPE_GET_ITERATOR_REMOVE_REF_PARAM1 typename get_iterator<typename ::boost::remove_reference<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::type>::type
- #define RESULT_TYPE2_GET_REV_ITERATOR_REMOVE_REF_PARAM1 typename get_reverse_iterator<typename ::boost::remove_reference<typename get_result_type2<Param1,Event,FSM,STATE>::type>::type>::type
- #define RESULT_TYPE_GET_REV_ITERATOR_REMOVE_REF_PARAM1 typename get_reverse_iterator<typename ::boost::remove_reference<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::type>::type
- #define RESULT_TYPE2_GET_SIZE_TYPE_REMOVE_REF_PARAM1 typename get_size_type<typename ::boost::remove_reference<typename get_result_type2<Param1,Event,FSM,STATE>::type>::type>::type
- #define RESULT_TYPE_GET_SIZE_TYPE_REMOVE_REF_PARAM1 typename get_size_type<typename ::boost::remove_reference<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::type>::type
- #define BOOST_MSM_EUML_ACTION(instance_name) \
- struct instance_name ## _impl; \
- struct instance_name ## _helper : boost::msm::front::euml::euml_action<instance_name ## _impl> \
- { \
- instance_name ## _helper(){} \
- typedef instance_name ## _impl action_name; \
- }; \
- static instance_name ## _helper instance_name; \
- struct instance_name ## _impl : instance_name ## _helper
- #define BOOST_MSM_EUML_DECLARE_ACTION(instance_name) \
- struct instance_name ; \
- struct instance_name ## _helper : boost::msm::front::euml::euml_action<instance_name > \
- { \
- instance_name ## _helper(){} \
- typedef instance_name action_name; \
- }; \
- struct instance_name : instance_name ## _helper
- #define BOOST_MSM_EUML_EVENT(instance_name) \
- struct instance_name ## _helper : boost::msm::front::euml::euml_event<instance_name ## _helper>{ \
- instance_name ## _helper(){} \
- instance_name ## _helper const& operator()() const {return *this;} }; \
- static instance_name ## _helper instance_name;
- // an event matching any event
- struct kleene_ : boost::msm::front::euml::euml_event<kleene_>, public boost::any
- {
- kleene_() : boost::any(){}
- template<typename ValueType>
- kleene_(const ValueType & v) : boost::any(v){}
- };
- static kleene_ kleene;
- #define BOOST_MSM_EUML_DECLARE_EVENT(instance_name) \
- struct instance_name : boost::msm::front::euml::euml_event<instance_name >{ \
- instance_name(){} \
- instance_name const& operator()() const {return *this;} };
- #define MSM_EUML_CONCAT(param1,param2) param1
- #define MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1(z, n, unused) ARG ## n arg ## n
- #define MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE2(z, n, unused) arg ## n
- #define MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP_ENTRY(z, n, unused) \
- typename boost::fusion::result_of::first< \
- typename ::boost::remove_reference< \
- typename boost::fusion::result_of::at_c<T, BOOST_PP_CAT( , n)>::type>::type>::type \
- #define MSM_EUML_EVENT_HELPER_GET_ATTRIBUTE(z, n, unused) \
- get_attribute( \
- typename boost::fusion::result_of::first< \
- typename ::boost::remove_reference< \
- typename boost::fusion::result_of::at_c<T, n>::type>::type>::type())=arg ## n;
- #define MSM_EUML_EVENT_HELPER_CONSTRUCTORS(z, n, mytuple) \
- template <BOOST_PP_ENUM_PARAMS(n, class ARG)> \
- BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, mytuple) , _helper)(BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1, ~ )): \
- BOOST_PP_TUPLE_ELEM(2, 1, mytuple)(){ \
- init(BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE2, ~ ),attribute_vec());}
- #define MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP(z, n, unused) \
- template <BOOST_PP_ENUM_PARAMS(n, class ARG),class T> \
- void init(BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1, ~ ), \
- T,typename ::boost::enable_if< typename boost::mpl::eval_if< typename ::boost::fusion::traits::is_sequence<T>::type,size_helper<T,n>,::boost::mpl::false_>::type,void >::type* =0) \
- { \
- BOOST_PP_REPEAT_FROM_TO(0,n , \
- MSM_EUML_EVENT_HELPER_GET_ATTRIBUTE, ~) \
- }
- #define MSM_EUML_EVENT_INSTANCE_HELPER_OPERATOR_IMPL(z, n, instance) \
- template <BOOST_PP_ENUM_PARAMS(n, class ARG)> \
- BOOST_PP_CAT(instance,_helper) operator() \
- (BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1, ~ ))const{ \
- return BOOST_PP_CAT(instance,_helper) (BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE2, ~ ));}
-
- #if defined(FUSION_MAX_MAP_SIZE)
- #define BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(instance_name, attributes_name) \
- struct instance_name ## _helper : \
- boost::msm::front::euml::euml_event<instance_name ## _helper> , public attributes_name \
- { \
- template <class T,int checked_size> struct size_helper \
- { \
- typedef typename ::boost::mpl::less_equal< \
- typename ::boost::fusion::result_of::size<T>::type, \
- ::boost::mpl::int_<checked_size> >::type type; \
- }; \
- BOOST_PP_CAT(instance_name,_helper()) : attributes_name(){} \
- typedef attributes_name::attributes_type attribute_map; \
- typedef ::boost::fusion::result_of::as_vector<attribute_map>::type attribute_vec; \
- BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(FUSION_MAX_MAP_SIZE ,1), \
- MSM_EUML_EVENT_HELPER_CONSTRUCTORS, (instance_name,attributes_name)) \
- BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(FUSION_MAX_MAP_SIZE ,1), \
- MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP, ~) \
- BOOST_PP_CAT(instance_name,_helper) operator()(){ \
- return BOOST_PP_CAT(instance_name,_helper)();} \
- BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(FUSION_MAX_MAP_SIZE ,1), \
- MSM_EUML_EVENT_INSTANCE_HELPER_OPERATOR_IMPL, instance_name) \
- }; \
- static instance_name ## _helper instance_name;
- #else
- #define BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(instance_name, attributes_name) \
- struct instance_name ## _helper : \
- boost::msm::front::euml::euml_event<instance_name ## _helper> , public attributes_name \
- { \
- template <class T,int checked_size> struct size_helper \
- { \
- typedef typename ::boost::mpl::less_equal< \
- typename ::boost::fusion::result_of::size<T>::type, \
- ::boost::mpl::int_<checked_size> >::type type; \
- }; \
- BOOST_PP_CAT(instance_name,_helper()) : attributes_name(){} \
- typedef attributes_name::attributes_type attribute_map; \
- typedef ::boost::fusion::result_of::as_vector<attribute_map>::type attribute_vec; \
- BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(10 ,1), \
- MSM_EUML_EVENT_HELPER_CONSTRUCTORS, (instance_name,attributes_name)) \
- BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(10 ,1), \
- MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP, ~) \
- BOOST_PP_CAT(instance_name,_helper) operator()(){ \
- return BOOST_PP_CAT(instance_name,_helper)();} \
- BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(10 ,1), \
- MSM_EUML_EVENT_INSTANCE_HELPER_OPERATOR_IMPL, instance_name) \
- }; \
- static instance_name ## _helper instance_name;
- #endif
- #define BOOST_MSM_EUML_EVENT_NAME(instance_name) instance_name ## _helper
- #define BOOST_MSM_EUML_FLAG_NAME(instance_name) instance_name ## _helper
- #define BOOST_MSM_EUML_FLAG(instance_name) \
- struct instance_name ## _helper : boost::msm::front::euml::euml_flag<instance_name ## _helper>{}; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_DECLARE_FLAG(instance_name) \
- struct instance_name : boost::msm::front::euml::euml_flag<instance_name >{};
- #define BOOST_MSM_EUML_STATE_NAME(instance_name) instance_name ## _helper
- #define BOOST_MSM_EUML_BUILD_STT_HELPER build_stt(
- #define BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER build_internal_stt(
- #define BOOST_MSM_EUML_BUILD_STT_HELPER2(expr) expr)
- #define BOOST_MSM_EUML_ENTRY_STATE_HELPER(expr) ,expr
- #define BOOST_MSM_EUML_ATTRIBUTES(expr,instance_name) \
- typedef BOOST_TYPEOF(build_attributes expr) instance_name;
- // following macros declare a state type but do not create an instance
- #define BOOST_MSM_EUML_DECLARE_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_state<instance_name ## tag> expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_INTERRUPT_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_interrupt_state<instance_name ## tag> expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_TERMINATE_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_terminate_state<instance_name ## tag> expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_EXPLICIT_ENTRY_STATE(region,expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_explicit_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_ENTRY_STATE(region,expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_EXIT_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_exit_state<instance_name ## tag> expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_STATE_MACHINE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_sm<instance_name ## tag> expr) instance_name;
- #define BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE(expr,instance_name) \
- typedef int using_declared_table; \
- typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name;
- #define BOOST_MSM_EUML_DECLARE_INTERNAL_TRANSITION_TABLE(expr) \
- typedef BOOST_TYPEOF( \
- BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) internal_transition_table;
- // following macros declare a state type and create an instance
- #define BOOST_MSM_EUML_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_state<instance_name ## tag> expr) instance_name ## _helper; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_INTERRUPT_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_interrupt_state<instance_name ## tag> expr) instance_name ## _helper; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_TERMINATE_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_terminate_state<instance_name ## tag> expr) instance_name ## _helper; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE(region,expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_explicit_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name ## _helper; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_ENTRY_STATE(region,expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name ## _helper; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_EXIT_STATE(expr,instance_name) \
- struct instance_name ## tag{}; \
- typedef BOOST_TYPEOF(build_exit_state<instance_name ## tag> expr) instance_name ## _helper; \
- static instance_name ## _helper instance_name;
- #ifndef BOOST_MSVC
- #define BOOST_MSM_EUML_TRANSITION_TABLE(expr,instance_name) \
- typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name ## _def; \
- struct instance_name ## _helper : public instance_name ## _def{instance_name ## _helper(){}}; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_INTERNAL_TRANSITION_TABLE(expr,instance_name) \
- typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name ## _def; \
- struct instance_name ## _helper : public instance_name ## _def{instance_name ## _helper(){}}; \
- static instance_name ## _helper instance_name;
- #else
- #define BOOST_MSM_EUML_TRANSITION_TABLE(expr,instance_name) \
- struct instance_name ## _helper : \
- public BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) \
- {instance_name ## _helper(){}} ; \
- static instance_name ## _helper instance_name;
- #define BOOST_MSM_EUML_INTERNAL_TRANSITION_TABLE(expr,instance_name) \
- struct instance_name ## _helper : \
- public BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) \
- {instance_name ## _helper(){}} ; \
- static instance_name ## _helper instance_name;
- #endif
- }}}} // boost::msm::front::euml
- namespace boost { namespace msm{
- template<>
- struct is_kleene_event< boost::msm::front::euml::kleene_ >
- {
- typedef ::boost::mpl::true_ type;
- };
- }}
- #endif // BOOST_MSM_FRONT_EUML_COMMON_H
|