common.hpp 138 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715
  1. // Copyright 2008 Christophe Henry
  2. // henry UNDERSCORE christophe AT hotmail DOT com
  3. // This is an extended version of the state machine available in the boost::mpl library
  4. // Distributed under the same license as the original.
  5. // Copyright for the original version:
  6. // Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
  7. // under the Boost Software License, Version 1.0. (See accompanying
  8. // file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_MSM_FRONT_EUML_COMMON_H
  11. #define BOOST_MSM_FRONT_EUML_COMMON_H
  12. #include <boost/config.hpp>
  13. #include <boost/msm/proto_config.hpp>
  14. #include <iterator>
  15. #include <utility>
  16. #include <boost/proto/core.hpp>
  17. #include <boost/proto/transform.hpp>
  18. #include <boost/utility/enable_if.hpp>
  19. #include <boost/type_traits/is_same.hpp>
  20. #include <boost/type_traits/remove_reference.hpp>
  21. #include <boost/type_traits/add_const.hpp>
  22. #include <boost/mpl/vector.hpp>
  23. #include <boost/mpl/set.hpp>
  24. #include <boost/mpl/has_key.hpp>
  25. #include <boost/mpl/int.hpp>
  26. #include <boost/mpl/less_equal.hpp>
  27. #if BOOST_VERSION >= 104000
  28. #include <boost/mpl/string.hpp>
  29. #endif
  30. #include <boost/fusion/container/vector.hpp>
  31. #include <boost/fusion/include/at_c.hpp>
  32. #include <boost/fusion/include/make_map.hpp>
  33. #include <boost/fusion/include/pair.hpp>
  34. #include <boost/fusion/include/as_vector.hpp>
  35. #include <boost/fusion/include/pair.hpp>
  36. #include <boost/fusion/include/is_sequence.hpp>
  37. #include <boost/type_traits/remove_reference.hpp>
  38. #include <boost/preprocessor/repetition/enum_params.hpp>
  39. #include <boost/preprocessor/arithmetic/sub.hpp>
  40. #include <boost/preprocessor/punctuation/comma_if.hpp>
  41. #include <boost/preprocessor/control/expr_if.hpp>
  42. #include <boost/preprocessor/punctuation/comma.hpp>
  43. #include <boost/preprocessor/arithmetic/add.hpp>
  44. #include <boost/preprocessor/cat.hpp>
  45. #include <boost/preprocessor/comparison/less.hpp>
  46. #include <boost/preprocessor/arithmetic/dec.hpp>
  47. #include <boost/preprocessor/repetition/repeat_from_to.hpp>
  48. #include <boost/preprocessor/cat.hpp>
  49. #include <boost/msm/msm_grammar.hpp>
  50. #include <boost/msm/active_state_switching_policies.hpp>
  51. #include <boost/msm/event_traits.hpp>
  52. #include <boost/msm/front/functor_row.hpp>
  53. namespace proto = boost::proto;
  54. BOOST_MPL_HAS_XXX_TRAIT_DEF(tag_type)
  55. BOOST_MPL_HAS_XXX_TRAIT_DEF(action_name)
  56. BOOST_MPL_HAS_XXX_TRAIT_DEF(not_intern_euml_state)
  57. namespace boost { namespace msm { namespace front { namespace euml
  58. {
  59. template <class T>
  60. struct get_iterator
  61. {
  62. typedef typename T::iterator type;
  63. };
  64. template <class T>
  65. struct get_reverse_iterator
  66. {
  67. typedef typename T::reverse_iterator type;
  68. };
  69. template <class T>
  70. struct get_reference
  71. {
  72. typedef typename T::reference type;
  73. };
  74. template <class T>
  75. struct get_size_type
  76. {
  77. typedef typename T::size_type type;
  78. };
  79. template <class T>
  80. struct get_value_type
  81. {
  82. typedef typename T::value_type type;
  83. };
  84. template <class T>
  85. struct get_first_type
  86. {
  87. typedef typename T::first_type type;
  88. };
  89. template <class T>
  90. struct get_second_type
  91. {
  92. typedef typename T::second_type type;
  93. };
  94. template <class T>
  95. struct get_action_tag_type
  96. {
  97. typedef typename ::boost::mpl::has_key<
  98. typename T::tag_type,action_tag>::type type;
  99. };
  100. template <class T>
  101. struct get_state_action_tag_type
  102. {
  103. typedef typename ::boost::mpl::has_key<
  104. typename T::tag_type,state_action_tag>::type type;
  105. };
  106. template <class T,class EVT,class FSM,class SourceState,class TargetState>
  107. struct get_result_type
  108. {
  109. typedef typename T::template transition_action_result<EVT,FSM,SourceState,TargetState>::type type;
  110. };
  111. template <class T,class Event,class FSM,class STATE>
  112. struct get_result_type2
  113. {
  114. typedef typename T::template state_action_result<Event,FSM,STATE>::type type;
  115. };
  116. template<class SEQ>
  117. struct get_sequence
  118. {
  119. typedef typename SEQ::sequence type;
  120. };
  121. template <class T>
  122. struct get_attributes_type
  123. {
  124. typedef typename T::attributes_type type;
  125. };
  126. template <class T>
  127. struct get_euml_tag_type
  128. {
  129. typedef typename T::euml_tag_type type;
  130. };
  131. template <class T,class Arg1=void,class Arg2=void,class Arg3=void,class Arg4=void,class Arg5=void
  132. #ifdef BOOST_MSVC
  133. ,class Arg6=void
  134. #endif
  135. >
  136. struct get_fct
  137. {
  138. typedef typename T::template In<Arg1,Arg2,Arg3,Arg4,Arg5
  139. #ifdef BOOST_MSVC
  140. ,Arg6
  141. #endif
  142. >::type type;
  143. };
  144. // used to differentiate between different types of euml_state's
  145. template <class T,class Enable=void>
  146. struct get_state_name
  147. {
  148. typedef T type;
  149. };
  150. template <class T>
  151. struct get_state_name<T,typename ::boost::enable_if<has_not_intern_euml_state<T> >::type>
  152. {
  153. typedef typename T::In::type type;
  154. };
  155. template <class T>
  156. struct get_action_name
  157. {
  158. typedef typename T::action_name type;
  159. };
  160. template <class T>
  161. struct get_event_name
  162. {
  163. typedef typename T::event_name type;
  164. };
  165. template <class EVT>
  166. struct euml_event: proto::extends<typename proto::terminal<event_tag>::type, EVT, boost::msm::sm_domain>
  167. {
  168. typedef event_tag euml_tag_type;
  169. typedef EVT event_name;
  170. using proto::extends<typename proto::terminal<event_tag>::type, EVT, boost::msm::sm_domain>::operator=;
  171. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  172. #ifdef BOOST_MSVC
  173. ,class Arg6
  174. #endif
  175. >
  176. struct In
  177. {
  178. typedef EVT type;
  179. };
  180. };
  181. template <class STATE>
  182. struct euml_state_intern: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, boost::msm::state_domain>
  183. {
  184. typedef state_tag euml_tag_type;
  185. using proto::extends<typename proto::terminal<state_tag>::type, STATE, boost::msm::state_domain>::operator=;
  186. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  187. #ifdef BOOST_MSVC
  188. ,class Arg6
  189. #endif
  190. >
  191. struct In
  192. {
  193. typedef STATE type;
  194. };
  195. };
  196. template <class STATE>
  197. struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, boost::msm::state_domain>
  198. {
  199. typedef state_tag euml_tag_type;
  200. typedef int not_intern_euml_state;
  201. using proto::extends<typename proto::terminal<state_tag>::type, STATE, boost::msm::state_domain>::operator=;
  202. struct In
  203. {
  204. typedef STATE type;
  205. };
  206. };
  207. template <class ACTION>
  208. struct euml_action: proto::extends<typename proto::terminal<action_tag>::type, ACTION, boost::msm::sm_domain>
  209. {
  210. typedef action_tag euml_tag_type;
  211. typedef ACTION action_name;
  212. using proto::extends<typename proto::terminal<action_tag>::type, ACTION, boost::msm::sm_domain>::operator=;
  213. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  214. #ifdef BOOST_MSVC
  215. ,class Arg6
  216. #endif
  217. >
  218. struct In
  219. {
  220. typedef ACTION type;
  221. };
  222. };
  223. template <class FLAG>
  224. struct euml_flag: proto::extends<typename proto::terminal<flag_tag>::type, FLAG, boost::msm::sm_domain>
  225. {
  226. typedef flag_tag euml_tag_type;
  227. using proto::extends<typename proto::terminal<flag_tag>::type, FLAG, boost::msm::sm_domain>::operator=;
  228. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  229. #ifdef BOOST_MSVC
  230. ,class Arg6
  231. #endif
  232. >
  233. struct In
  234. {
  235. typedef FLAG type;
  236. };
  237. };
  238. template <class CONFIG>
  239. struct euml_config: proto::extends<typename proto::terminal<config_tag>::type, CONFIG, boost::msm::sm_domain>
  240. {
  241. typedef config_tag euml_tag_type;
  242. using proto::extends<typename proto::terminal<config_tag>::type, CONFIG, boost::msm::sm_domain>::operator=;
  243. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  244. #ifdef BOOST_MSVC
  245. ,class Arg6
  246. #endif
  247. >
  248. struct In
  249. {
  250. typedef CONFIG type;
  251. };
  252. };
  253. struct No_Exception : euml_config<No_Exception>
  254. {
  255. typedef int no_exception_thrown;
  256. No_Exception(){}
  257. };
  258. struct No_Msg_Queue : euml_config<No_Msg_Queue>
  259. {
  260. typedef int no_message_queue;
  261. No_Msg_Queue(){}
  262. };
  263. struct Deferred_Events : euml_config<Deferred_Events>
  264. {
  265. typedef int activate_deferred_events;
  266. Deferred_Events(){}
  267. };
  268. No_Exception const no_exception=No_Exception();
  269. No_Msg_Queue const no_msg_queue=No_Msg_Queue();
  270. Deferred_Events const deferred_events=Deferred_Events();
  271. struct ActiveStateSwitchBeforeTransition : euml_config<ActiveStateSwitchBeforeTransition>
  272. {
  273. typedef boost::msm::active_state_switch_before_transition active_state_switch_policy;
  274. ActiveStateSwitchBeforeTransition(){}
  275. };
  276. ActiveStateSwitchBeforeTransition const switch_active_before_transition = ActiveStateSwitchBeforeTransition();
  277. struct ActiveStateSwitchAfterExit : euml_config<ActiveStateSwitchAfterExit>
  278. {
  279. typedef boost::msm::active_state_switch_after_exit active_state_switch_policy;
  280. ActiveStateSwitchAfterExit(){}
  281. };
  282. ActiveStateSwitchAfterExit const switch_active_after_exit = ActiveStateSwitchAfterExit();
  283. struct ActiveStateSwitchAfterAction : euml_config<ActiveStateSwitchAfterAction>
  284. {
  285. typedef boost::msm::active_state_switch_after_transition_action active_state_switch_policy;
  286. ActiveStateSwitchAfterAction(){}
  287. };
  288. ActiveStateSwitchAfterAction const switch_active_after_action = ActiveStateSwitchAfterAction();
  289. struct invalid_type{};
  290. struct make_invalid_type
  291. {
  292. typedef invalid_type type;
  293. };
  294. template <class ROW>
  295. struct make_vector_one_row
  296. {
  297. typedef boost::mpl::vector<ROW> type;
  298. };
  299. template <class T>
  300. T make_T(T t) {return t;}
  301. struct make_vector_no_row
  302. {
  303. typedef boost::mpl::vector0<> type;
  304. };
  305. struct NoAction : euml_action<NoAction>
  306. {
  307. NoAction(){}
  308. // return value if used inside a state action (entry/exit)
  309. template <class Event,class FSM,class STATE >
  310. struct state_action_result
  311. {
  312. typedef bool type;
  313. };
  314. // return value if used inside a transition (action/guard)
  315. template <class EVT,class FSM,class SourceState,class TargetState>
  316. struct transition_action_result
  317. {
  318. typedef bool type;
  319. };
  320. // this functor can be used in both modes, state action and transition action
  321. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  322. template <class Event,class FSM,class STATE>
  323. bool operator()(Event const&,FSM&,STATE& )
  324. {
  325. // does nothing
  326. return true;
  327. }
  328. template <class EVT,class FSM,class SourceState,class TargetState>
  329. bool operator()(EVT const& ,FSM& ,SourceState& ,TargetState&)const
  330. {
  331. // does nothing
  332. return true;
  333. }
  334. };
  335. NoAction const no_action = NoAction();
  336. struct fsm_artefact_tag {};
  337. template <class Index=void>
  338. struct GetSource_ : euml_action<GetSource_<Index> >
  339. {
  340. template <class EVT,class FSM,class SourceState,class TargetState>
  341. struct transition_action_result
  342. {
  343. typedef typename ::boost::fusion::result_of::at_key<typename SourceState::attributes_type,
  344. Index >::type type;
  345. };
  346. typedef ::boost::mpl::set<action_tag> tag_type;
  347. template <class EVT,class FSM,class SourceState,class TargetState>
  348. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  349. operator()(EVT const& ,FSM& ,SourceState& src,TargetState&)const
  350. {
  351. return src.get_attribute(Index());
  352. }
  353. };
  354. template<>
  355. struct GetSource_<void> : euml_action<GetSource_<void> >
  356. {
  357. template <class EVT,class FSM,class SourceState,class TargetState>
  358. struct transition_action_result
  359. {
  360. typedef SourceState& type;
  361. };
  362. typedef ::boost::mpl::set<action_tag> tag_type;
  363. template <class EVT,class FSM,class SourceState,class TargetState>
  364. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  365. operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
  366. {
  367. return src;
  368. }
  369. };
  370. struct GetSource_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetSource_Helper, boost::msm::sm_domain>
  371. {
  372. GetSource_Helper(){}
  373. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  374. #ifdef BOOST_MSVC
  375. ,class Arg6
  376. #endif
  377. >
  378. struct In
  379. {
  380. typedef GetSource_<Arg1> type;
  381. };
  382. };
  383. GetSource_Helper const source_ = GetSource_Helper();
  384. template <class Index=void>
  385. struct GetTarget_ : euml_action<GetTarget_<Index> >
  386. {
  387. template <class EVT,class FSM,class SourceState,class TargetState>
  388. struct transition_action_result
  389. {
  390. typedef typename ::boost::fusion::result_of::at_key<typename TargetState::attributes_type,
  391. Index >::type type;
  392. };
  393. typedef ::boost::mpl::set<action_tag> tag_type;
  394. template <class EVT,class FSM,class SourceState,class TargetState>
  395. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  396. operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
  397. {
  398. return tgt.get_attribute(Index());
  399. }
  400. };
  401. template<>
  402. struct GetTarget_<void> : euml_action<GetTarget_<void> >
  403. {
  404. template <class EVT,class FSM,class SourceState,class TargetState>
  405. struct transition_action_result
  406. {
  407. typedef TargetState& type;
  408. };
  409. typedef ::boost::mpl::set<action_tag> tag_type;
  410. template <class EVT,class FSM,class SourceState,class TargetState>
  411. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  412. operator()(EVT const& , FSM&,SourceState& ,TargetState& tgt)const
  413. {
  414. return tgt;
  415. }
  416. };
  417. struct GetTarget_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetTarget_Helper, boost::msm::sm_domain>
  418. {
  419. GetTarget_Helper(){}
  420. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  421. #ifdef BOOST_MSVC
  422. ,class Arg6
  423. #endif
  424. >
  425. struct In
  426. {
  427. typedef GetTarget_<Arg1> type;
  428. };
  429. };
  430. GetTarget_Helper const target_ = GetTarget_Helper();
  431. template <class Index=void>
  432. struct GetState_ : euml_action<GetState_<Index> >
  433. {
  434. template <class Event,class FSM,class STATE >
  435. struct state_action_result
  436. {
  437. typedef typename ::boost::fusion::result_of::at_key<typename STATE::attributes_type,
  438. Index >::type type;
  439. };
  440. typedef ::boost::mpl::set<state_action_tag> tag_type;
  441. template <class Event,class FSM,class STATE>
  442. typename state_action_result<Event,FSM,STATE>::type
  443. operator()(Event const&,FSM& ,STATE& state )
  444. {
  445. return state.get_attribute(Index());
  446. }
  447. };
  448. template<>
  449. struct GetState_<void> : euml_action<GetState_<void> >
  450. {
  451. using euml_action<GetState_ >::operator=;
  452. template <class Event,class FSM,class STATE >
  453. struct state_action_result
  454. {
  455. typedef STATE& type;
  456. };
  457. typedef ::boost::mpl::set<state_action_tag> tag_type;
  458. template <class Event,class FSM,class STATE>
  459. typename state_action_result<Event,FSM,STATE>::type
  460. operator()(Event const&,FSM& ,STATE& state )
  461. {
  462. return state;
  463. }
  464. };
  465. struct GetState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetState_Helper, boost::msm::sm_domain>
  466. {
  467. GetState_Helper(){}
  468. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  469. #ifdef BOOST_MSVC
  470. ,class Arg6
  471. #endif
  472. >
  473. struct In
  474. {
  475. typedef GetState_<Arg1> type;
  476. };
  477. };
  478. GetState_Helper const state_ = GetState_Helper();
  479. template <class Index=void>
  480. struct GetEvent_ : euml_action<GetEvent_<Index> >
  481. {
  482. template <class Event,class FSM,class STATE >
  483. struct state_action_result
  484. {
  485. typedef typename ::boost::add_const<
  486. typename ::boost::fusion::result_of::at_key<typename Event::attributes_type,
  487. Index >::type>::type type;
  488. };
  489. template <class EVT,class FSM,class SourceState,class TargetState>
  490. struct transition_action_result
  491. {
  492. typedef typename ::boost::add_const<
  493. typename ::boost::fusion::result_of::at_key<typename EVT::attributes_type,
  494. Index >::type>::type type;
  495. };
  496. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  497. template <class Event,class FSM,class STATE>
  498. typename state_action_result<Event,FSM,STATE>::type
  499. operator()(Event const& evt,FSM& ,STATE& )
  500. {
  501. return evt.get_attribute(Index());
  502. }
  503. template <class EVT,class FSM,class SourceState,class TargetState>
  504. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  505. operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
  506. {
  507. return evt.get_attribute(Index());
  508. }
  509. };
  510. template <>
  511. struct GetEvent_<void> : euml_action<GetEvent_<void> >
  512. {
  513. template <class Event,class FSM,class STATE >
  514. struct state_action_result
  515. {
  516. typedef Event const& type;
  517. };
  518. template <class EVT,class FSM,class SourceState,class TargetState>
  519. struct transition_action_result
  520. {
  521. typedef EVT const& type;
  522. };
  523. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  524. template <class Event,class FSM,class STATE>
  525. typename state_action_result<Event,FSM,STATE>::type
  526. operator()(Event const& evt,FSM& ,STATE& )
  527. {
  528. return evt;
  529. }
  530. template <class EVT,class FSM,class SourceState,class TargetState>
  531. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  532. operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
  533. {
  534. return evt;
  535. }
  536. };
  537. struct GetEvent_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetEvent_Helper, boost::msm::sm_domain>
  538. {
  539. GetEvent_Helper(){}
  540. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  541. #ifdef BOOST_MSVC
  542. ,class Arg6
  543. #endif
  544. >
  545. struct In
  546. {
  547. typedef GetEvent_<Arg1> type;
  548. };
  549. };
  550. GetEvent_Helper const event_ = GetEvent_Helper();
  551. template <class Index=void>
  552. struct GetFsm_ : euml_action<GetFsm_<Index> >
  553. {
  554. template <class Event,class FSM,class STATE >
  555. struct state_action_result
  556. {
  557. typedef typename ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
  558. Index >::type type;
  559. };
  560. template <class EVT,class FSM,class SourceState,class TargetState>
  561. struct transition_action_result
  562. {
  563. typedef typename ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
  564. Index >::type type;
  565. };
  566. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  567. template <class Event,class FSM,class STATE>
  568. typename state_action_result<Event,FSM,STATE>::type
  569. operator()(Event const&,FSM& fsm,STATE& )
  570. {
  571. return fsm.get_attribute(Index());
  572. }
  573. template <class EVT,class FSM,class SourceState,class TargetState>
  574. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  575. operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
  576. {
  577. return fsm.get_attribute(Index());
  578. }
  579. };
  580. template<>
  581. struct GetFsm_<void> : euml_action<GetFsm_<void> >
  582. {
  583. using euml_action<GetFsm_>::operator=;
  584. template <class Event,class FSM,class STATE >
  585. struct state_action_result
  586. {
  587. typedef FSM& type;
  588. };
  589. template <class EVT,class FSM,class SourceState,class TargetState>
  590. struct transition_action_result
  591. {
  592. typedef FSM& type;
  593. };
  594. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  595. template <class Event,class FSM,class STATE>
  596. typename state_action_result<Event,FSM,STATE>::type
  597. operator()(Event const&,FSM& fsm,STATE& )
  598. {
  599. return fsm;
  600. }
  601. template <class EVT,class FSM,class SourceState,class TargetState>
  602. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  603. operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
  604. {
  605. return fsm;
  606. }
  607. };
  608. struct GetFsm_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetFsm_Helper, boost::msm::sm_domain>
  609. {
  610. GetFsm_Helper(){}
  611. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  612. #ifdef BOOST_MSVC
  613. ,class Arg6
  614. #endif
  615. >
  616. struct In
  617. {
  618. typedef GetFsm_<Arg1> type;
  619. };
  620. };
  621. GetFsm_Helper const fsm_ = GetFsm_Helper();
  622. template <class StateName,class Param1>
  623. struct SubState_ : euml_action<SubState_<StateName, Param1> >
  624. {
  625. template <class Event,class FSM,class STATE >
  626. struct state_action_result
  627. {
  628. typedef StateName& type;
  629. };
  630. template <class EVT,class FSM,class SourceState,class TargetState>
  631. struct transition_action_result
  632. {
  633. typedef StateName& type;
  634. };
  635. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  636. template <class EVT,class FSM,class SourceState,class TargetState>
  637. StateName& operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  638. {
  639. return (Param1()(evt,fsm,src,tgt)).template get_state<StateName&>();
  640. }
  641. template <class Event,class FSM,class STATE>
  642. StateName& operator()(Event const& evt,FSM& fsm,STATE& state)const
  643. {
  644. return (Param1()(evt,fsm,state)).template get_state<StateName&>();
  645. }
  646. };
  647. template <class StateName>
  648. struct SubState_ <StateName,void>
  649. : euml_action<SubState_<StateName, void > >
  650. {
  651. template <class Event,class FSM,class STATE >
  652. struct state_action_result
  653. {
  654. typedef StateName& type;
  655. };
  656. template <class EVT,class FSM,class SourceState,class TargetState>
  657. struct transition_action_result
  658. {
  659. typedef StateName& type;
  660. };
  661. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  662. template <class EVT,class FSM,class SourceState,class TargetState>
  663. StateName& operator()(EVT const&,FSM& fsm,SourceState& ,TargetState& )const
  664. {
  665. return fsm.template get_state<StateName&>();
  666. }
  667. template <class Event,class FSM,class STATE>
  668. StateName& operator()(Event const& ,FSM& fsm,STATE& )const
  669. {
  670. return fsm.template get_state<StateName&>();
  671. }
  672. };
  673. struct SubState_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, boost::msm::sm_domain>
  674. {
  675. SubState_Helper(){}
  676. using proto::extends< proto::terminal<fsm_artefact_tag>::type, SubState_Helper, boost::msm::sm_domain>::operator=;
  677. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  678. #ifdef BOOST_MSVC
  679. ,class Arg6
  680. #endif
  681. >
  682. struct In
  683. {
  684. typedef SubState_<Arg1,Arg2> type;
  685. };
  686. };
  687. SubState_Helper const substate_ = SubState_Helper();
  688. template <class Target,class Index>
  689. struct GetAttribute_ : euml_action<GetAttribute_<Target, Index> >
  690. {
  691. using euml_action<GetAttribute_<Target,Index> >::operator=;
  692. template <class Event,class FSM,class STATE >
  693. struct state_action_result
  694. {
  695. typedef typename
  696. ::boost::fusion::result_of::at_key<
  697. typename get_attributes_type<
  698. typename ::boost::remove_reference<
  699. typename get_result_type2<Target,Event,FSM,STATE>::type>::type>::type,
  700. Index >::type type;
  701. };
  702. template <class EVT,class FSM,class SourceState,class TargetState>
  703. struct transition_action_result
  704. {
  705. typedef typename
  706. ::boost::fusion::result_of::at_key<
  707. typename get_attributes_type<
  708. typename ::boost::remove_reference<
  709. typename get_result_type<Target,EVT,FSM,SourceState,TargetState>::type>::type>::type,
  710. Index >::type type;
  711. };
  712. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  713. template <class EVT,class FSM,class SourceState,class TargetState>
  714. typename ::boost::enable_if<
  715. typename ::boost::mpl::has_key<
  716. typename Target::tag_type,action_tag>::type,
  717. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  718. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  719. {
  720. return (Target()(evt,fsm,src,tgt)).get_attribute(Index());
  721. }
  722. template <class Event,class FSM,class STATE>
  723. typename ::boost::enable_if<
  724. typename ::boost::mpl::has_key<
  725. typename Target::tag_type,state_action_tag>::type,
  726. typename state_action_result<Event,FSM,STATE>::type >::type
  727. operator()(Event const& evt,FSM& fsm,STATE& state )const
  728. {
  729. return (Target()(evt,fsm,state)).get_attribute(Index());
  730. }
  731. };
  732. struct GetAttribute_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, GetAttribute_Helper, boost::msm::sm_domain>
  733. {
  734. GetAttribute_Helper(){}
  735. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  736. #ifdef BOOST_MSVC
  737. ,class Arg6
  738. #endif
  739. >
  740. struct In
  741. {
  742. typedef GetAttribute_<Arg1,Arg2> type;
  743. };
  744. };
  745. GetAttribute_Helper const attribute_ = GetAttribute_Helper();
  746. template <class Index>
  747. struct Source_ : euml_action<Source_<Index> >
  748. {
  749. using euml_action<Source_<Index> >::operator=;
  750. template <class EVT,class FSM,class SourceState,class TargetState>
  751. struct transition_action_result
  752. {
  753. typedef typename
  754. ::boost::fusion::result_of::at_key<typename SourceState::attributes_type,
  755. Index >::type type;
  756. };
  757. typedef ::boost::mpl::set<action_tag> tag_type;
  758. template <class EVT,class FSM,class SourceState,class TargetState>
  759. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  760. operator()(EVT const& , FSM&,SourceState& src,TargetState& )const
  761. {
  762. return src.get_attribute(Index());
  763. }
  764. };
  765. template <class Index>
  766. struct Target_ : euml_action<Target_<Index> >
  767. {
  768. using euml_action<Target_<Index> >::operator=;
  769. template <class EVT,class FSM,class SourceState,class TargetState>
  770. struct transition_action_result
  771. {
  772. typedef typename
  773. ::boost::fusion::result_of::at_key<typename TargetState::attributes_type,
  774. Index >::type type;
  775. };
  776. typedef ::boost::mpl::set<action_tag> tag_type;
  777. template <class EVT,class FSM,class SourceState,class TargetState>
  778. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  779. operator()(EVT const& ,FSM& ,SourceState& ,TargetState& tgt)const
  780. {
  781. return tgt.get_attribute(Index());
  782. }
  783. };
  784. template <class Index>
  785. struct State_ : euml_action<State_<Index> >
  786. {
  787. using euml_action<State_<Index> >::operator=;
  788. template <class Event,class FSM,class STATE >
  789. struct state_action_result
  790. {
  791. typedef typename
  792. ::boost::fusion::result_of::at_key<typename STATE::attributes_type,
  793. Index >::type type;
  794. };
  795. typedef ::boost::mpl::set<state_action_tag> tag_type;
  796. template <class Event,class FSM,class STATE>
  797. typename state_action_result<Event,FSM,STATE>::type
  798. operator()(Event const&,FSM& ,STATE& state )
  799. {
  800. return state.get_attribute(Index());
  801. }
  802. };
  803. template <class Index>
  804. struct Event_ : euml_action<Event_<Index> >
  805. {
  806. using euml_action<Event_<Index> >::operator=;
  807. template <class Event,class FSM,class STATE >
  808. struct state_action_result
  809. {
  810. typedef typename ::boost::add_const<
  811. typename ::boost::fusion::result_of::at_key<typename Event::attributes_type,
  812. Index >::type>::type type;
  813. };
  814. template <class EVT,class FSM,class SourceState,class TargetState>
  815. struct transition_action_result
  816. {
  817. typedef typename ::boost::add_const<
  818. typename ::boost::fusion::result_of::at_key<typename EVT::attributes_type,
  819. Index >::type>::type type;
  820. };
  821. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  822. template <class Event,class FSM,class STATE>
  823. typename state_action_result<Event,FSM,STATE>::type
  824. operator()(Event const& evt,FSM& ,STATE& )
  825. {
  826. return evt.get_attribute(Index());
  827. }
  828. template <class EVT,class FSM,class SourceState,class TargetState>
  829. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  830. operator()(EVT const& evt ,FSM& ,SourceState& ,TargetState&)const
  831. {
  832. return evt.get_attribute(Index());
  833. }
  834. };
  835. template <class StateType,class Index>
  836. struct State_Attribute_ : euml_action<State_Attribute_<StateType,Index> >
  837. {
  838. using euml_action<State_Attribute_<StateType,Index> >::operator=;
  839. template <class Event,class FSM,class STATE >
  840. struct state_action_result
  841. {
  842. typedef typename
  843. ::boost::fusion::result_of::at_key<typename StateType::attributes_type,
  844. Index >::type type;
  845. };
  846. typedef ::boost::mpl::set<state_action_tag> tag_type;
  847. template <class Event,class FSM,class STATE>
  848. typename state_action_result<Event,FSM,STATE>::type
  849. operator()(Event const&,FSM& fsm,STATE& )
  850. {
  851. return fsm.template get_state<StateType&>().get_attribute(Index());
  852. }
  853. };
  854. template <class Index>
  855. struct Fsm_ : euml_action<Fsm_<Index> >
  856. {
  857. using euml_action<Fsm_<Index> >::operator=;
  858. template <class Event,class FSM,class STATE >
  859. struct state_action_result
  860. {
  861. typedef typename
  862. ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
  863. Index >::type type;
  864. };
  865. template <class EVT,class FSM,class SourceState,class TargetState>
  866. struct transition_action_result
  867. {
  868. typedef typename
  869. ::boost::fusion::result_of::at_key<typename FSM::attributes_type,
  870. Index >::type type;
  871. };
  872. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  873. template <class Event,class FSM,class STATE>
  874. typename state_action_result<Event,FSM,STATE>::type
  875. operator()(Event const&,FSM& fsm,STATE& )
  876. {
  877. return fsm.get_attribute(Index());
  878. }
  879. template <class EVT,class FSM,class SourceState,class TargetState>
  880. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  881. operator()(EVT const& ,FSM& fsm,SourceState& ,TargetState&)const
  882. {
  883. return fsm.get_attribute(Index());
  884. }
  885. };
  886. struct True_ : euml::euml_action<True_>
  887. {
  888. using euml_action<True_>::operator=;
  889. True_(){}
  890. template <class Event,class FSM,class STATE >
  891. struct state_action_result
  892. {
  893. typedef bool type;
  894. };
  895. template <class EVT,class FSM,class SourceState,class TargetState>
  896. struct transition_action_result
  897. {
  898. typedef bool type;
  899. };
  900. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  901. template <class EVT,class FSM,class SourceState,class TargetState>
  902. bool operator()(EVT const&,FSM&,SourceState& ,TargetState& )
  903. {
  904. return true;
  905. }
  906. template <class Event,class FSM,class STATE>
  907. bool operator()(Event const&,FSM&,STATE& )
  908. {
  909. return true;
  910. }
  911. };
  912. True_ const true_ = True_();
  913. struct False_ : euml::euml_action<False_>
  914. {
  915. using euml_action<False_>::operator=;
  916. False_(){}
  917. template <class Event,class FSM,class STATE >
  918. struct state_action_result
  919. {
  920. typedef bool type;
  921. };
  922. template <class EVT,class FSM,class SourceState,class TargetState>
  923. struct transition_action_result
  924. {
  925. typedef bool type;
  926. };
  927. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  928. template <class EVT,class FSM,class SourceState,class TargetState>
  929. bool operator()(EVT const&,FSM&,SourceState& ,TargetState& )
  930. {
  931. return false;
  932. }
  933. template <class Event,class FSM,class STATE>
  934. bool operator()(Event const&,FSM&,STATE& )
  935. {
  936. return false;
  937. }
  938. };
  939. False_ const false_ = False_();
  940. template <int Val>
  941. struct Int_ : euml_action<Int_<Val> >
  942. {
  943. using euml_action<Int_<Val> >::operator=;
  944. typedef ::boost::mpl::int_<Val> value_type;
  945. enum {value = Val};
  946. template <class Event,class FSM,class STATE >
  947. struct state_action_result
  948. {
  949. typedef int type;
  950. };
  951. template <class EVT,class FSM,class SourceState,class TargetState>
  952. struct transition_action_result
  953. {
  954. typedef int type;
  955. };
  956. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  957. template <class EVT,class FSM,class SourceState,class TargetState>
  958. int operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
  959. {
  960. return Val;
  961. }
  962. template <class Event,class FSM,class STATE>
  963. int operator()(Event const& ,FSM& ,STATE& )
  964. {
  965. return Val;
  966. }
  967. };
  968. template <char Val>
  969. struct Char_ : euml_action<Char_<Val> >
  970. {
  971. using euml_action<Char_<Val> >::operator=;
  972. template <class Event,class FSM,class STATE >
  973. struct state_action_result
  974. {
  975. typedef char type;
  976. };
  977. template <class EVT,class FSM,class SourceState,class TargetState>
  978. struct transition_action_result
  979. {
  980. typedef char type;
  981. };
  982. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  983. template <class EVT,class FSM,class SourceState,class TargetState>
  984. char operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
  985. {
  986. return Val;
  987. }
  988. template <class Event,class FSM,class STATE>
  989. char operator()(Event const& ,FSM& ,STATE& )
  990. {
  991. return Val;
  992. }
  993. };
  994. template <size_t Val>
  995. struct Size_t_ : euml_action<Size_t_<Val> >
  996. {
  997. using euml_action<Size_t_<Val> >::operator=;
  998. template <class Event,class FSM,class STATE >
  999. struct state_action_result
  1000. {
  1001. typedef size_t type;
  1002. };
  1003. template <class EVT,class FSM,class SourceState,class TargetState>
  1004. struct transition_action_result
  1005. {
  1006. typedef size_t type;
  1007. };
  1008. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1009. template <class EVT,class FSM,class SourceState,class TargetState>
  1010. size_t operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
  1011. {
  1012. return Val;
  1013. }
  1014. template <class Event,class FSM,class STATE>
  1015. size_t operator()(Event const& ,FSM& ,STATE& )
  1016. {
  1017. return Val;
  1018. }
  1019. };
  1020. #if BOOST_VERSION >= 104000
  1021. template <class T>
  1022. struct String_ : euml_action<String_<T> >
  1023. {
  1024. using euml_action<String_<T> >::operator=;
  1025. template <class Event,class FSM,class STATE >
  1026. struct state_action_result
  1027. {
  1028. typedef char const* type;
  1029. };
  1030. template <class EVT,class FSM,class SourceState,class TargetState>
  1031. struct transition_action_result
  1032. {
  1033. typedef char const* type;
  1034. };
  1035. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1036. template <class EVT,class FSM,class SourceState,class TargetState>
  1037. char const* operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
  1038. {
  1039. return ::boost::mpl::c_str<T>::value;
  1040. }
  1041. template <class Event,class FSM,class STATE>
  1042. char const* operator()(Event const& ,FSM& ,STATE& )
  1043. {
  1044. return ::boost::mpl::c_str<T>::value;
  1045. }
  1046. };
  1047. #endif
  1048. template <class T>
  1049. struct Predicate_ : euml_action<Predicate_<T> >
  1050. {
  1051. using euml_action<Predicate_<T> >::operator=;
  1052. template <class Event,class FSM,class STATE >
  1053. struct state_action_result
  1054. {
  1055. typedef T type;
  1056. };
  1057. template <class EVT,class FSM,class SourceState,class TargetState>
  1058. struct transition_action_result
  1059. {
  1060. typedef T type;
  1061. };
  1062. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1063. template <class EVT,class FSM,class SourceState,class TargetState>
  1064. T operator()(EVT const& , FSM& ,SourceState& ,TargetState& )
  1065. {
  1066. return T();
  1067. }
  1068. template <class Event,class FSM,class STATE>
  1069. T operator()(Event const& ,FSM& ,STATE& )
  1070. {
  1071. return T();
  1072. }
  1073. };
  1074. template <class ToProcessEvt,class Param1, class Param2, class Param3, class Param4>
  1075. struct Process_ : euml_action<Process_<ToProcessEvt, Param1, Param2, Param3, Param4> >
  1076. {
  1077. template <class Event,class FSM,class STATE >
  1078. struct state_action_result
  1079. {
  1080. typedef void type;
  1081. };
  1082. template <class EVT,class FSM,class SourceState,class TargetState>
  1083. struct transition_action_result
  1084. {
  1085. typedef void type;
  1086. };
  1087. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1088. template <class EVT,class FSM,class SourceState,class TargetState>
  1089. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1090. {
  1091. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1092. (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1093. (Param3()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1094. (Param4()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1095. }
  1096. template <class Event,class FSM,class STATE>
  1097. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1098. {
  1099. (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
  1100. (Param2()(evt,fsm,state)).process_event(ToProcessEvt());
  1101. (Param3()(evt,fsm,state)).process_event(ToProcessEvt());
  1102. (Param4()(evt,fsm,state)).process_event(ToProcessEvt());
  1103. }
  1104. };
  1105. template <class ToProcessEvt>
  1106. struct Process_ <ToProcessEvt,void,void,void,void>
  1107. : euml_action<Process_<ToProcessEvt, void, void, void, void > >
  1108. {
  1109. template <class Event,class FSM,class STATE >
  1110. struct state_action_result
  1111. {
  1112. typedef void type;
  1113. };
  1114. template <class EVT,class FSM,class SourceState,class TargetState>
  1115. struct transition_action_result
  1116. {
  1117. typedef void type;
  1118. };
  1119. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1120. template <class EVT,class FSM,class SourceState,class TargetState>
  1121. void operator()(EVT const&,FSM& fsm,SourceState& ,TargetState& )const
  1122. {
  1123. fsm.process_event(ToProcessEvt());
  1124. }
  1125. template <class Event,class FSM,class STATE>
  1126. void operator()(Event const& ,FSM& fsm,STATE& )const
  1127. {
  1128. fsm.process_event(ToProcessEvt());
  1129. }
  1130. };
  1131. template <class ToProcessEvt,class Param1>
  1132. struct Process_ <ToProcessEvt,Param1,void,void,void>
  1133. : euml_action<Process_<ToProcessEvt, Param1, void, void, void> >
  1134. {
  1135. template <class Event,class FSM,class STATE >
  1136. struct state_action_result
  1137. {
  1138. typedef void type;
  1139. };
  1140. template <class EVT,class FSM,class SourceState,class TargetState>
  1141. struct transition_action_result
  1142. {
  1143. typedef void type;
  1144. };
  1145. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1146. template <class EVT,class FSM,class SourceState,class TargetState>
  1147. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1148. {
  1149. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1150. }
  1151. template <class Event,class FSM,class STATE>
  1152. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1153. {
  1154. (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
  1155. }
  1156. };
  1157. template <class ToProcessEvt,class Param1, class Param2>
  1158. struct Process_ <ToProcessEvt,Param1,Param2,void,void>
  1159. : euml_action<Process_<ToProcessEvt, Param1, Param2, void, void> >
  1160. {
  1161. template <class Event,class FSM,class STATE >
  1162. struct state_action_result
  1163. {
  1164. typedef void type;
  1165. };
  1166. template <class EVT,class FSM,class SourceState,class TargetState>
  1167. struct transition_action_result
  1168. {
  1169. typedef void type;
  1170. };
  1171. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1172. template <class EVT,class FSM,class SourceState,class TargetState>
  1173. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1174. {
  1175. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1176. (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1177. }
  1178. template <class Event,class FSM,class STATE>
  1179. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1180. {
  1181. (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
  1182. (Param2()(evt,fsm,state)).process_event(ToProcessEvt());
  1183. }
  1184. };
  1185. template <class ToProcessEvt,class Param1, class Param2, class Param3>
  1186. struct Process_ <ToProcessEvt,Param1,Param2,Param3,void>
  1187. : euml_action<Process_<ToProcessEvt, Param1, Param2, Param3, void> >
  1188. {
  1189. template <class Event,class FSM,class STATE >
  1190. struct state_action_result
  1191. {
  1192. typedef void type;
  1193. };
  1194. template <class EVT,class FSM,class SourceState,class TargetState>
  1195. struct transition_action_result
  1196. {
  1197. typedef void type;
  1198. };
  1199. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1200. template <class EVT,class FSM,class SourceState,class TargetState>
  1201. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1202. {
  1203. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1204. (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1205. (Param3()(evt,fsm,src,tgt)).process_event(ToProcessEvt());
  1206. }
  1207. template <class Event,class FSM,class STATE>
  1208. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1209. {
  1210. (Param1()(evt,fsm,state)).process_event(ToProcessEvt());
  1211. (Param2()(evt,fsm,state)).process_event(ToProcessEvt());
  1212. (Param3()(evt,fsm,state)).process_event(ToProcessEvt());
  1213. }
  1214. };
  1215. //version for process_(event_)
  1216. template <>
  1217. struct Process_ <GetEvent_<void>,void,void,void,void>
  1218. : euml_action<Process_<GetEvent_<void>, void, void, void, void > >
  1219. {
  1220. template <class Event,class FSM,class STATE >
  1221. struct state_action_result
  1222. {
  1223. typedef void type;
  1224. };
  1225. template <class EVT,class FSM,class SourceState,class TargetState>
  1226. struct transition_action_result
  1227. {
  1228. typedef void type;
  1229. };
  1230. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1231. template <class EVT,class FSM,class SourceState,class TargetState>
  1232. void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& )const
  1233. {
  1234. fsm.process_event(evt);
  1235. }
  1236. template <class Event,class FSM,class STATE>
  1237. void operator()(Event const& evt,FSM& fsm,STATE& )const
  1238. {
  1239. fsm.process_event(evt);
  1240. }
  1241. };
  1242. struct process_tag {};
  1243. struct Process_Helper: proto::extends< proto::terminal<process_tag>::type, Process_Helper, boost::msm::sm_domain>
  1244. {
  1245. Process_Helper(){}
  1246. using proto::extends< proto::terminal<process_tag>::type, Process_Helper, boost::msm::sm_domain>::operator=;
  1247. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1248. #ifdef BOOST_MSVC
  1249. ,class Arg6
  1250. #endif
  1251. >
  1252. struct In
  1253. {
  1254. typedef Process_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
  1255. };
  1256. };
  1257. Process_Helper const process_ = Process_Helper();
  1258. template <class Param1, class Param2, class Param3, class Param4>
  1259. struct Reprocess_ : euml_action<Reprocess_<Param1, Param2, Param3, Param4> >
  1260. {
  1261. template <class Event,class FSM,class STATE >
  1262. struct state_action_result
  1263. {
  1264. typedef void type;
  1265. };
  1266. template <class EVT,class FSM,class SourceState,class TargetState>
  1267. struct transition_action_result
  1268. {
  1269. typedef void type;
  1270. };
  1271. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1272. template <class EVT,class FSM,class SourceState,class TargetState>
  1273. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1274. {
  1275. (Param1()(evt,fsm,src,tgt)).process_event(evt);
  1276. (Param2()(evt,fsm,src,tgt)).process_event(evt);
  1277. (Param3()(evt,fsm,src,tgt)).process_event(evt);
  1278. (Param4()(evt,fsm,src,tgt)).process_event(evt);
  1279. }
  1280. template <class Event,class FSM,class STATE>
  1281. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1282. {
  1283. (Param1()(evt,fsm,state)).process_event(evt);
  1284. (Param2()(evt,fsm,state)).process_event(evt);
  1285. (Param3()(evt,fsm,state)).process_event(evt);
  1286. (Param4()(evt,fsm,state)).process_event(evt);
  1287. }
  1288. };
  1289. template <>
  1290. struct Reprocess_ <void,void,void,void>
  1291. : euml_action<Reprocess_<void, void, void, void > >
  1292. {
  1293. template <class Event,class FSM,class STATE >
  1294. struct state_action_result
  1295. {
  1296. typedef void type;
  1297. };
  1298. template <class EVT,class FSM,class SourceState,class TargetState>
  1299. struct transition_action_result
  1300. {
  1301. typedef void type;
  1302. };
  1303. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1304. template <class EVT,class FSM,class SourceState,class TargetState>
  1305. void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& )const
  1306. {
  1307. fsm.process_event(evt);
  1308. }
  1309. template <class Event,class FSM,class STATE>
  1310. void operator()(Event const& evt,FSM& fsm,STATE& )const
  1311. {
  1312. fsm.process_event(evt);
  1313. }
  1314. };
  1315. template <class Param1>
  1316. struct Reprocess_ <Param1,void,void,void>
  1317. : euml_action<Reprocess_<Param1, void, void, void> >
  1318. {
  1319. template <class Event,class FSM,class STATE >
  1320. struct state_action_result
  1321. {
  1322. typedef void type;
  1323. };
  1324. template <class EVT,class FSM,class SourceState,class TargetState>
  1325. struct transition_action_result
  1326. {
  1327. typedef void type;
  1328. };
  1329. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1330. template <class EVT,class FSM,class SourceState,class TargetState>
  1331. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1332. {
  1333. (Param1()(evt,fsm,src,tgt)).process_event(evt);
  1334. }
  1335. template <class Event,class FSM,class STATE>
  1336. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1337. {
  1338. (Param1()(evt,fsm,state)).process_event(evt);
  1339. }
  1340. };
  1341. template <class Param1, class Param2>
  1342. struct Reprocess_ <Param1,Param2,void,void>
  1343. : euml_action<Reprocess_<Param1, Param2, void, void> >
  1344. {
  1345. template <class Event,class FSM,class STATE >
  1346. struct state_action_result
  1347. {
  1348. typedef void type;
  1349. };
  1350. template <class EVT,class FSM,class SourceState,class TargetState>
  1351. struct transition_action_result
  1352. {
  1353. typedef void type;
  1354. };
  1355. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1356. template <class EVT,class FSM,class SourceState,class TargetState>
  1357. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1358. {
  1359. (Param1()(evt,fsm,src,tgt)).process_event(evt);
  1360. (Param2()(evt,fsm,src,tgt)).process_event(evt);
  1361. }
  1362. template <class Event,class FSM,class STATE>
  1363. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1364. {
  1365. (Param1()(evt,fsm,state)).process_event(evt);
  1366. (Param2()(evt,fsm,state)).process_event(evt);
  1367. }
  1368. };
  1369. template <class Param1, class Param2, class Param3>
  1370. struct Reprocess_ <Param1,Param2,Param3,void>
  1371. : euml_action<Reprocess_<Param1, Param2, Param3, void> >
  1372. {
  1373. template <class Event,class FSM,class STATE >
  1374. struct state_action_result
  1375. {
  1376. typedef void type;
  1377. };
  1378. template <class EVT,class FSM,class SourceState,class TargetState>
  1379. struct transition_action_result
  1380. {
  1381. typedef void type;
  1382. };
  1383. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1384. template <class EVT,class FSM,class SourceState,class TargetState>
  1385. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1386. {
  1387. (Param1()(evt,fsm,src,tgt)).process_event(evt);
  1388. (Param2()(evt,fsm,src,tgt)).process_event(evt);
  1389. (Param3()(evt,fsm,src,tgt)).process_event(evt);
  1390. }
  1391. template <class Event,class FSM,class STATE>
  1392. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1393. {
  1394. (Param1()(evt,fsm,state)).process_event(evt);
  1395. (Param2()(evt,fsm,state)).process_event(evt);
  1396. (Param3()(evt,fsm,state)).process_event(evt);
  1397. }
  1398. };
  1399. struct reprocess_tag {};
  1400. struct Reprocess_Helper: proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, boost::msm::sm_domain>
  1401. {
  1402. Reprocess_Helper(){}
  1403. using proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, boost::msm::sm_domain>::operator=;
  1404. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1405. #ifdef BOOST_MSVC
  1406. ,class Arg6
  1407. #endif
  1408. >
  1409. struct In
  1410. {
  1411. typedef Reprocess_<Arg1,Arg2,Arg3,Arg4> type;
  1412. };
  1413. };
  1414. Reprocess_Helper const reprocess_ = Reprocess_Helper();
  1415. template <class ToProcessEvt,class Value,class Param1, class Param2, class Param3>
  1416. struct Process2_ : euml_action<Process2_<ToProcessEvt,Value, Param1, Param2, Param3> >
  1417. {
  1418. template <class Event,class FSM,class STATE >
  1419. struct state_action_result
  1420. {
  1421. typedef void type;
  1422. };
  1423. template <class EVT,class FSM,class SourceState,class TargetState>
  1424. struct transition_action_result
  1425. {
  1426. typedef void type;
  1427. };
  1428. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1429. template <class EVT,class FSM,class SourceState,class TargetState>
  1430. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1431. {
  1432. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1433. (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1434. (Param3()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1435. }
  1436. template <class Event,class FSM,class STATE>
  1437. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1438. {
  1439. (Param1()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1440. (Param2()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1441. (Param3()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1442. }
  1443. };
  1444. template <class ToProcessEvt,class Value>
  1445. struct Process2_ <ToProcessEvt,Value,void,void,void>
  1446. : euml_action<Process2_<ToProcessEvt,Value, void, void, void > >
  1447. {
  1448. template <class Event,class FSM,class STATE >
  1449. struct state_action_result
  1450. {
  1451. typedef void type;
  1452. };
  1453. template <class EVT,class FSM,class SourceState,class TargetState>
  1454. struct transition_action_result
  1455. {
  1456. typedef void type;
  1457. };
  1458. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1459. template <class EVT,class FSM,class SourceState,class TargetState>
  1460. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1461. {
  1462. fsm.process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1463. }
  1464. template <class Event,class FSM,class STATE>
  1465. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1466. {
  1467. fsm.process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1468. }
  1469. };
  1470. template <class ToProcessEvt,class Value,class Param1>
  1471. struct Process2_ <ToProcessEvt,Value,Param1,void,void>
  1472. : euml_action<Process2_<ToProcessEvt,Value, Param1, void, void> >
  1473. {
  1474. template <class Event,class FSM,class STATE >
  1475. struct state_action_result
  1476. {
  1477. typedef void type;
  1478. };
  1479. template <class EVT,class FSM,class SourceState,class TargetState>
  1480. struct transition_action_result
  1481. {
  1482. typedef void type;
  1483. };
  1484. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1485. template <class EVT,class FSM,class SourceState,class TargetState>
  1486. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1487. {
  1488. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1489. }
  1490. template <class Event,class FSM,class STATE>
  1491. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1492. {
  1493. (Param1()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1494. }
  1495. };
  1496. template <class ToProcessEvt,class Value,class Param1, class Param2>
  1497. struct Process2_ <ToProcessEvt,Value,Param1,Param2,void>
  1498. : euml_action<Process2_<ToProcessEvt,Value, Param1, Param2, void> >
  1499. {
  1500. template <class Event,class FSM,class STATE >
  1501. struct state_action_result
  1502. {
  1503. typedef void type;
  1504. };
  1505. template <class EVT,class FSM,class SourceState,class TargetState>
  1506. struct transition_action_result
  1507. {
  1508. typedef void type;
  1509. };
  1510. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1511. template <class EVT,class FSM,class SourceState,class TargetState>
  1512. void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1513. {
  1514. (Param1()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1515. (Param2()(evt,fsm,src,tgt)).process_event(ToProcessEvt(Value()(evt,fsm,src,tgt)));
  1516. }
  1517. template <class Event,class FSM,class STATE>
  1518. void operator()(Event const& evt,FSM& fsm,STATE& state)const
  1519. {
  1520. (Param1()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1521. (Param2()(evt,fsm,state)).process_event(ToProcessEvt(Value()(evt,fsm,state)));
  1522. }
  1523. };
  1524. struct process2_tag {};
  1525. struct Process2_Helper : proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, boost::msm::sm_domain>
  1526. {
  1527. Process2_Helper(){}
  1528. using proto::extends< proto::terminal<process2_tag>::type, Process2_Helper, boost::msm::sm_domain>::operator=;
  1529. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1530. #ifdef BOOST_MSVC
  1531. ,class Arg6
  1532. #endif
  1533. >
  1534. struct In
  1535. {
  1536. typedef Process2_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
  1537. };
  1538. };
  1539. Process2_Helper const process2_ = Process2_Helper();
  1540. template <class Flag,class Param1=void, class Enable=void >
  1541. struct Get_Flag_ : euml_action<Get_Flag_<Flag,Param1,Enable> > {};
  1542. template <class Flag,class Param1>
  1543. struct Get_Flag_ <Flag,Param1
  1544. , typename ::boost::enable_if<typename ::boost::is_same<Param1,void>::type >::type>
  1545. : euml_action<Get_Flag_<Flag, Param1> >
  1546. {
  1547. template <class Event,class FSM,class STATE >
  1548. struct state_action_result
  1549. {
  1550. typedef bool type;
  1551. };
  1552. template <class EVT,class FSM,class SourceState,class TargetState>
  1553. struct transition_action_result
  1554. {
  1555. typedef bool type;
  1556. };
  1557. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1558. template <class EVT,class FSM,class SourceState,class TargetState>
  1559. bool operator()(EVT const&,FSM& fsm,SourceState& ,TargetState& )const
  1560. {
  1561. return fsm.template is_flag_active<Flag>();
  1562. }
  1563. template <class Event,class FSM,class STATE>
  1564. bool operator()(Event const& ,FSM& fsm,STATE& )const
  1565. {
  1566. return fsm.template is_flag_active<Flag>();
  1567. }
  1568. };
  1569. template <class Flag,class Param1>
  1570. struct Get_Flag_ <Flag,Param1
  1571. , typename ::boost::disable_if<
  1572. typename ::boost::is_same<Param1,void>::type
  1573. >::type>
  1574. : euml_action<Get_Flag_<Flag, Param1> >
  1575. {
  1576. template <class Event,class FSM,class STATE >
  1577. struct state_action_result
  1578. {
  1579. typedef bool type;
  1580. };
  1581. template <class EVT,class FSM,class SourceState,class TargetState>
  1582. struct transition_action_result
  1583. {
  1584. typedef bool type;
  1585. };
  1586. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1587. template <class EVT,class FSM,class SourceState,class TargetState>
  1588. bool operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
  1589. {
  1590. return (Param1()(evt,fsm,src,tgt)).template is_flag_active<Flag>();
  1591. }
  1592. template <class Event,class FSM,class STATE>
  1593. bool operator()(Event const& evt,FSM& fsm,STATE& state)const
  1594. {
  1595. return (Param1()(evt,fsm,state)).template is_flag_active<Flag>();
  1596. }
  1597. };
  1598. struct Get_Flag_Helper: proto::extends< proto::terminal<fsm_artefact_tag>::type, Get_Flag_Helper, boost::msm::sm_domain>
  1599. {
  1600. Get_Flag_Helper(){}
  1601. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1602. #ifdef BOOST_MSVC
  1603. ,class Arg6
  1604. #endif
  1605. >
  1606. struct In
  1607. {
  1608. typedef Get_Flag_<Arg1,Arg2> type;
  1609. };
  1610. };
  1611. Get_Flag_Helper const is_flag_ = Get_Flag_Helper();
  1612. // deferring an event
  1613. struct DeferEvent_ : euml_action< DeferEvent_ >
  1614. {
  1615. typedef ::boost::mpl::set<action_tag> tag_type;
  1616. // mark as deferring to avoid stack overflows in certain conditions
  1617. typedef int deferring_action;
  1618. template <class EVT,class FSM,class SourceState,class TargetState>
  1619. void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& ) const
  1620. {
  1621. fsm.defer_event(evt);
  1622. }
  1623. };
  1624. struct Defer_Helper : proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, boost::msm::sm_domain>
  1625. {
  1626. Defer_Helper(){}
  1627. using proto::extends< proto::terminal<fsm_artefact_tag>::type, Defer_Helper, boost::msm::sm_domain>::operator=;
  1628. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1629. #ifdef BOOST_MSVC
  1630. ,class Arg6
  1631. #endif
  1632. >
  1633. struct In
  1634. {
  1635. typedef DeferEvent_ type;
  1636. };
  1637. };
  1638. Defer_Helper const defer_ = Defer_Helper();
  1639. struct explicit_tag {};
  1640. struct Explicit_Helper : proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, boost::msm::sm_domain>
  1641. {
  1642. Explicit_Helper(){}
  1643. using proto::extends< proto::terminal<explicit_tag>::type, Explicit_Helper, boost::msm::sm_domain>::operator=;
  1644. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1645. #ifdef BOOST_MSVC
  1646. ,class Arg6
  1647. #endif
  1648. >
  1649. struct In
  1650. {
  1651. typedef typename Arg1::template direct<Arg2> type;
  1652. };
  1653. };
  1654. Explicit_Helper const explicit_ = Explicit_Helper();
  1655. struct entry_pt_tag {};
  1656. struct Entry_Pt_Helper : proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, boost::msm::sm_domain>
  1657. {
  1658. Entry_Pt_Helper(){}
  1659. using proto::extends< proto::terminal<entry_pt_tag>::type, Entry_Pt_Helper, boost::msm::sm_domain>::operator=;
  1660. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1661. #ifdef BOOST_MSVC
  1662. ,class Arg6
  1663. #endif
  1664. >
  1665. struct In
  1666. {
  1667. typedef typename Arg1::template entry_pt<Arg2> type;
  1668. };
  1669. };
  1670. Entry_Pt_Helper const entry_pt_ = Entry_Pt_Helper();
  1671. struct exit_pt_tag {};
  1672. struct Exit_Pt_Helper : proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, boost::msm::sm_domain>
  1673. {
  1674. Exit_Pt_Helper(){}
  1675. using proto::extends< proto::terminal<exit_pt_tag>::type, Exit_Pt_Helper, boost::msm::sm_domain>::operator=;
  1676. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1677. #ifdef BOOST_MSVC
  1678. ,class Arg6
  1679. #endif
  1680. >
  1681. struct In
  1682. {
  1683. typedef typename Arg1::template exit_pt<Arg2> type;
  1684. };
  1685. };
  1686. Exit_Pt_Helper const exit_pt_ = Exit_Pt_Helper();
  1687. #ifdef BOOST_MSVC
  1688. #define BOOST_MSM_EUML_FUNCTION(functor,function,function_name,result_trans,result_state) \
  1689. template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
  1690. class Param5=void,class Param6=void,class Enable=void > \
  1691. struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6,Enable> > {}; \
  1692. template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6> \
  1693. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1694. typename ::boost::enable_if<typename ::boost::is_same<Param1,void>::type>::type> \
  1695. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1696. template <class Event,class FSM,class STATE > struct state_action_result { \
  1697. typedef result_state type;} ; \
  1698. template <class EVT,class FSM,class SourceState,class TargetState> \
  1699. struct transition_action_result { typedef result_trans type;}; \
  1700. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1701. template <class EVT,class FSM,class SourceState,class TargetState> \
  1702. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type \
  1703. operator()(EVT const& , FSM& ,SourceState& ,TargetState& )const { \
  1704. return function ();} \
  1705. template <class Event,class FSM,class STATE> \
  1706. typename state_action_result<Event,FSM,STATE>::type \
  1707. operator()(Event const& ,FSM& ,STATE& )const { \
  1708. return function ();} }; \
  1709. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1710. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1711. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1712. typename ::boost::is_same<Param1,void>::type,typename ::boost::mpl::not_< \
  1713. typename ::boost::is_same<Param2,void>::type>::type>::type >::type> \
  1714. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1715. template <class Event,class FSM,class STATE > struct state_action_result { \
  1716. typedef result_state type;} ; \
  1717. template <class EVT,class FSM,class SourceState,class TargetState> \
  1718. struct transition_action_result { typedef result_trans type;}; \
  1719. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1720. template <class EVT,class FSM,class SourceState,class TargetState> \
  1721. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1722. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1723. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1724. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1725. return function (Param1()(evt,fsm,src,tgt));} \
  1726. template <class Event,class FSM,class STATE> \
  1727. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1728. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1729. typename state_action_result<Event,FSM,STATE>::type >::type \
  1730. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1731. return function (Param1()(evt,fsm,state));} }; \
  1732. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1733. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1734. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1735. typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
  1736. typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
  1737. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1738. template <class Event,class FSM,class STATE > struct state_action_result { \
  1739. typedef result_state type;} ; \
  1740. template <class EVT,class FSM,class SourceState,class TargetState> \
  1741. struct transition_action_result { typedef result_trans type;}; \
  1742. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1743. template <class EVT,class FSM,class SourceState,class TargetState> \
  1744. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1745. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1746. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1747. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1748. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));} \
  1749. template <class Event,class FSM,class STATE> \
  1750. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1751. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1752. typename state_action_result<Event,FSM,STATE>::type >::type \
  1753. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1754. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state));} }; \
  1755. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1756. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1757. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1758. typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
  1759. typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
  1760. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1761. template <class Event,class FSM,class STATE > struct state_action_result { \
  1762. typedef result_state type;} ; \
  1763. template <class EVT,class FSM,class SourceState,class TargetState> \
  1764. struct transition_action_result { typedef result_trans type;}; \
  1765. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1766. template <class EVT,class FSM,class SourceState,class TargetState> \
  1767. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1768. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1769. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1770. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1771. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
  1772. template <class Event,class FSM,class STATE> \
  1773. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1774. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1775. typename state_action_result<Event,FSM,STATE>::type >::type \
  1776. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1777. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
  1778. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1779. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1780. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1781. typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
  1782. typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
  1783. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1784. template <class Event,class FSM,class STATE > struct state_action_result { \
  1785. typedef result_state type;} ; \
  1786. template <class EVT,class FSM,class SourceState,class TargetState> \
  1787. struct transition_action_result { typedef result_trans type;}; \
  1788. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1789. template <class EVT,class FSM,class SourceState,class TargetState> \
  1790. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1791. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1792. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1793. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1794. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  1795. ,Param4()(evt,fsm,src,tgt));} \
  1796. template <class Event,class FSM,class STATE> \
  1797. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1798. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1799. typename state_action_result<Event,FSM,STATE>::type >::type \
  1800. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1801. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  1802. ,Param4()(evt,fsm,state));} }; \
  1803. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1804. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1805. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1806. typename ::boost::is_same<Param5,void>::type,typename ::boost::mpl::not_< \
  1807. typename ::boost::is_same<Param6,void>::type>::type>::type >::type> \
  1808. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1809. template <class Event,class FSM,class STATE > struct state_action_result { \
  1810. typedef result_state type;} ; \
  1811. template <class EVT,class FSM,class SourceState,class TargetState> \
  1812. struct transition_action_result { typedef result_trans type;}; \
  1813. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1814. template <class EVT,class FSM,class SourceState,class TargetState> \
  1815. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1816. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1817. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1818. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1819. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  1820. ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
  1821. template <class Event,class FSM,class STATE> \
  1822. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1823. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1824. typename state_action_result<Event,FSM,STATE>::type >::type \
  1825. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1826. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  1827. ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
  1828. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1829. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1830. typename ::boost::disable_if<typename ::boost::is_same<Param6,void>::type>::type> \
  1831. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1832. template <class Event,class FSM,class STATE > struct state_action_result { \
  1833. typedef result_state type;} ; \
  1834. template <class EVT,class FSM,class SourceState,class TargetState> \
  1835. struct transition_action_result { typedef result_trans type;}; \
  1836. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1837. template <class EVT,class FSM,class SourceState,class TargetState> \
  1838. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1839. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1840. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1841. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1842. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  1843. ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt),Param6()(evt,fsm,src,tgt));} \
  1844. template <class Event,class FSM,class STATE> \
  1845. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1846. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1847. typename state_action_result<Event,FSM,STATE>::type >::type \
  1848. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1849. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  1850. ,Param4()(evt,fsm,state),Param5()(evt,fsm,state),Param6()(evt,fsm,state));} }; \
  1851. struct function_name ## tag{}; \
  1852. struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
  1853. functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
  1854. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5,class Arg6> \
  1855. struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> type;}; }; \
  1856. functor ## Helper const function_name = functor ## Helper ();
  1857. #define BOOST_MSM_EUML_METHOD(functor,function,function_name,result_trans,result_state) \
  1858. template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
  1859. class Param5=void,class Param6=void,class Enable=void > \
  1860. struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6,Enable> > {}; \
  1861. template <class Param1, class Param2, class Param3, class Param4, class Param5, class Param6> \
  1862. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1863. typename ::boost::enable_if<typename ::boost::is_same<Param2,void>::type>::type> \
  1864. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1865. template <class Event,class FSM,class STATE > struct state_action_result { \
  1866. typedef result_state type;} ; \
  1867. template <class EVT,class FSM,class SourceState,class TargetState> \
  1868. struct transition_action_result { typedef result_trans type;}; \
  1869. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1870. template <class EVT,class FSM,class SourceState,class TargetState> \
  1871. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1872. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1873. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1874. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1875. return (Param1()(evt,fsm,src,tgt)).function();} \
  1876. template <class Event,class FSM,class STATE> \
  1877. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1878. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1879. typename state_action_result<Event,FSM,STATE>::type >::type \
  1880. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1881. return (Param1()(evt,fsm,state)).function();} }; \
  1882. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1883. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1884. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1885. typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
  1886. typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
  1887. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1888. template <class Event,class FSM,class STATE > struct state_action_result { \
  1889. typedef result_state type;} ; \
  1890. template <class EVT,class FSM,class SourceState,class TargetState> \
  1891. struct transition_action_result { typedef result_trans type;}; \
  1892. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1893. template <class EVT,class FSM,class SourceState,class TargetState> \
  1894. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1895. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1896. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1897. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1898. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt));} \
  1899. template <class Event,class FSM,class STATE> \
  1900. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1901. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1902. typename state_action_result<Event,FSM,STATE>::type >::type \
  1903. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1904. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state));} }; \
  1905. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1906. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1907. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1908. typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
  1909. typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
  1910. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1911. template <class Event,class FSM,class STATE > struct state_action_result { \
  1912. typedef result_state type;} ; \
  1913. template <class EVT,class FSM,class SourceState,class TargetState> \
  1914. struct transition_action_result { typedef result_trans type;}; \
  1915. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1916. template <class EVT,class FSM,class SourceState,class TargetState> \
  1917. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1918. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1919. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1920. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1921. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
  1922. template <class Event,class FSM,class STATE> \
  1923. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1924. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1925. typename state_action_result<Event,FSM,STATE>::type >::type \
  1926. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1927. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
  1928. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1929. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1930. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1931. typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
  1932. typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
  1933. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1934. template <class Event,class FSM,class STATE > struct state_action_result { \
  1935. typedef result_state type;} ; \
  1936. template <class EVT,class FSM,class SourceState,class TargetState> \
  1937. struct transition_action_result { typedef result_trans type;}; \
  1938. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1939. template <class EVT,class FSM,class SourceState,class TargetState> \
  1940. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1941. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1942. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1943. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1944. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  1945. ,Param4()(evt,fsm,src,tgt));} \
  1946. template <class Event,class FSM,class STATE> \
  1947. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1948. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1949. typename state_action_result<Event,FSM,STATE>::type >::type \
  1950. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1951. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  1952. ,Param4()(evt,fsm,state));} }; \
  1953. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1954. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1955. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  1956. typename ::boost::is_same<Param5,void>::type,typename ::boost::mpl::not_< \
  1957. typename ::boost::is_same<Param6,void>::type>::type>::type >::type> \
  1958. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1959. template <class Event,class FSM,class STATE > struct state_action_result { \
  1960. typedef result_state type;} ; \
  1961. template <class EVT,class FSM,class SourceState,class TargetState> \
  1962. struct transition_action_result { typedef result_trans type;}; \
  1963. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1964. template <class EVT,class FSM,class SourceState,class TargetState> \
  1965. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1966. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1967. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1968. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1969. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  1970. ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
  1971. template <class Event,class FSM,class STATE> \
  1972. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1973. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1974. typename state_action_result<Event,FSM,STATE>::type >::type \
  1975. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1976. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  1977. ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
  1978. template <class Param1, class Param2, class Param3, class Param4, class Param5,class Param6> \
  1979. struct functor<Param1,Param2,Param3,Param4,Param5,Param6, \
  1980. typename ::boost::disable_if<typename ::boost::is_same<Param6,void>::type>::type> \
  1981. : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Param6> > { \
  1982. template <class Event,class FSM,class STATE > struct state_action_result { \
  1983. typedef result_state type;} ; \
  1984. template <class EVT,class FSM,class SourceState,class TargetState> \
  1985. struct transition_action_result { typedef result_trans type;}; \
  1986. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  1987. template <class EVT,class FSM,class SourceState,class TargetState> \
  1988. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1989. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  1990. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  1991. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  1992. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  1993. ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt),Param6()(evt,fsm,src,tgt));} \
  1994. template <class Event,class FSM,class STATE> \
  1995. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  1996. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  1997. typename state_action_result<Event,FSM,STATE>::type >::type \
  1998. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  1999. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  2000. ,Param4()(evt,fsm,state),Param5()(evt,fsm,state),Param6()(evt,fsm,state));} }; \
  2001. struct function_name ## tag{}; \
  2002. struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
  2003. functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
  2004. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5,class Arg6> \
  2005. struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5,Arg6> type;}; }; \
  2006. functor ## Helper const function_name = functor ## Helper ();
  2007. #else
  2008. #define BOOST_MSM_EUML_FUNCTION(functor,function,function_name,result_trans,result_state) \
  2009. template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
  2010. class Param5=void,class Enable=void > \
  2011. struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Enable> > {}; \
  2012. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2013. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2014. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2015. typename ::boost::is_same<Param1,void>::type,typename ::boost::mpl::not_< \
  2016. typename ::boost::is_same<Param2,void>::type>::type>::type >::type> \
  2017. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2018. template <class Event,class FSM,class STATE > struct state_action_result { \
  2019. typedef result_state type;} ; \
  2020. template <class EVT,class FSM,class SourceState,class TargetState> \
  2021. struct transition_action_result { typedef result_trans type;}; \
  2022. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2023. template <class EVT,class FSM,class SourceState,class TargetState> \
  2024. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2025. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2026. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2027. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2028. return function (Param1()(evt,fsm,src,tgt));} \
  2029. template <class Event,class FSM,class STATE> \
  2030. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2031. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2032. typename state_action_result<Event,FSM,STATE>::type >::type \
  2033. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2034. return function (Param1()(evt,fsm,state));} }; \
  2035. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2036. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2037. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2038. typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
  2039. typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
  2040. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2041. template <class Event,class FSM,class STATE > struct state_action_result { \
  2042. typedef result_state type;} ; \
  2043. template <class EVT,class FSM,class SourceState,class TargetState> \
  2044. struct transition_action_result { typedef result_trans type;}; \
  2045. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2046. template <class EVT,class FSM,class SourceState,class TargetState> \
  2047. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2048. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2049. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2050. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2051. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));} \
  2052. template <class Event,class FSM,class STATE> \
  2053. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2054. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2055. typename state_action_result<Event,FSM,STATE>::type >::type \
  2056. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2057. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state));} }; \
  2058. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2059. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2060. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2061. typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
  2062. typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
  2063. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2064. template <class Event,class FSM,class STATE > struct state_action_result { \
  2065. typedef result_state type;} ; \
  2066. template <class EVT,class FSM,class SourceState,class TargetState> \
  2067. struct transition_action_result { typedef result_trans type;}; \
  2068. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2069. template <class EVT,class FSM,class SourceState,class TargetState> \
  2070. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2071. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2072. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2073. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2074. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
  2075. template <class Event,class FSM,class STATE> \
  2076. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2077. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2078. typename state_action_result<Event,FSM,STATE>::type >::type \
  2079. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2080. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
  2081. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2082. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2083. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2084. typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
  2085. typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
  2086. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2087. template <class Event,class FSM,class STATE > struct state_action_result { \
  2088. typedef result_state type;} ; \
  2089. template <class EVT,class FSM,class SourceState,class TargetState> \
  2090. struct transition_action_result { typedef result_trans type;}; \
  2091. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2092. template <class EVT,class FSM,class SourceState,class TargetState> \
  2093. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2094. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2095. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2096. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2097. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  2098. ,Param4()(evt,fsm,src,tgt));} \
  2099. template <class Event,class FSM,class STATE> \
  2100. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2101. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2102. typename state_action_result<Event,FSM,STATE>::type >::type \
  2103. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2104. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  2105. ,Param4()(evt,fsm,state));} }; \
  2106. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2107. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2108. typename ::boost::disable_if<typename ::boost::is_same<Param5,void>::type>::type> \
  2109. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2110. template <class Event,class FSM,class STATE > struct state_action_result { \
  2111. typedef result_state type;} ; \
  2112. template <class EVT,class FSM,class SourceState,class TargetState> \
  2113. struct transition_action_result { typedef result_trans type;}; \
  2114. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2115. template <class EVT,class FSM,class SourceState,class TargetState> \
  2116. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2117. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2118. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2119. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2120. return function (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  2121. ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
  2122. template <class Event,class FSM,class STATE> \
  2123. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2124. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2125. typename state_action_result<Event,FSM,STATE>::type >::type \
  2126. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2127. return function (Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  2128. ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
  2129. struct function_name ## tag{}; \
  2130. struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
  2131. functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
  2132. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5> \
  2133. struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5> type;}; }; \
  2134. functor ## Helper const function_name = functor ## Helper ();
  2135. #define BOOST_MSM_EUML_METHOD(functor,function,function_name,result_trans,result_state) \
  2136. template <class Param1=void , class Param2=void , class Param3=void , class Param4=void, \
  2137. class Param5=void,class Enable=void > \
  2138. struct functor : euml_action<functor<Param1,Param2,Param3,Param4,Param5,Enable> > {}; \
  2139. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2140. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2141. typename ::boost::enable_if<typename ::boost::is_same<Param2,void>::type>::type> \
  2142. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2143. template <class Event,class FSM,class STATE > struct state_action_result { \
  2144. typedef result_state type;} ; \
  2145. template <class EVT,class FSM,class SourceState,class TargetState> \
  2146. struct transition_action_result { typedef result_trans type;}; \
  2147. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2148. template <class EVT,class FSM,class SourceState,class TargetState> \
  2149. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2150. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2151. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2152. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2153. return (Param1()(evt,fsm,src,tgt)).function();} \
  2154. template <class Event,class FSM,class STATE> \
  2155. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2156. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2157. typename state_action_result<Event,FSM,STATE>::type >::type \
  2158. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2159. return (Param1()(evt,fsm,state)).function();} }; \
  2160. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2161. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2162. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2163. typename ::boost::is_same<Param2,void>::type,typename ::boost::mpl::not_< \
  2164. typename ::boost::is_same<Param3,void>::type>::type>::type >::type> \
  2165. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2166. template <class Event,class FSM,class STATE > struct state_action_result { \
  2167. typedef result_state type;} ; \
  2168. template <class EVT,class FSM,class SourceState,class TargetState> \
  2169. struct transition_action_result { typedef result_trans type;}; \
  2170. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2171. template <class EVT,class FSM,class SourceState,class TargetState> \
  2172. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2173. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2174. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2175. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2176. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt));} \
  2177. template <class Event,class FSM,class STATE> \
  2178. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2179. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2180. typename state_action_result<Event,FSM,STATE>::type >::type \
  2181. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2182. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state));} }; \
  2183. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2184. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2185. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2186. typename ::boost::is_same<Param3,void>::type,typename ::boost::mpl::not_< \
  2187. typename ::boost::is_same<Param4,void>::type>::type>::type >::type> \
  2188. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2189. template <class Event,class FSM,class STATE > struct state_action_result { \
  2190. typedef result_state type;} ; \
  2191. template <class EVT,class FSM,class SourceState,class TargetState> \
  2192. struct transition_action_result { typedef result_trans type;}; \
  2193. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2194. template <class EVT,class FSM,class SourceState,class TargetState> \
  2195. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2196. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2197. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2198. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2199. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));} \
  2200. template <class Event,class FSM,class STATE> \
  2201. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2202. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2203. typename state_action_result<Event,FSM,STATE>::type >::type \
  2204. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2205. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state));} }; \
  2206. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2207. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2208. typename ::boost::disable_if<typename ::boost::mpl::or_< \
  2209. typename ::boost::is_same<Param4,void>::type,typename ::boost::mpl::not_< \
  2210. typename ::boost::is_same<Param5,void>::type>::type>::type >::type> \
  2211. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2212. template <class Event,class FSM,class STATE > struct state_action_result { \
  2213. typedef result_state type;} ; \
  2214. template <class EVT,class FSM,class SourceState,class TargetState> \
  2215. struct transition_action_result { typedef result_trans type;}; \
  2216. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2217. template <class EVT,class FSM,class SourceState,class TargetState> \
  2218. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2219. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2220. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2221. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2222. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  2223. ,Param4()(evt,fsm,src,tgt));} \
  2224. template <class Event,class FSM,class STATE> \
  2225. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2226. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2227. typename state_action_result<Event,FSM,STATE>::type >::type \
  2228. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2229. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  2230. ,Param4()(evt,fsm,state));} }; \
  2231. template <class Param1, class Param2, class Param3, class Param4, class Param5> \
  2232. struct functor<Param1,Param2,Param3,Param4,Param5, \
  2233. typename ::boost::disable_if<typename ::boost::is_same<Param5,void>::type>::type> \
  2234. : euml_action<functor<Param1,Param2,Param3,Param4,Param5> > { \
  2235. template <class Event,class FSM,class STATE > struct state_action_result { \
  2236. typedef result_state type;} ; \
  2237. template <class EVT,class FSM,class SourceState,class TargetState> \
  2238. struct transition_action_result { typedef result_trans type;}; \
  2239. typedef ::boost::mpl::set<boost::msm::front::state_action_tag,boost::msm::front::action_tag> tag_type; \
  2240. template <class EVT,class FSM,class SourceState,class TargetState> \
  2241. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2242. typename Param1::tag_type,boost::msm::front::action_tag>::type, \
  2243. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type \
  2244. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const { \
  2245. return (Param1()(evt,fsm,src,tgt)).function(Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt) \
  2246. ,Param4()(evt,fsm,src,tgt),Param5()(evt,fsm,src,tgt));} \
  2247. template <class Event,class FSM,class STATE> \
  2248. typename ::boost::enable_if<typename ::boost::mpl::has_key< \
  2249. typename Param1::tag_type,boost::msm::front::state_action_tag>::type, \
  2250. typename state_action_result<Event,FSM,STATE>::type >::type \
  2251. operator()(Event const& evt,FSM& fsm,STATE& state )const { \
  2252. return (Param1()(evt,fsm,state)).function(Param2()(evt,fsm,state),Param3()(evt,fsm,state) \
  2253. ,Param4()(evt,fsm,state),Param5()(evt,fsm,state));} }; \
  2254. struct function_name ## tag{}; \
  2255. struct functor ## Helper : proto::extends< proto::terminal< function_name ## tag >::type, \
  2256. functor ## Helper , boost::msm::sm_domain> { functor ## Helper(){} \
  2257. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5> \
  2258. struct In {typedef functor <Arg1,Arg2,Arg3,Arg4,Arg5> type;}; }; \
  2259. functor ## Helper const function_name = functor ## Helper ();
  2260. #endif
  2261. #define RESULT_TYPE2_PARAM1 typename get_result_type2<Param1,Event,FSM,STATE>::type
  2262. #define RESULT_TYPE_PARAM1 typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type
  2263. #define RESULT_TYPE2_PARAM2 typename get_result_type2<Param2,Event,FSM,STATE>::type
  2264. #define RESULT_TYPE_PARAM2 typename get_result_type<Param2,EVT,FSM,SourceState,TargetState>::type
  2265. #define RESULT_TYPE2_PARAM3 typename get_result_type2<Param3,Event,FSM,STATE>::type
  2266. #define RESULT_TYPE_PARAM3 typename get_result_type<Param3,EVT,FSM,SourceState,TargetState>::type
  2267. #define RESULT_TYPE2_PARAM4 typename get_result_type2<Param4,Event,FSM,STATE>::type
  2268. #define RESULT_TYPE_PARAM4 typename get_result_type<Param4,EVT,FSM,SourceState,TargetState>::type
  2269. #define RESULT_TYPE2_PARAM5 typename get_result_type2<Param5,Event,FSM,STATE>::type
  2270. #define RESULT_TYPE_PARAM5 typename get_result_type<Param5,EVT,FSM,SourceState,TargetState>::type
  2271. #define RESULT_TYPE2_PARAM6 typename get_result_type2<Param6,Event,FSM,STATE>::type
  2272. #define RESULT_TYPE_PARAM6 typename get_result_type<Param6,EVT,FSM,SourceState,TargetState>::type
  2273. #define RESULT_TYPE2_DIFF_TYPE_ITER_TRAITS_PARAM1 typename std::iterator_traits<typename get_result_type2<Param1,Event,FSM,STATE>::type>::difference_type
  2274. #define RESULT_TYPE_DIFF_TYPE_ITER_TRAITS_PARAM1 typename std::iterator_traits<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::difference_type
  2275. #define RESULT_TYPE2_REMOVE_REF_PARAM1 typename ::boost::remove_reference<typename get_result_type2<Param1,Event,FSM,STATE>::type>::type
  2276. #define RESULT_TYPE_REMOVE_REF_PARAM1 typename ::boost::remove_reference<typename get_result_type<Param1,EVT,FSM,SourceState,TargetState>::type>::type
  2277. #define RESULT_TYPE2_PAIR_REMOVE_REF_PARAM1 std::pair<RESULT_TYPE2_REMOVE_REF_PARAM1,RESULT_TYPE2_REMOVE_REF_PARAM1>
  2278. #define RESULT_TYPE_PAIR_REMOVE_REF_PARAM1 std::pair<RESULT_TYPE_REMOVE_REF_PARAM1,RESULT_TYPE_REMOVE_REF_PARAM1>
  2279. #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
  2280. #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
  2281. #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
  2282. #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
  2283. #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
  2284. #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
  2285. #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
  2286. #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
  2287. #define BOOST_MSM_EUML_ACTION(instance_name) \
  2288. struct instance_name ## _impl; \
  2289. struct instance_name ## _helper : boost::msm::front::euml::euml_action<instance_name ## _impl> \
  2290. { \
  2291. instance_name ## _helper(){} \
  2292. typedef instance_name ## _impl action_name; \
  2293. }; \
  2294. static instance_name ## _helper instance_name; \
  2295. struct instance_name ## _impl : instance_name ## _helper
  2296. #define BOOST_MSM_EUML_DECLARE_ACTION(instance_name) \
  2297. struct instance_name ; \
  2298. struct instance_name ## _helper : boost::msm::front::euml::euml_action<instance_name > \
  2299. { \
  2300. instance_name ## _helper(){} \
  2301. typedef instance_name action_name; \
  2302. }; \
  2303. struct instance_name : instance_name ## _helper
  2304. #define BOOST_MSM_EUML_EVENT(instance_name) \
  2305. struct instance_name ## _helper : boost::msm::front::euml::euml_event<instance_name ## _helper>{ \
  2306. instance_name ## _helper(){} \
  2307. instance_name ## _helper const& operator()() const {return *this;} }; \
  2308. static instance_name ## _helper instance_name;
  2309. // an event matching any event
  2310. struct kleene_ : boost::msm::front::euml::euml_event<kleene_>, public boost::any
  2311. {
  2312. kleene_() : boost::any(){}
  2313. template<typename ValueType>
  2314. kleene_(const ValueType & v) : boost::any(v){}
  2315. };
  2316. static kleene_ kleene;
  2317. #define BOOST_MSM_EUML_DECLARE_EVENT(instance_name) \
  2318. struct instance_name : boost::msm::front::euml::euml_event<instance_name >{ \
  2319. instance_name(){} \
  2320. instance_name const& operator()() const {return *this;} };
  2321. #define MSM_EUML_CONCAT(param1,param2) param1
  2322. #define MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1(z, n, unused) ARG ## n arg ## n
  2323. #define MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE2(z, n, unused) arg ## n
  2324. #define MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP_ENTRY(z, n, unused) \
  2325. typename boost::fusion::result_of::first< \
  2326. typename ::boost::remove_reference< \
  2327. typename boost::fusion::result_of::at_c<T, BOOST_PP_CAT( , n)>::type>::type>::type \
  2328. #define MSM_EUML_EVENT_HELPER_GET_ATTRIBUTE(z, n, unused) \
  2329. get_attribute( \
  2330. typename boost::fusion::result_of::first< \
  2331. typename ::boost::remove_reference< \
  2332. typename boost::fusion::result_of::at_c<T, n>::type>::type>::type())=arg ## n;
  2333. #define MSM_EUML_EVENT_HELPER_CONSTRUCTORS(z, n, mytuple) \
  2334. template <BOOST_PP_ENUM_PARAMS(n, class ARG)> \
  2335. BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, mytuple) , _helper)(BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1, ~ )): \
  2336. BOOST_PP_TUPLE_ELEM(2, 1, mytuple)(){ \
  2337. init(BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE2, ~ ),attribute_vec());}
  2338. #define MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP(z, n, unused) \
  2339. template <BOOST_PP_ENUM_PARAMS(n, class ARG),class T> \
  2340. void init(BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1, ~ ), \
  2341. 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) \
  2342. { \
  2343. BOOST_PP_REPEAT_FROM_TO(0,n , \
  2344. MSM_EUML_EVENT_HELPER_GET_ATTRIBUTE, ~) \
  2345. }
  2346. #define MSM_EUML_EVENT_INSTANCE_HELPER_OPERATOR_IMPL(z, n, instance) \
  2347. template <BOOST_PP_ENUM_PARAMS(n, class ARG)> \
  2348. BOOST_PP_CAT(instance,_helper) operator() \
  2349. (BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE1, ~ ))const{ \
  2350. return BOOST_PP_CAT(instance,_helper) (BOOST_PP_ENUM(n, MSM_EUML_EVENT_INSTANCE_HELPER_EXECUTE2, ~ ));}
  2351. #if defined(FUSION_MAX_MAP_SIZE)
  2352. #define BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(instance_name, attributes_name) \
  2353. struct instance_name ## _helper : \
  2354. boost::msm::front::euml::euml_event<instance_name ## _helper> , public attributes_name \
  2355. { \
  2356. template <class T,int checked_size> struct size_helper \
  2357. { \
  2358. typedef typename ::boost::mpl::less_equal< \
  2359. typename ::boost::fusion::result_of::size<T>::type, \
  2360. ::boost::mpl::int_<checked_size> >::type type; \
  2361. }; \
  2362. BOOST_PP_CAT(instance_name,_helper()) : attributes_name(){} \
  2363. typedef attributes_name::attributes_type attribute_map; \
  2364. typedef ::boost::fusion::result_of::as_vector<attribute_map>::type attribute_vec; \
  2365. BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(FUSION_MAX_MAP_SIZE ,1), \
  2366. MSM_EUML_EVENT_HELPER_CONSTRUCTORS, (instance_name,attributes_name)) \
  2367. BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(FUSION_MAX_MAP_SIZE ,1), \
  2368. MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP, ~) \
  2369. BOOST_PP_CAT(instance_name,_helper) operator()(){ \
  2370. return BOOST_PP_CAT(instance_name,_helper)();} \
  2371. BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(FUSION_MAX_MAP_SIZE ,1), \
  2372. MSM_EUML_EVENT_INSTANCE_HELPER_OPERATOR_IMPL, instance_name) \
  2373. }; \
  2374. static instance_name ## _helper instance_name;
  2375. #else
  2376. #define BOOST_MSM_EUML_EVENT_WITH_ATTRIBUTES(instance_name, attributes_name) \
  2377. struct instance_name ## _helper : \
  2378. boost::msm::front::euml::euml_event<instance_name ## _helper> , public attributes_name \
  2379. { \
  2380. template <class T,int checked_size> struct size_helper \
  2381. { \
  2382. typedef typename ::boost::mpl::less_equal< \
  2383. typename ::boost::fusion::result_of::size<T>::type, \
  2384. ::boost::mpl::int_<checked_size> >::type type; \
  2385. }; \
  2386. BOOST_PP_CAT(instance_name,_helper()) : attributes_name(){} \
  2387. typedef attributes_name::attributes_type attribute_map; \
  2388. typedef ::boost::fusion::result_of::as_vector<attribute_map>::type attribute_vec; \
  2389. BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(10 ,1), \
  2390. MSM_EUML_EVENT_HELPER_CONSTRUCTORS, (instance_name,attributes_name)) \
  2391. BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(10 ,1), \
  2392. MSM_EUML_EVENT_INSTANCE_HELPER_ATTRIBUTE_MAP, ~) \
  2393. BOOST_PP_CAT(instance_name,_helper) operator()(){ \
  2394. return BOOST_PP_CAT(instance_name,_helper)();} \
  2395. BOOST_PP_REPEAT_FROM_TO(1,BOOST_PP_ADD(10 ,1), \
  2396. MSM_EUML_EVENT_INSTANCE_HELPER_OPERATOR_IMPL, instance_name) \
  2397. }; \
  2398. static instance_name ## _helper instance_name;
  2399. #endif
  2400. #define BOOST_MSM_EUML_EVENT_NAME(instance_name) instance_name ## _helper
  2401. #define BOOST_MSM_EUML_FLAG_NAME(instance_name) instance_name ## _helper
  2402. #define BOOST_MSM_EUML_FLAG(instance_name) \
  2403. struct instance_name ## _helper : boost::msm::front::euml::euml_flag<instance_name ## _helper>{}; \
  2404. static instance_name ## _helper instance_name;
  2405. #define BOOST_MSM_EUML_DECLARE_FLAG(instance_name) \
  2406. struct instance_name : boost::msm::front::euml::euml_flag<instance_name >{};
  2407. #define BOOST_MSM_EUML_STATE_NAME(instance_name) instance_name ## _helper
  2408. #define BOOST_MSM_EUML_BUILD_STT_HELPER build_stt(
  2409. #define BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER build_internal_stt(
  2410. #define BOOST_MSM_EUML_BUILD_STT_HELPER2(expr) expr)
  2411. #define BOOST_MSM_EUML_ENTRY_STATE_HELPER(expr) ,expr
  2412. #define BOOST_MSM_EUML_ATTRIBUTES(expr,instance_name) \
  2413. typedef BOOST_TYPEOF(build_attributes expr) instance_name;
  2414. // following macros declare a state type but do not create an instance
  2415. #define BOOST_MSM_EUML_DECLARE_STATE(expr,instance_name) \
  2416. struct instance_name ## tag{}; \
  2417. typedef BOOST_TYPEOF(build_state<instance_name ## tag> expr) instance_name;
  2418. #define BOOST_MSM_EUML_DECLARE_INTERRUPT_STATE(expr,instance_name) \
  2419. struct instance_name ## tag{}; \
  2420. typedef BOOST_TYPEOF(build_interrupt_state<instance_name ## tag> expr) instance_name;
  2421. #define BOOST_MSM_EUML_DECLARE_TERMINATE_STATE(expr,instance_name) \
  2422. struct instance_name ## tag{}; \
  2423. typedef BOOST_TYPEOF(build_terminate_state<instance_name ## tag> expr) instance_name;
  2424. #define BOOST_MSM_EUML_DECLARE_EXPLICIT_ENTRY_STATE(region,expr,instance_name) \
  2425. struct instance_name ## tag{}; \
  2426. typedef BOOST_TYPEOF(build_explicit_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name;
  2427. #define BOOST_MSM_EUML_DECLARE_ENTRY_STATE(region,expr,instance_name) \
  2428. struct instance_name ## tag{}; \
  2429. typedef BOOST_TYPEOF(build_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name;
  2430. #define BOOST_MSM_EUML_DECLARE_EXIT_STATE(expr,instance_name) \
  2431. struct instance_name ## tag{}; \
  2432. typedef BOOST_TYPEOF(build_exit_state<instance_name ## tag> expr) instance_name;
  2433. #define BOOST_MSM_EUML_DECLARE_STATE_MACHINE(expr,instance_name) \
  2434. struct instance_name ## tag{}; \
  2435. typedef BOOST_TYPEOF(build_sm<instance_name ## tag> expr) instance_name;
  2436. #define BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE(expr,instance_name) \
  2437. typedef int using_declared_table; \
  2438. typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name;
  2439. #define BOOST_MSM_EUML_DECLARE_INTERNAL_TRANSITION_TABLE(expr) \
  2440. typedef BOOST_TYPEOF( \
  2441. BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) internal_transition_table;
  2442. // following macros declare a state type and create an instance
  2443. #define BOOST_MSM_EUML_STATE(expr,instance_name) \
  2444. struct instance_name ## tag{}; \
  2445. typedef BOOST_TYPEOF(build_state<instance_name ## tag> expr) instance_name ## _helper; \
  2446. static instance_name ## _helper instance_name;
  2447. #define BOOST_MSM_EUML_INTERRUPT_STATE(expr,instance_name) \
  2448. struct instance_name ## tag{}; \
  2449. typedef BOOST_TYPEOF(build_interrupt_state<instance_name ## tag> expr) instance_name ## _helper; \
  2450. static instance_name ## _helper instance_name;
  2451. #define BOOST_MSM_EUML_TERMINATE_STATE(expr,instance_name) \
  2452. struct instance_name ## tag{}; \
  2453. typedef BOOST_TYPEOF(build_terminate_state<instance_name ## tag> expr) instance_name ## _helper; \
  2454. static instance_name ## _helper instance_name;
  2455. #define BOOST_MSM_EUML_EXPLICIT_ENTRY_STATE(region,expr,instance_name) \
  2456. struct instance_name ## tag{}; \
  2457. typedef BOOST_TYPEOF(build_explicit_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name ## _helper; \
  2458. static instance_name ## _helper instance_name;
  2459. #define BOOST_MSM_EUML_ENTRY_STATE(region,expr,instance_name) \
  2460. struct instance_name ## tag{}; \
  2461. typedef BOOST_TYPEOF(build_entry_state<instance_name ## tag BOOST_MSM_EUML_ENTRY_STATE_HELPER(region) > expr) instance_name ## _helper; \
  2462. static instance_name ## _helper instance_name;
  2463. #define BOOST_MSM_EUML_EXIT_STATE(expr,instance_name) \
  2464. struct instance_name ## tag{}; \
  2465. typedef BOOST_TYPEOF(build_exit_state<instance_name ## tag> expr) instance_name ## _helper; \
  2466. static instance_name ## _helper instance_name;
  2467. #ifndef BOOST_MSVC
  2468. #define BOOST_MSM_EUML_TRANSITION_TABLE(expr,instance_name) \
  2469. typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name ## _def; \
  2470. struct instance_name ## _helper : public instance_name ## _def{instance_name ## _helper(){}}; \
  2471. static instance_name ## _helper instance_name;
  2472. #define BOOST_MSM_EUML_INTERNAL_TRANSITION_TABLE(expr,instance_name) \
  2473. typedef BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) instance_name ## _def; \
  2474. struct instance_name ## _helper : public instance_name ## _def{instance_name ## _helper(){}}; \
  2475. static instance_name ## _helper instance_name;
  2476. #else
  2477. #define BOOST_MSM_EUML_TRANSITION_TABLE(expr,instance_name) \
  2478. struct instance_name ## _helper : \
  2479. public BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) \
  2480. {instance_name ## _helper(){}} ; \
  2481. static instance_name ## _helper instance_name;
  2482. #define BOOST_MSM_EUML_INTERNAL_TRANSITION_TABLE(expr,instance_name) \
  2483. struct instance_name ## _helper : \
  2484. public BOOST_TYPEOF(BOOST_MSM_EUML_BUILD_INTERNAL_STT_HELPER BOOST_MSM_EUML_BUILD_STT_HELPER2(expr)) \
  2485. {instance_name ## _helper(){}} ; \
  2486. static instance_name ## _helper instance_name;
  2487. #endif
  2488. }}}} // boost::msm::front::euml
  2489. namespace boost { namespace msm{
  2490. template<>
  2491. struct is_kleene_event< boost::msm::front::euml::kleene_ >
  2492. {
  2493. typedef ::boost::mpl::true_ type;
  2494. };
  2495. }}
  2496. #endif // BOOST_MSM_FRONT_EUML_COMMON_H