container.hpp 152 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068
  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_CONTAINER_H
  11. #define BOOST_MSM_FRONT_EUML_CONTAINER_H
  12. #include <utility>
  13. #include <boost/msm/front/euml/common.hpp>
  14. #include <boost/utility/enable_if.hpp>
  15. #include <boost/mpl/has_key.hpp>
  16. #include <boost/mpl/set.hpp>
  17. #include <boost/mpl/not.hpp>
  18. #include <boost/msm/front/euml/operator.hpp>
  19. #include <boost/type_traits.hpp>
  20. BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator_category)
  21. namespace boost { namespace msm { namespace front { namespace euml
  22. {
  23. template <class T>
  24. struct Front_ : euml_action<Front_<T> >
  25. {
  26. template <class Event,class FSM,class STATE >
  27. struct state_action_result
  28. {
  29. typedef typename get_reference<
  30. typename ::boost::remove_reference<
  31. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  32. };
  33. template <class EVT,class FSM,class SourceState,class TargetState>
  34. struct transition_action_result
  35. {
  36. typedef typename get_reference<
  37. typename ::boost::remove_reference<
  38. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  39. };
  40. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  41. template <class EVT,class FSM,class SourceState,class TargetState>
  42. typename ::boost::enable_if<
  43. typename ::boost::mpl::has_key<
  44. typename T::tag_type,action_tag>::type,
  45. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  46. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  47. {
  48. return (T()(evt,fsm,src,tgt)).front();
  49. }
  50. template <class Event,class FSM,class STATE>
  51. typename ::boost::enable_if<
  52. typename ::boost::mpl::has_key<
  53. typename T::tag_type,state_action_tag>::type,
  54. typename state_action_result<Event,FSM,STATE>::type >::type
  55. operator()(Event const& evt,FSM& fsm,STATE& state )const
  56. {
  57. return (T()(evt,fsm,state)).front();
  58. }
  59. };
  60. struct front_tag {};
  61. struct Front_Helper: proto::extends< proto::terminal<front_tag>::type, Front_Helper, boost::msm::sm_domain>
  62. {
  63. Front_Helper(){}
  64. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  65. #ifdef BOOST_MSVC
  66. ,class Arg6
  67. #endif
  68. >
  69. struct In
  70. {
  71. typedef Front_<Arg1> type;
  72. };
  73. };
  74. Front_Helper const front_;
  75. template <class T>
  76. struct Back_ : euml_action<Back_<T> >
  77. {
  78. template <class Event,class FSM,class STATE >
  79. struct state_action_result
  80. {
  81. typedef typename get_reference<
  82. typename ::boost::remove_reference<
  83. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  84. };
  85. template <class EVT,class FSM,class SourceState,class TargetState>
  86. struct transition_action_result
  87. {
  88. typedef typename get_reference<
  89. typename ::boost::remove_reference<
  90. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  91. };
  92. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  93. template <class EVT,class FSM,class SourceState,class TargetState>
  94. typename ::boost::enable_if<
  95. typename ::boost::mpl::has_key<
  96. typename T::tag_type,action_tag>::type,
  97. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  98. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  99. {
  100. return (T()(evt,fsm,src,tgt)).back();
  101. }
  102. template <class Event,class FSM,class STATE>
  103. typename ::boost::enable_if<
  104. typename ::boost::mpl::has_key<
  105. typename T::tag_type,state_action_tag>::type,
  106. typename state_action_result<Event,FSM,STATE>::type >::type
  107. operator()(Event const& evt,FSM& fsm,STATE& state )const
  108. {
  109. return (T()(evt,fsm,state)).back();
  110. }
  111. };
  112. struct back_tag {};
  113. struct Back_Helper: proto::extends< proto::terminal<back_tag>::type, Back_Helper, boost::msm::sm_domain>
  114. {
  115. Back_Helper(){}
  116. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  117. #ifdef BOOST_MSVC
  118. ,class Arg6
  119. #endif
  120. >
  121. struct In
  122. {
  123. typedef Back_<Arg1> type;
  124. };
  125. };
  126. Back_Helper const back_;
  127. template <class T>
  128. struct Begin_ : euml_action<Begin_<T> >
  129. {
  130. template <class Event,class FSM,class STATE >
  131. struct state_action_result
  132. {
  133. typedef typename get_iterator<
  134. typename ::boost::remove_reference<
  135. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  136. };
  137. template <class EVT,class FSM,class SourceState,class TargetState>
  138. struct transition_action_result
  139. {
  140. typedef typename get_iterator<
  141. typename ::boost::remove_reference<
  142. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  143. };
  144. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  145. template <class EVT,class FSM,class SourceState,class TargetState>
  146. typename ::boost::enable_if<
  147. typename ::boost::mpl::has_key<
  148. typename T::tag_type,action_tag>::type,
  149. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  150. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  151. {
  152. return (T()(evt,fsm,src,tgt)).begin();
  153. }
  154. template <class Event,class FSM,class STATE>
  155. typename ::boost::enable_if<
  156. typename ::boost::mpl::has_key<
  157. typename T::tag_type,state_action_tag>::type,
  158. typename state_action_result<Event,FSM,STATE>::type >::type
  159. operator()(Event const& evt,FSM& fsm,STATE& state )const
  160. {
  161. return (T()(evt,fsm,state)).begin();
  162. }
  163. };
  164. struct begin_tag {};
  165. struct Begin_Helper: proto::extends< proto::terminal<begin_tag>::type, Begin_Helper, boost::msm::sm_domain>
  166. {
  167. Begin_Helper(){}
  168. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  169. #ifdef BOOST_MSVC
  170. ,class Arg6
  171. #endif
  172. >
  173. struct In
  174. {
  175. typedef Begin_<Arg1> type;
  176. };
  177. };
  178. Begin_Helper const begin_;
  179. template <class T>
  180. struct End_ : euml_action<End_<T> >
  181. {
  182. template <class Event,class FSM,class STATE >
  183. struct state_action_result
  184. {
  185. typedef typename get_iterator<
  186. typename ::boost::remove_reference<
  187. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  188. };
  189. template <class EVT,class FSM,class SourceState,class TargetState>
  190. struct transition_action_result
  191. {
  192. typedef typename get_iterator<
  193. typename ::boost::remove_reference<
  194. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  195. };
  196. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  197. template <class EVT,class FSM,class SourceState,class TargetState>
  198. typename ::boost::enable_if<
  199. typename ::boost::mpl::has_key<
  200. typename T::tag_type,action_tag>::type,
  201. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  202. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  203. {
  204. return (T()(evt,fsm,src,tgt)).end();
  205. }
  206. template <class Event,class FSM,class STATE>
  207. typename ::boost::enable_if<
  208. typename ::boost::mpl::has_key<
  209. typename T::tag_type,state_action_tag>::type,
  210. typename state_action_result<Event,FSM,STATE>::type >::type
  211. operator()(Event const& evt,FSM& fsm,STATE& state )const
  212. {
  213. return (T()(evt,fsm,state)).end();
  214. }
  215. };
  216. struct end_tag {};
  217. struct End_Helper: proto::extends< proto::terminal<end_tag>::type, End_Helper, boost::msm::sm_domain>
  218. {
  219. End_Helper(){}
  220. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  221. #ifdef BOOST_MSVC
  222. ,class Arg6
  223. #endif
  224. >
  225. struct In
  226. {
  227. typedef End_<Arg1> type;
  228. };
  229. };
  230. End_Helper const end_;
  231. template <class T>
  232. struct RBegin_ : euml_action<RBegin_<T> >
  233. {
  234. template <class Event,class FSM,class STATE >
  235. struct state_action_result
  236. {
  237. typedef typename get_reverse_iterator<
  238. typename ::boost::remove_reference<
  239. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  240. };
  241. template <class EVT,class FSM,class SourceState,class TargetState>
  242. struct transition_action_result
  243. {
  244. typedef typename get_reverse_iterator<
  245. typename ::boost::remove_reference<
  246. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  247. };
  248. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  249. template <class EVT,class FSM,class SourceState,class TargetState>
  250. typename ::boost::enable_if<
  251. typename ::boost::mpl::has_key<
  252. typename T::tag_type,action_tag>::type,
  253. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  254. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  255. {
  256. return (T()(evt,fsm,src,tgt)).rbegin();
  257. }
  258. template <class Event,class FSM,class STATE>
  259. typename ::boost::enable_if<
  260. typename ::boost::mpl::has_key<
  261. typename T::tag_type,state_action_tag>::type,
  262. typename state_action_result<Event,FSM,STATE>::type >::type
  263. operator()(Event const& evt,FSM& fsm,STATE& state )const
  264. {
  265. return (T()(evt,fsm,state)).rbegin();
  266. }
  267. };
  268. struct rbegin_tag {};
  269. struct RBegin_Helper: proto::extends< proto::terminal<rbegin_tag>::type, RBegin_Helper, boost::msm::sm_domain>
  270. {
  271. RBegin_Helper(){}
  272. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  273. #ifdef BOOST_MSVC
  274. ,class Arg6
  275. #endif
  276. >
  277. struct In
  278. {
  279. typedef RBegin_<Arg1> type;
  280. };
  281. };
  282. RBegin_Helper const rbegin_;
  283. template <class T>
  284. struct REnd_ : euml_action<REnd_<T> >
  285. {
  286. template <class Event,class FSM,class STATE >
  287. struct state_action_result
  288. {
  289. typedef typename get_reverse_iterator<
  290. typename ::boost::remove_reference<
  291. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  292. };
  293. template <class EVT,class FSM,class SourceState,class TargetState>
  294. struct transition_action_result
  295. {
  296. typedef typename get_reverse_iterator<
  297. typename ::boost::remove_reference<
  298. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  299. };
  300. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  301. template <class EVT,class FSM,class SourceState,class TargetState>
  302. typename ::boost::enable_if<
  303. typename ::boost::mpl::has_key<
  304. typename T::tag_type,action_tag>::type,
  305. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  306. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  307. {
  308. return (T()(evt,fsm,src,tgt)).rend();
  309. }
  310. template <class Event,class FSM,class STATE>
  311. typename ::boost::enable_if<
  312. typename ::boost::mpl::has_key<
  313. typename T::tag_type,state_action_tag>::type,
  314. typename state_action_result<Event,FSM,STATE>::type >::type
  315. operator()(Event const& evt,FSM& fsm,STATE& state )const
  316. {
  317. return (T()(evt,fsm,state)).rend();
  318. }
  319. };
  320. struct rend_tag {};
  321. struct REnd_Helper: proto::extends< proto::terminal<rend_tag>::type, REnd_Helper, boost::msm::sm_domain>
  322. {
  323. REnd_Helper(){}
  324. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  325. #ifdef BOOST_MSVC
  326. ,class Arg6
  327. #endif
  328. >
  329. struct In
  330. {
  331. typedef REnd_<Arg1> type;
  332. };
  333. };
  334. REnd_Helper const rend_;
  335. template <class Container,class Element>
  336. struct Push_Back_ : euml_action<Push_Back_<Container,Element> >
  337. {
  338. template <class Event,class FSM,class STATE >
  339. struct state_action_result
  340. {
  341. typedef void type;
  342. };
  343. template <class EVT,class FSM,class SourceState,class TargetState>
  344. struct transition_action_result
  345. {
  346. typedef void type;
  347. };
  348. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  349. template <class EVT,class FSM,class SourceState,class TargetState>
  350. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  351. {
  352. (Container()(evt,fsm,src,tgt)).push_back(Element()(evt,fsm,src,tgt));
  353. }
  354. template <class Event,class FSM,class STATE>
  355. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  356. {
  357. (Container()(evt,fsm,state)).push_back(Element()(evt,fsm,state));
  358. }
  359. };
  360. struct push_back_tag {};
  361. struct Push_Back_Helper: proto::extends< proto::terminal<push_back_tag>::type, Push_Back_Helper, boost::msm::sm_domain>
  362. {
  363. Push_Back_Helper(){}
  364. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  365. #ifdef BOOST_MSVC
  366. ,class Arg6
  367. #endif
  368. >
  369. struct In
  370. {
  371. typedef Push_Back_<Arg1,Arg2> type;
  372. };
  373. };
  374. Push_Back_Helper const push_back_;
  375. template <class Container>
  376. struct Pop_Back_ : euml_action<Pop_Back_<Container> >
  377. {
  378. template <class Event,class FSM,class STATE >
  379. struct state_action_result
  380. {
  381. typedef void type;
  382. };
  383. template <class EVT,class FSM,class SourceState,class TargetState>
  384. struct transition_action_result
  385. {
  386. typedef void type;
  387. };
  388. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  389. template <class EVT,class FSM,class SourceState,class TargetState>
  390. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  391. {
  392. (Container()(evt,fsm,src,tgt)).pop_back();
  393. }
  394. template <class Event,class FSM,class STATE>
  395. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  396. {
  397. (Container()(evt,fsm,state)).pop_back();
  398. }
  399. };
  400. struct pop_back_tag {};
  401. struct Pop_Back_Helper: proto::extends< proto::terminal<pop_back_tag>::type, Pop_Back_Helper, boost::msm::sm_domain>
  402. {
  403. Pop_Back_Helper(){}
  404. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  405. #ifdef BOOST_MSVC
  406. ,class Arg6
  407. #endif
  408. >
  409. struct In
  410. {
  411. typedef Pop_Back_<Arg1> type;
  412. };
  413. };
  414. Pop_Back_Helper const pop_back_;
  415. template <class Container,class Element>
  416. struct Push_Front_ : euml_action<Push_Front_<Container,Element> >
  417. {
  418. template <class Event,class FSM,class STATE >
  419. struct state_action_result
  420. {
  421. typedef void type;
  422. };
  423. template <class EVT,class FSM,class SourceState,class TargetState>
  424. struct transition_action_result
  425. {
  426. typedef void type;
  427. };
  428. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  429. template <class EVT,class FSM,class SourceState,class TargetState>
  430. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  431. {
  432. (Container()(evt,fsm,src,tgt)).push_front(Element()(evt,fsm,src,tgt));
  433. }
  434. template <class Event,class FSM,class STATE>
  435. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  436. {
  437. (Container()(evt,fsm,state)).push_front(Element()(evt,fsm,state));
  438. }
  439. };
  440. struct push_front_tag {};
  441. struct Push_Front_Helper: proto::extends< proto::terminal<push_front_tag>::type, Push_Front_Helper, boost::msm::sm_domain>
  442. {
  443. Push_Front_Helper(){}
  444. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  445. #ifdef BOOST_MSVC
  446. ,class Arg6
  447. #endif
  448. >
  449. struct In
  450. {
  451. typedef Push_Front_<Arg1,Arg2> type;
  452. };
  453. };
  454. Push_Front_Helper const push_front_;
  455. template <class Container>
  456. struct Pop_Front_ : euml_action<Pop_Front_<Container> >
  457. {
  458. template <class Event,class FSM,class STATE >
  459. struct state_action_result
  460. {
  461. typedef void type;
  462. };
  463. template <class EVT,class FSM,class SourceState,class TargetState>
  464. struct transition_action_result
  465. {
  466. typedef void type;
  467. };
  468. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  469. template <class EVT,class FSM,class SourceState,class TargetState>
  470. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  471. {
  472. (Container()(evt,fsm,src,tgt)).pop_front();
  473. }
  474. template <class Event,class FSM,class STATE>
  475. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  476. {
  477. (Container()(evt,fsm,state)).pop_front();
  478. }
  479. };
  480. struct pop_front_tag {};
  481. struct Pop_Front_Helper: proto::extends< proto::terminal<pop_front_tag>::type, Pop_Front_Helper, boost::msm::sm_domain>
  482. {
  483. Pop_Front_Helper(){}
  484. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  485. #ifdef BOOST_MSVC
  486. ,class Arg6
  487. #endif
  488. >
  489. struct In
  490. {
  491. typedef Pop_Front_<Arg1> type;
  492. };
  493. };
  494. Pop_Front_Helper const pop_front_;
  495. template <class Container>
  496. struct Clear_ : euml_action<Clear_<Container> >
  497. {
  498. template <class Event,class FSM,class STATE >
  499. struct state_action_result
  500. {
  501. typedef void type;
  502. };
  503. template <class EVT,class FSM,class SourceState,class TargetState>
  504. struct transition_action_result
  505. {
  506. typedef void type;
  507. };
  508. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  509. template <class EVT,class FSM,class SourceState,class TargetState>
  510. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  511. {
  512. (Container()(evt,fsm,src,tgt)).clear();
  513. }
  514. template <class Event,class FSM,class STATE>
  515. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  516. {
  517. (Container()(evt,fsm,state)).clear();
  518. }
  519. };
  520. struct clear_tag {};
  521. struct Clear_Helper: proto::extends< proto::terminal<clear_tag>::type, Clear_Helper, boost::msm::sm_domain>
  522. {
  523. Clear_Helper(){}
  524. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  525. #ifdef BOOST_MSVC
  526. ,class Arg6
  527. #endif
  528. >
  529. struct In
  530. {
  531. typedef Clear_<Arg1> type;
  532. };
  533. };
  534. Clear_Helper const clear_;
  535. template <class Container>
  536. struct ListReverse_ : euml_action<ListReverse_<Container> >
  537. {
  538. template <class Event,class FSM,class STATE >
  539. struct state_action_result
  540. {
  541. typedef void type;
  542. };
  543. template <class EVT,class FSM,class SourceState,class TargetState>
  544. struct transition_action_result
  545. {
  546. typedef void type;
  547. };
  548. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  549. template <class EVT,class FSM,class SourceState,class TargetState>
  550. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  551. {
  552. (Container()(evt,fsm,src,tgt)).reverse();
  553. }
  554. template <class Event,class FSM,class STATE>
  555. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  556. {
  557. (Container()(evt,fsm,state)).reverse();
  558. }
  559. };
  560. struct list_reverse_tag {};
  561. struct ListReverse_Helper: proto::extends< proto::terminal<list_reverse_tag>::type, ListReverse_Helper, boost::msm::sm_domain>
  562. {
  563. ListReverse_Helper(){}
  564. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  565. #ifdef BOOST_MSVC
  566. ,class Arg6
  567. #endif
  568. >
  569. struct In
  570. {
  571. typedef ListReverse_<Arg1> type;
  572. };
  573. };
  574. ListReverse_Helper const list_reverse_;
  575. template <class Container, class Predicate, class Enable=void>
  576. struct ListUnique_ : euml_action<ListUnique_<Container,Predicate,Enable> >
  577. {
  578. template <class Event,class FSM,class STATE >
  579. struct state_action_result
  580. {
  581. typedef void type;
  582. };
  583. template <class EVT,class FSM,class SourceState,class TargetState>
  584. struct transition_action_result
  585. {
  586. typedef void type;
  587. };
  588. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  589. template <class EVT,class FSM,class SourceState,class TargetState>
  590. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  591. {
  592. (Container()(evt,fsm,src,tgt)).unique();
  593. }
  594. template <class Event,class FSM,class STATE>
  595. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  596. {
  597. (Container()(evt,fsm,state)).unique();
  598. }
  599. };
  600. template <class Container, class Predicate >
  601. struct ListUnique_<Container,Predicate,
  602. typename ::boost::disable_if<typename ::boost::is_same<Predicate,void>::type >::type>
  603. : euml_action<ListUnique_<Container,Predicate> >
  604. {
  605. template <class Event,class FSM,class STATE >
  606. struct state_action_result
  607. {
  608. typedef void type;
  609. };
  610. template <class EVT,class FSM,class SourceState,class TargetState>
  611. struct transition_action_result
  612. {
  613. typedef void type;
  614. };
  615. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  616. template <class EVT,class FSM,class SourceState,class TargetState>
  617. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  618. {
  619. (Container()(evt,fsm,src,tgt)).unique(Predicate()(evt,fsm,src,tgt));
  620. }
  621. template <class Event,class FSM,class STATE>
  622. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  623. {
  624. (Container()(evt,fsm,state)).unique(Predicate()(evt,fsm,state));
  625. }
  626. };
  627. struct list_unique_tag {};
  628. struct ListUnique_Helper: proto::extends< proto::terminal<list_unique_tag>::type, ListUnique_Helper, boost::msm::sm_domain>
  629. {
  630. ListUnique_Helper(){}
  631. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  632. #ifdef BOOST_MSVC
  633. ,class Arg6
  634. #endif
  635. >
  636. struct In
  637. {
  638. typedef ListUnique_<Arg1,Arg2> type;
  639. };
  640. };
  641. ListUnique_Helper const list_unique_;
  642. template <class Container, class Predicate, class Enable=void>
  643. struct ListSort_ : euml_action<ListSort_<Container,Predicate,Enable> >
  644. {
  645. template <class Event,class FSM,class STATE >
  646. struct state_action_result
  647. {
  648. typedef void type;
  649. };
  650. template <class EVT,class FSM,class SourceState,class TargetState>
  651. struct transition_action_result
  652. {
  653. typedef void type;
  654. };
  655. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  656. template <class EVT,class FSM,class SourceState,class TargetState>
  657. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  658. {
  659. (Container()(evt,fsm,src,tgt)).sort();
  660. }
  661. template <class Event,class FSM,class STATE>
  662. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  663. {
  664. (Container()(evt,fsm,state)).sort();
  665. }
  666. };
  667. template <class Container, class Predicate >
  668. struct ListSort_<Container,Predicate,
  669. typename ::boost::disable_if<typename ::boost::is_same<Predicate,void>::type >::type>
  670. : euml_action<ListSort_<Container,Predicate> >
  671. {
  672. template <class Event,class FSM,class STATE >
  673. struct state_action_result
  674. {
  675. typedef void type;
  676. };
  677. template <class EVT,class FSM,class SourceState,class TargetState>
  678. struct transition_action_result
  679. {
  680. typedef void type;
  681. };
  682. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  683. template <class EVT,class FSM,class SourceState,class TargetState>
  684. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  685. {
  686. (Container()(evt,fsm,src,tgt)).sort(Predicate()(evt,fsm,src,tgt));
  687. }
  688. template <class Event,class FSM,class STATE>
  689. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  690. {
  691. (Container()(evt,fsm,state)).sort(Predicate()(evt,fsm,state));
  692. }
  693. };
  694. struct list_sort_tag {};
  695. struct ListSort_Helper: proto::extends< proto::terminal<list_sort_tag>::type, ListSort_Helper, boost::msm::sm_domain>
  696. {
  697. ListSort_Helper(){}
  698. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  699. #ifdef BOOST_MSVC
  700. ,class Arg6
  701. #endif
  702. >
  703. struct In
  704. {
  705. typedef ListSort_<Arg1,Arg2> type;
  706. };
  707. };
  708. ListSort_Helper const list_sort_;
  709. template <class Container>
  710. struct Capacity_ : euml_action<Capacity_<Container> >
  711. {
  712. template <class Event,class FSM,class STATE >
  713. struct state_action_result
  714. {
  715. typedef typename get_size_type<
  716. typename ::boost::remove_reference<
  717. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  718. };
  719. template <class EVT,class FSM,class SourceState,class TargetState>
  720. struct transition_action_result
  721. {
  722. typedef typename get_size_type<
  723. typename ::boost::remove_reference<
  724. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  725. };
  726. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  727. template <class EVT,class FSM,class SourceState,class TargetState>
  728. typename ::boost::enable_if<
  729. typename ::boost::mpl::has_key<
  730. typename Container::tag_type,action_tag>::type,
  731. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  732. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  733. {
  734. return (Container()(evt,fsm,src,tgt)).capacity();
  735. }
  736. template <class Event,class FSM,class STATE>
  737. typename ::boost::enable_if<
  738. typename ::boost::mpl::has_key<
  739. typename Container::tag_type,state_action_tag>::type,
  740. typename state_action_result<Event,FSM,STATE>::type >::type
  741. operator()(Event const& evt,FSM& fsm,STATE& state )const
  742. {
  743. return (Container()(evt,fsm,state)).capacity();
  744. }
  745. };
  746. struct capacity_tag {};
  747. struct Capacity_Helper: proto::extends< proto::terminal<capacity_tag>::type, Capacity_Helper, boost::msm::sm_domain>
  748. {
  749. Capacity_Helper(){}
  750. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  751. #ifdef BOOST_MSVC
  752. ,class Arg6
  753. #endif
  754. >
  755. struct In
  756. {
  757. typedef Capacity_<Arg1> type;
  758. };
  759. };
  760. Capacity_Helper const capacity_;
  761. template <class Container>
  762. struct Size_ : euml_action<Size_<Container> >
  763. {
  764. template <class Event,class FSM,class STATE >
  765. struct state_action_result
  766. {
  767. typedef typename get_size_type<
  768. typename ::boost::remove_reference<
  769. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  770. };
  771. template <class EVT,class FSM,class SourceState,class TargetState>
  772. struct transition_action_result
  773. {
  774. typedef typename get_size_type<
  775. typename ::boost::remove_reference<
  776. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  777. };
  778. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  779. template <class EVT,class FSM,class SourceState,class TargetState>
  780. typename ::boost::enable_if<
  781. typename ::boost::mpl::has_key<
  782. typename Container::tag_type,action_tag>::type,
  783. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  784. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  785. {
  786. return (Container()(evt,fsm,src,tgt)).size();
  787. }
  788. template <class Event,class FSM,class STATE>
  789. typename ::boost::enable_if<
  790. typename ::boost::mpl::has_key<
  791. typename Container::tag_type,state_action_tag>::type,
  792. typename state_action_result<Event,FSM,STATE>::type >::type
  793. operator()(Event const& evt,FSM& fsm,STATE& state )const
  794. {
  795. return (Container()(evt,fsm,state)).size();
  796. }
  797. };
  798. struct size_tag {};
  799. struct Size_Helper: proto::extends< proto::terminal<size_tag>::type, Size_Helper, boost::msm::sm_domain>
  800. {
  801. Size_Helper(){}
  802. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  803. #ifdef BOOST_MSVC
  804. ,class Arg6
  805. #endif
  806. >
  807. struct In
  808. {
  809. typedef Size_<Arg1> type;
  810. };
  811. };
  812. Size_Helper const size_;
  813. template <class Container>
  814. struct Max_Size_ : euml_action<Max_Size_<Container> >
  815. {
  816. template <class Event,class FSM,class STATE >
  817. struct state_action_result
  818. {
  819. typedef typename get_size_type<
  820. typename ::boost::remove_reference<
  821. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  822. };
  823. template <class EVT,class FSM,class SourceState,class TargetState>
  824. struct transition_action_result
  825. {
  826. typedef typename get_size_type<
  827. typename ::boost::remove_reference<
  828. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  829. };
  830. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  831. template <class EVT,class FSM,class SourceState,class TargetState>
  832. typename ::boost::enable_if<
  833. typename ::boost::mpl::has_key<
  834. typename Container::tag_type,action_tag>::type,
  835. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  836. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  837. {
  838. return (Container()(evt,fsm,src,tgt)).max_size();
  839. }
  840. template <class Event,class FSM,class STATE>
  841. typename ::boost::enable_if<
  842. typename ::boost::mpl::has_key<
  843. typename Container::tag_type,state_action_tag>::type,
  844. typename state_action_result<Event,FSM,STATE>::type >::type
  845. operator()(Event const& evt,FSM& fsm,STATE& state )const
  846. {
  847. return (Container()(evt,fsm,state)).max_size();
  848. }
  849. };
  850. struct max_size_tag {};
  851. struct Max_Size_Helper: proto::extends< proto::terminal<max_size_tag>::type, Max_Size_Helper, boost::msm::sm_domain>
  852. {
  853. Max_Size_Helper(){}
  854. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  855. #ifdef BOOST_MSVC
  856. ,class Arg6
  857. #endif
  858. >
  859. struct In
  860. {
  861. typedef Max_Size_<Arg1> type;
  862. };
  863. };
  864. Max_Size_Helper const max_size_;
  865. template <class Container, class Value>
  866. struct Reserve_ : euml_action<Reserve_<Container,Value> >
  867. {
  868. template <class Event,class FSM,class STATE >
  869. struct state_action_result
  870. {
  871. typedef void type;
  872. };
  873. template <class EVT,class FSM,class SourceState,class TargetState>
  874. struct transition_action_result
  875. {
  876. typedef void type;
  877. };
  878. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  879. template <class EVT,class FSM,class SourceState,class TargetState>
  880. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  881. {
  882. (Container()(evt,fsm,src,tgt)).reserve(Value()(evt,fsm,src,tgt));
  883. }
  884. template <class Event,class FSM,class STATE>
  885. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  886. {
  887. (Container()(evt,fsm,state)).reserve(Value()(evt,fsm,state));
  888. }
  889. };
  890. struct reserve_tag {};
  891. struct Reserve_Helper: proto::extends< proto::terminal<reserve_tag>::type, Reserve_Helper, boost::msm::sm_domain>
  892. {
  893. Reserve_Helper(){}
  894. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  895. #ifdef BOOST_MSVC
  896. ,class Arg6
  897. #endif
  898. >
  899. struct In
  900. {
  901. typedef Reserve_<Arg1,Arg2> type;
  902. };
  903. };
  904. Reserve_Helper const reserve_;
  905. template <class Container, class Num, class Value ,class Enable=void >
  906. struct Resize_ : euml_action<Resize_<Container,Num,Value> >
  907. {
  908. template <class Event,class FSM,class STATE >
  909. struct state_action_result
  910. {
  911. typedef void type;
  912. };
  913. template <class EVT,class FSM,class SourceState,class TargetState>
  914. struct transition_action_result
  915. {
  916. typedef void type;
  917. };
  918. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  919. template <class EVT,class FSM,class SourceState,class TargetState>
  920. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  921. {
  922. (Container()(evt,fsm,src,tgt)).resize(Num()(evt,fsm,src,tgt));
  923. }
  924. template <class Event,class FSM,class STATE>
  925. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  926. {
  927. (Container()(evt,fsm,state)).resize(Num()(evt,fsm,state));
  928. }
  929. };
  930. template <class Container, class Num , class Value >
  931. struct Resize_<Container,Num,Value,typename ::boost::disable_if<typename ::boost::is_same<Value,void>::type >::type>
  932. : euml_action<Resize_<Container,Num,Value> >
  933. {
  934. template <class Event,class FSM,class STATE >
  935. struct state_action_result
  936. {
  937. typedef void type;
  938. };
  939. template <class EVT,class FSM,class SourceState,class TargetState>
  940. struct transition_action_result
  941. {
  942. typedef void type;
  943. };
  944. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  945. template <class EVT,class FSM,class SourceState,class TargetState>
  946. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  947. {
  948. (Container()(evt,fsm,src,tgt)).resize(Num()(evt,fsm,src,tgt),Value()(evt,fsm,src,tgt));
  949. }
  950. template <class Event,class FSM,class STATE>
  951. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  952. {
  953. (Container()(evt,fsm,state)).resize(Num()(evt,fsm,state),Value()(evt,fsm,state));
  954. }
  955. };
  956. struct resize_tag {};
  957. struct Resize_Helper: proto::extends< proto::terminal<resize_tag>::type, Resize_Helper, boost::msm::sm_domain>
  958. {
  959. Resize_Helper(){}
  960. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  961. #ifdef BOOST_MSVC
  962. ,class Arg6
  963. #endif
  964. >
  965. struct In
  966. {
  967. typedef Resize_<Arg1,Arg2,Arg3> type;
  968. };
  969. };
  970. Resize_Helper const resize_;
  971. // version for 3 parameters (sequence containers)
  972. template <class Container, class Param1, class Param2, class Param3 >
  973. struct Insert_ : euml_action<Insert_<Container,Param1,Param2,Param3> >
  974. {
  975. template <class Event,class FSM,class STATE >
  976. struct state_action_result
  977. {
  978. typedef void type;
  979. };
  980. template <class EVT,class FSM,class SourceState,class TargetState>
  981. struct transition_action_result
  982. {
  983. typedef void type;
  984. };
  985. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  986. template <class EVT,class FSM,class SourceState,class TargetState>
  987. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  988. {
  989. (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  990. Param3()(evt,fsm,src,tgt));
  991. }
  992. template <class Event,class FSM,class STATE>
  993. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  994. {
  995. (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  996. Param3()(evt,fsm,state));
  997. }
  998. };
  999. // version for 2 parameters
  1000. template <class Container, class Param1, class Param2>
  1001. struct Insert_ < Container,Param1,Param2,void>
  1002. : euml_action<Insert_<Container,Param1,Param2,void> >
  1003. {
  1004. // return value will actually not be correct for set::insert(it1,it2), should be void
  1005. // but it's ok as nobody should call an inexistent return type
  1006. template <class Event,class FSM,class STATE >
  1007. struct state_action_result
  1008. {
  1009. typedef typename get_iterator<
  1010. typename ::boost::remove_reference<
  1011. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  1012. };
  1013. template <class EVT,class FSM,class SourceState,class TargetState>
  1014. struct transition_action_result
  1015. {
  1016. typedef typename get_iterator<
  1017. typename ::boost::remove_reference<
  1018. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  1019. };
  1020. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1021. // version for transition + second param not an iterator (meaning that, Container is not an associative container)
  1022. template <class EVT,class FSM,class SourceState,class TargetState>
  1023. typename ::boost::enable_if<
  1024. typename ::boost::mpl::and_<
  1025. typename ::boost::mpl::has_key<
  1026. typename Container::tag_type,action_tag>::type,
  1027. typename ::boost::mpl::not_<
  1028. typename has_iterator_category<
  1029. typename Param2::template transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1030. >::type
  1031. >::type
  1032. >::type,
  1033. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1034. >::type
  1035. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1036. {
  1037. return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1038. }
  1039. // version for transition + second param is an iterator (meaning that, Container is an associative container)
  1040. template <class EVT,class FSM,class SourceState,class TargetState>
  1041. typename ::boost::enable_if<
  1042. typename ::boost::mpl::and_<
  1043. typename ::boost::mpl::has_key<
  1044. typename Container::tag_type,action_tag>::type,
  1045. typename has_iterator_category<
  1046. typename Param2::template transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1047. >::type
  1048. >::type,
  1049. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1050. >::type
  1051. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1052. {
  1053. (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1054. }
  1055. // version for state action + second param not an iterator (meaning that, Container is not an associative container)
  1056. template <class Event,class FSM,class STATE>
  1057. typename ::boost::enable_if<
  1058. typename ::boost::mpl::and_<
  1059. typename ::boost::mpl::has_key<
  1060. typename Container::tag_type,state_action_tag>::type,
  1061. typename ::boost::mpl::not_<
  1062. typename has_iterator_category<
  1063. typename Param2::template state_action_result<Event,FSM,STATE>::type
  1064. >::type
  1065. >::type
  1066. >::type,
  1067. typename state_action_result<Event,FSM,STATE>::type
  1068. >::type
  1069. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1070. {
  1071. return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1072. }
  1073. // version for state action + second param is an iterator (meaning that, Container is an associative container)
  1074. template <class Event,class FSM,class STATE>
  1075. typename ::boost::enable_if<
  1076. typename ::boost::mpl::and_<
  1077. typename ::boost::mpl::has_key<
  1078. typename Container::tag_type,state_action_tag>::type,
  1079. typename has_iterator_category<
  1080. typename Param2::template state_action_result<Event,FSM,STATE>::type
  1081. >::type
  1082. >::type,
  1083. typename state_action_result<Event,FSM,STATE>::type
  1084. >::type
  1085. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1086. {
  1087. (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1088. }
  1089. };
  1090. // version for 1 parameter (associative containers)
  1091. template <class Container, class Param1>
  1092. struct Insert_ < Container,Param1,void,void>
  1093. : euml_action<Insert_<Container,Param1,void,void> >
  1094. {
  1095. template <class Event,class FSM,class STATE >
  1096. struct state_action_result
  1097. {
  1098. typedef typename std::pair<
  1099. typename get_iterator<
  1100. typename ::boost::remove_reference<
  1101. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type,bool> type;
  1102. };
  1103. template <class EVT,class FSM,class SourceState,class TargetState>
  1104. struct transition_action_result
  1105. {
  1106. typedef typename std::pair<
  1107. typename get_iterator<
  1108. typename ::boost::remove_reference<
  1109. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type,bool> type;
  1110. };
  1111. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1112. template <class EVT,class FSM,class SourceState,class TargetState>
  1113. typename ::boost::enable_if<
  1114. typename ::boost::mpl::has_key<
  1115. typename Container::tag_type,action_tag>::type,
  1116. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  1117. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1118. {
  1119. return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt));
  1120. }
  1121. template <class Event,class FSM,class STATE>
  1122. typename ::boost::enable_if<
  1123. typename ::boost::mpl::has_key<
  1124. typename Container::tag_type,state_action_tag>::type,
  1125. typename state_action_result<Event,FSM,STATE>::type >::type
  1126. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1127. {
  1128. return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state));
  1129. }
  1130. };
  1131. struct insert_tag {};
  1132. struct Insert_Helper: proto::extends< proto::terminal<insert_tag>::type, Insert_Helper, boost::msm::sm_domain>
  1133. {
  1134. Insert_Helper(){}
  1135. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1136. #ifdef BOOST_MSVC
  1137. ,class Arg6
  1138. #endif
  1139. >
  1140. struct In
  1141. {
  1142. typedef Insert_<Arg1,Arg2,Arg3,Arg4> type;
  1143. };
  1144. };
  1145. Insert_Helper const insert_;
  1146. template <class Container1,class Container2>
  1147. struct Swap_ : euml_action<Swap_<Container1,Container2> >
  1148. {
  1149. template <class Event,class FSM,class STATE >
  1150. struct state_action_result
  1151. {
  1152. typedef void type;
  1153. };
  1154. template <class EVT,class FSM,class SourceState,class TargetState>
  1155. struct transition_action_result
  1156. {
  1157. typedef void type;
  1158. };
  1159. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1160. template <class EVT,class FSM,class SourceState,class TargetState>
  1161. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1162. {
  1163. (Container1()(evt,fsm,src,tgt)).swap(Container2()(evt,fsm,src,tgt));
  1164. }
  1165. template <class Event,class FSM,class STATE>
  1166. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1167. {
  1168. (Container1()(evt,fsm,state)).swap(Container2()(evt,fsm,state));
  1169. }
  1170. };
  1171. struct swap_tag {};
  1172. struct Swap_Helper: proto::extends< proto::terminal<swap_tag>::type, Swap_Helper, boost::msm::sm_domain>
  1173. {
  1174. Swap_Helper(){}
  1175. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1176. #ifdef BOOST_MSVC
  1177. ,class Arg6
  1178. #endif
  1179. >
  1180. struct In
  1181. {
  1182. typedef Swap_<Arg1,Arg2> type;
  1183. };
  1184. };
  1185. Swap_Helper const swap_;
  1186. template <class Container, class Iterator1, class Iterator2 ,class Enable=void >
  1187. struct Erase_ : euml_action<Erase_<Container,Iterator1,Iterator2> >
  1188. {
  1189. template <class Event,class FSM,class STATE >
  1190. struct state_action_result
  1191. {
  1192. typedef typename get_result_type2<Iterator1,Event,FSM,STATE>::type type;
  1193. };
  1194. template <class EVT,class FSM,class SourceState,class TargetState>
  1195. struct transition_action_result
  1196. {
  1197. typedef typename get_result_type<Iterator1,EVT,FSM,SourceState,TargetState>::type 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. typename ::boost::enable_if<
  1202. typename ::boost::mpl::has_key<
  1203. typename Iterator1::tag_type,action_tag>::type,
  1204. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  1205. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1206. {
  1207. return (Container()(evt,fsm,src,tgt)).erase(Iterator1()(evt,fsm,src,tgt));
  1208. }
  1209. template <class Event,class FSM,class STATE>
  1210. typename ::boost::enable_if<
  1211. typename ::boost::mpl::has_key<
  1212. typename Iterator1::tag_type,state_action_tag>::type,
  1213. typename state_action_result<Event,FSM,STATE>::type >::type
  1214. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1215. {
  1216. return (Container()(evt,fsm,state)).erase(Iterator1()(evt,fsm,state));
  1217. }
  1218. };
  1219. template <class Container, class Iterator1 , class Iterator2 >
  1220. struct Erase_<Container,Iterator1,Iterator2,
  1221. typename ::boost::disable_if<typename ::boost::is_same<Iterator2,void>::type >::type>
  1222. : euml_action<Erase_<Container,Iterator1,Iterator2> >
  1223. {
  1224. template <class Event,class FSM,class STATE >
  1225. struct state_action_result
  1226. {
  1227. typedef typename get_result_type2<Iterator1,Event,FSM,STATE>::type type;
  1228. };
  1229. template <class EVT,class FSM,class SourceState,class TargetState>
  1230. struct transition_action_result
  1231. {
  1232. typedef typename get_result_type<Iterator1,EVT,FSM,SourceState,TargetState>::type type;
  1233. };
  1234. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1235. template <class EVT,class FSM,class SourceState,class TargetState>
  1236. typename ::boost::enable_if<
  1237. typename ::boost::mpl::has_key<
  1238. typename Iterator1::tag_type,action_tag>::type,
  1239. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  1240. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1241. {
  1242. return (Container()(evt,fsm,src,tgt)).erase(Iterator1()(evt,fsm,src,tgt),Iterator2()(evt,fsm,src,tgt));
  1243. }
  1244. template <class Event,class FSM,class STATE>
  1245. typename ::boost::enable_if<
  1246. typename ::boost::mpl::has_key<
  1247. typename Iterator1::tag_type,state_action_tag>::type,
  1248. typename state_action_result<Event,FSM,STATE>::type >::type
  1249. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1250. {
  1251. return (Container()(evt,fsm,state)).erase(Iterator1()(evt,fsm,state),Iterator2()(evt,fsm,state));
  1252. }
  1253. };
  1254. struct erase_tag {};
  1255. struct Erase_Helper: proto::extends< proto::terminal<erase_tag>::type, Erase_Helper, boost::msm::sm_domain>
  1256. {
  1257. Erase_Helper(){}
  1258. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1259. #ifdef BOOST_MSVC
  1260. ,class Arg6
  1261. #endif
  1262. >
  1263. struct In
  1264. {
  1265. typedef Erase_<Arg1,Arg2,Arg3> type;
  1266. };
  1267. };
  1268. Erase_Helper const erase_;
  1269. template <class Container>
  1270. struct Empty_ : euml_action<Empty_<Container> >
  1271. {
  1272. template <class Event,class FSM,class STATE >
  1273. struct state_action_result
  1274. {
  1275. typedef bool type;
  1276. };
  1277. template <class EVT,class FSM,class SourceState,class TargetState>
  1278. struct transition_action_result
  1279. {
  1280. typedef bool type;
  1281. };
  1282. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1283. template <class EVT,class FSM,class SourceState,class TargetState>
  1284. bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1285. {
  1286. return (Container()(evt,fsm,src,tgt)).empty();
  1287. }
  1288. template <class Event,class FSM,class STATE>
  1289. bool operator()(Event const& evt,FSM& fsm,STATE& state )const
  1290. {
  1291. return (Container()(evt,fsm,state)).empty();
  1292. }
  1293. };
  1294. struct empty_tag {};
  1295. struct Empty_Helper: proto::extends< proto::terminal<empty_tag>::type, Empty_Helper, boost::msm::sm_domain>
  1296. {
  1297. Empty_Helper(){}
  1298. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1299. #ifdef BOOST_MSVC
  1300. ,class Arg6
  1301. #endif
  1302. >
  1303. struct In
  1304. {
  1305. typedef Empty_<Arg1> type;
  1306. };
  1307. };
  1308. Empty_Helper const empty_;
  1309. template <class Container,class Element>
  1310. struct ListRemove_ : euml_action<ListRemove_<Container,Element> >
  1311. {
  1312. template <class Event,class FSM,class STATE >
  1313. struct state_action_result
  1314. {
  1315. typedef void type;
  1316. };
  1317. template <class EVT,class FSM,class SourceState,class TargetState>
  1318. struct transition_action_result
  1319. {
  1320. typedef void type;
  1321. };
  1322. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1323. template <class EVT,class FSM,class SourceState,class TargetState>
  1324. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1325. {
  1326. (Container()(evt,fsm,src,tgt)).remove(Element()(evt,fsm,src,tgt));
  1327. }
  1328. template <class Event,class FSM,class STATE>
  1329. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1330. {
  1331. (Container()(evt,fsm,state)).remove(Element()(evt,fsm,state));
  1332. }
  1333. };
  1334. struct list_remove_tag {};
  1335. struct ListRemove_Helper: proto::extends< proto::terminal<list_remove_tag>::type, ListRemove_Helper, boost::msm::sm_domain>
  1336. {
  1337. ListRemove_Helper(){}
  1338. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1339. #ifdef BOOST_MSVC
  1340. ,class Arg6
  1341. #endif
  1342. >
  1343. struct In
  1344. {
  1345. typedef ListRemove_<Arg1,Arg2> type;
  1346. };
  1347. };
  1348. ListRemove_Helper const list_remove_;
  1349. template <class Container,class Element>
  1350. struct ListRemove_If_ : euml_action<ListRemove_If_<Container,Element> >
  1351. {
  1352. template <class Event,class FSM,class STATE >
  1353. struct state_action_result
  1354. {
  1355. typedef void type;
  1356. };
  1357. template <class EVT,class FSM,class SourceState,class TargetState>
  1358. struct transition_action_result
  1359. {
  1360. typedef void type;
  1361. };
  1362. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1363. template <class EVT,class FSM,class SourceState,class TargetState>
  1364. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1365. {
  1366. (Container()(evt,fsm,src,tgt)).remove_if(Element()(evt,fsm,src,tgt));
  1367. }
  1368. template <class Event,class FSM,class STATE>
  1369. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1370. {
  1371. (Container()(evt,fsm,state)).remove_if(Element()(evt,fsm,state));
  1372. }
  1373. };
  1374. struct list_remove_if_tag {};
  1375. struct ListRemove_If_Helper: proto::extends< proto::terminal<list_remove_if_tag>::type, ListRemove_If_Helper, boost::msm::sm_domain>
  1376. {
  1377. ListRemove_If_Helper(){}
  1378. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1379. #ifdef BOOST_MSVC
  1380. ,class Arg6
  1381. #endif
  1382. >
  1383. struct In
  1384. {
  1385. typedef ListRemove_If_<Arg1,Arg2> type;
  1386. };
  1387. };
  1388. ListRemove_If_Helper const list_remove_if_;
  1389. template <class Container, class ToMerge, class Predicate, class Enable=void>
  1390. struct ListMerge_ : euml_action<ListMerge_<Container,ToMerge,Predicate,Enable> >
  1391. {
  1392. template <class Event,class FSM,class STATE >
  1393. struct state_action_result
  1394. {
  1395. typedef void type;
  1396. };
  1397. template <class EVT,class FSM,class SourceState,class TargetState>
  1398. struct transition_action_result
  1399. {
  1400. typedef void type;
  1401. };
  1402. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1403. template <class EVT,class FSM,class SourceState,class TargetState>
  1404. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1405. {
  1406. (Container()(evt,fsm,src,tgt)).merge(ToMerge()(evt,fsm,src,tgt));
  1407. }
  1408. template <class Event,class FSM,class STATE>
  1409. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1410. {
  1411. (Container()(evt,fsm,state)).merge(ToMerge()(evt,fsm,state));
  1412. }
  1413. };
  1414. template <class Container, class ToMerge, class Predicate >
  1415. struct ListMerge_<Container,ToMerge,Predicate,
  1416. typename ::boost::disable_if<typename ::boost::is_same<Predicate,void>::type >::type>
  1417. : euml_action<ListMerge_<Container,ToMerge,Predicate> >
  1418. {
  1419. template <class Event,class FSM,class STATE >
  1420. struct state_action_result
  1421. {
  1422. typedef void type;
  1423. };
  1424. template <class EVT,class FSM,class SourceState,class TargetState>
  1425. struct transition_action_result
  1426. {
  1427. typedef void type;
  1428. };
  1429. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1430. template <class EVT,class FSM,class SourceState,class TargetState>
  1431. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1432. {
  1433. (Container()(evt,fsm,src,tgt)).merge(ToMerge()(evt,fsm,src,tgt),Predicate()(evt,fsm,src,tgt));
  1434. }
  1435. template <class Event,class FSM,class STATE>
  1436. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1437. {
  1438. (Container()(evt,fsm,state)).merge(ToMerge()(evt,fsm,state),Predicate()(evt,fsm,state));
  1439. }
  1440. };
  1441. struct list_merge_tag {};
  1442. struct ListMerge_Helper: proto::extends< proto::terminal<list_merge_tag>::type, ListMerge_Helper, boost::msm::sm_domain>
  1443. {
  1444. ListMerge_Helper(){}
  1445. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1446. #ifdef BOOST_MSVC
  1447. ,class Arg6
  1448. #endif
  1449. >
  1450. struct In
  1451. {
  1452. typedef ListMerge_<Arg1,Arg2,Arg3> type;
  1453. };
  1454. };
  1455. ListMerge_Helper const list_merge_;
  1456. template <class Container, class Param1, class Param2, class Param3, class Param4 ,class Enable=void >
  1457. struct Splice_ : euml_action<Splice_<Container,Param1,Param2,Param3,Param4,Enable> >
  1458. {
  1459. template <class Event,class FSM,class STATE >
  1460. struct state_action_result
  1461. {
  1462. typedef void type;
  1463. };
  1464. template <class EVT,class FSM,class SourceState,class TargetState>
  1465. struct transition_action_result
  1466. {
  1467. typedef void type;
  1468. };
  1469. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1470. template <class EVT,class FSM,class SourceState,class TargetState>
  1471. typename ::boost::enable_if<
  1472. typename ::boost::mpl::has_key<
  1473. typename Container::tag_type,action_tag>::type,
  1474. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  1475. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1476. {
  1477. return (Container()(evt,fsm,src,tgt)).splice(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1478. }
  1479. template <class Event,class FSM,class STATE>
  1480. typename ::boost::enable_if<
  1481. typename ::boost::mpl::has_key<
  1482. typename Container::tag_type,state_action_tag>::type,
  1483. typename state_action_result<Event,FSM,STATE>::type >::type
  1484. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1485. {
  1486. return (Container()(evt,fsm,state)).splice(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1487. }
  1488. };
  1489. template <class Container, class Param1, class Param2, class Param3, class Param4 >
  1490. struct Splice_<Container,Param1,Param2,Param3,Param4,
  1491. typename ::boost::disable_if<
  1492. typename ::boost::mpl::or_<typename ::boost::is_same<Param3,void>::type,
  1493. typename ::boost::mpl::not_<
  1494. typename ::boost::is_same<Param4,void>::type>::type>::type >::type>
  1495. : euml_action<Splice_<Container,Param1,Param2,Param3,Param4> >
  1496. {
  1497. template <class Event,class FSM,class STATE >
  1498. struct state_action_result
  1499. {
  1500. typedef void type;
  1501. };
  1502. template <class EVT,class FSM,class SourceState,class TargetState>
  1503. struct transition_action_result
  1504. {
  1505. typedef void type;
  1506. };
  1507. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1508. template <class EVT,class FSM,class SourceState,class TargetState>
  1509. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1510. {
  1511. (Container()(evt,fsm,src,tgt)).splice(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  1512. Param3()(evt,fsm,src,tgt));
  1513. }
  1514. template <class Event,class FSM,class STATE>
  1515. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1516. {
  1517. (Container()(evt,fsm,state)).splice(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  1518. Param3()(evt,fsm,state));
  1519. }
  1520. };
  1521. template <class Container, class Param1, class Param2, class Param3, class Param4 >
  1522. struct Splice_<Container,Param1,Param2,Param3,Param4,
  1523. typename ::boost::disable_if<typename ::boost::is_same<Param4,void>::type >::type>
  1524. : euml_action<Splice_<Container,Param1,Param2,Param3,Param4> >
  1525. {
  1526. template <class Event,class FSM,class STATE >
  1527. struct state_action_result
  1528. {
  1529. typedef void type;
  1530. };
  1531. template <class EVT,class FSM,class SourceState,class TargetState>
  1532. struct transition_action_result
  1533. {
  1534. typedef void type;
  1535. };
  1536. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1537. template <class EVT,class FSM,class SourceState,class TargetState>
  1538. void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1539. {
  1540. (Container()(evt,fsm,src,tgt)).splice(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  1541. Param3()(evt,fsm,src,tgt),Param4()(evt,fsm,src,tgt));
  1542. }
  1543. template <class Event,class FSM,class STATE>
  1544. void operator()(Event const& evt,FSM& fsm,STATE& state )const
  1545. {
  1546. (Container()(evt,fsm,state)).splice(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  1547. Param3()(evt,fsm,state),Param4()(evt,fsm,state));
  1548. }
  1549. };
  1550. struct splice_tag {};
  1551. struct Splice_Helper: proto::extends< proto::terminal<splice_tag>::type, Splice_Helper, boost::msm::sm_domain>
  1552. {
  1553. Splice_Helper(){}
  1554. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1555. #ifdef BOOST_MSVC
  1556. ,class Arg6
  1557. #endif
  1558. >
  1559. struct In
  1560. {
  1561. typedef Splice_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
  1562. };
  1563. };
  1564. Splice_Helper const splice_;
  1565. //template <class Container, class Param1, class Param2, class Param3, class Enable=void >
  1566. //struct StringFind_ : euml_action<StringFind_<Container,Param1,Param2,Param3,Enable> >
  1567. //{
  1568. //};
  1569. template <class Container,class Param1, class Param2, class Param3>
  1570. struct StringFind_ : euml_action<StringFind_<Container,Param1,Param2,Param3> >
  1571. {
  1572. template <class Event,class FSM,class STATE >
  1573. struct state_action_result
  1574. {
  1575. typedef typename remove_reference<
  1576. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1577. };
  1578. template <class EVT,class FSM,class SourceState,class TargetState>
  1579. struct transition_action_result
  1580. {
  1581. typedef typename remove_reference<
  1582. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1583. };
  1584. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1585. template <class EVT,class FSM,class SourceState,class TargetState>
  1586. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1587. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1588. {
  1589. return (Container()(evt,fsm,src,tgt)).
  1590. find(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  1591. }
  1592. template <class Event,class FSM,class STATE>
  1593. typename state_action_result<Event,FSM,STATE>::type
  1594. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1595. {
  1596. return (Container()(evt,fsm,state)).
  1597. find(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  1598. }
  1599. };
  1600. template <class Container,class Param1>
  1601. struct StringFind_ < Container,Param1,void,void>
  1602. : euml_action<StringFind_<Container,Param1,void,void> >
  1603. {
  1604. template <class Event,class FSM,class STATE >
  1605. struct state_action_result
  1606. {
  1607. typedef typename remove_reference<
  1608. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1609. };
  1610. template <class EVT,class FSM,class SourceState,class TargetState>
  1611. struct transition_action_result
  1612. {
  1613. typedef typename remove_reference<
  1614. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1615. };
  1616. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1617. template <class EVT,class FSM,class SourceState,class TargetState>
  1618. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1619. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1620. {
  1621. return (Container()(evt,fsm,src,tgt)).find(Param1()(evt,fsm,src,tgt));
  1622. }
  1623. template <class Event,class FSM,class STATE>
  1624. typename state_action_result<Event,FSM,STATE>::type
  1625. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1626. {
  1627. return (Container()(evt,fsm,state)).find(Param1()(evt,fsm,state));
  1628. }
  1629. };
  1630. template <class Container,class Param1, class Param2>
  1631. struct StringFind_ <Container,Param1,Param2,void>
  1632. : euml_action<StringFind_<Container,Param1,Param2,void> >
  1633. {
  1634. template <class Event,class FSM,class STATE >
  1635. struct state_action_result
  1636. {
  1637. typedef typename remove_reference<
  1638. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1639. };
  1640. template <class EVT,class FSM,class SourceState,class TargetState>
  1641. struct transition_action_result
  1642. {
  1643. typedef typename remove_reference<
  1644. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1645. };
  1646. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1647. template <class EVT,class FSM,class SourceState,class TargetState>
  1648. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1649. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1650. {
  1651. return (Container()(evt,fsm,src,tgt)).find(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1652. }
  1653. template <class Event,class FSM,class STATE>
  1654. typename state_action_result<Event,FSM,STATE>::type
  1655. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1656. {
  1657. return (Container()(evt,fsm,state)).find(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1658. }
  1659. };
  1660. struct string_find_tag {};
  1661. struct StringFind_Helper: proto::extends< proto::terminal<string_find_tag>::type, StringFind_Helper, boost::msm::sm_domain>
  1662. {
  1663. StringFind_Helper(){}
  1664. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1665. #ifdef BOOST_MSVC
  1666. ,class Arg6
  1667. #endif
  1668. >
  1669. struct In
  1670. {
  1671. typedef StringFind_<Arg1,Arg2,Arg3,Arg4> type;
  1672. };
  1673. };
  1674. StringFind_Helper const string_find_;
  1675. template <class Container, class Param1, class Param2, class Param3, class Enable=void >
  1676. struct StringRFind_ : euml_action<StringRFind_<Container,Param1,Param2,Param3,Enable> >
  1677. {
  1678. };
  1679. template <class Container,class Param1, class Param2, class Param3>
  1680. struct StringRFind_ <
  1681. Container,Param1,Param2,Param3,
  1682. typename ::boost::enable_if<
  1683. typename ::boost::is_same<Param2,void>::type
  1684. >::type
  1685. >
  1686. : euml_action<StringRFind_<Container,Param1,Param2,Param3> >
  1687. {
  1688. template <class Event,class FSM,class STATE >
  1689. struct state_action_result
  1690. {
  1691. typedef typename remove_reference<
  1692. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1693. };
  1694. template <class EVT,class FSM,class SourceState,class TargetState>
  1695. struct transition_action_result
  1696. {
  1697. typedef typename remove_reference<
  1698. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1699. };
  1700. typedef ::boost::mpl::set<state_action_tag,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& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1704. {
  1705. return (Container()(evt,fsm,src,tgt)).rfind(Param1()(evt,fsm,src,tgt));
  1706. }
  1707. template <class Event,class FSM,class STATE>
  1708. typename state_action_result<Event,FSM,STATE>::type
  1709. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1710. {
  1711. return (Container()(evt,fsm,state)).rfind(Param1()(evt,fsm,state));
  1712. }
  1713. };
  1714. template <class Container,class Param1, class Param2, class Param3>
  1715. struct StringRFind_ <
  1716. Container,Param1,Param2,Param3,
  1717. typename ::boost::enable_if<
  1718. typename ::boost::mpl::and_<
  1719. typename ::boost::is_same<Param3,void>::type,
  1720. typename ::boost::mpl::not_<
  1721. typename ::boost::is_same<Param2,void>::type
  1722. >::type
  1723. >::type
  1724. >::type
  1725. >
  1726. : euml_action<StringRFind_<Container,Param1,Param2,Param3> >
  1727. {
  1728. template <class Event,class FSM,class STATE >
  1729. struct state_action_result
  1730. {
  1731. typedef typename remove_reference<
  1732. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1733. };
  1734. template <class EVT,class FSM,class SourceState,class TargetState>
  1735. struct transition_action_result
  1736. {
  1737. typedef typename remove_reference<
  1738. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1739. };
  1740. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1741. template <class EVT,class FSM,class SourceState,class TargetState>
  1742. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1743. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1744. {
  1745. return (Container()(evt,fsm,src,tgt)).rfind(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1746. }
  1747. template <class Event,class FSM,class STATE>
  1748. typename state_action_result<Event,FSM,STATE>::type
  1749. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1750. {
  1751. return (Container()(evt,fsm,state)).rfind(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1752. }
  1753. };
  1754. template <class Container,class Param1, class Param2, class Param3>
  1755. struct StringRFind_<
  1756. Container,Param1,Param2,Param3,
  1757. typename ::boost::disable_if<
  1758. typename ::boost::is_same<Param3,void>::type
  1759. >::type
  1760. >
  1761. : euml_action<StringRFind_<Container,Param1,Param2,Param3> >
  1762. {
  1763. template <class Event,class FSM,class STATE >
  1764. struct state_action_result
  1765. {
  1766. typedef typename remove_reference<
  1767. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1768. };
  1769. template <class EVT,class FSM,class SourceState,class TargetState>
  1770. struct transition_action_result
  1771. {
  1772. typedef typename remove_reference<
  1773. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1774. };
  1775. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1776. template <class EVT,class FSM,class SourceState,class TargetState>
  1777. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1778. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1779. {
  1780. return (Container()(evt,fsm,src,tgt)).
  1781. rfind(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  1782. }
  1783. template <class Event,class FSM,class STATE>
  1784. typename state_action_result<Event,FSM,STATE>::type
  1785. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1786. {
  1787. return (Container()(evt,fsm,state)).
  1788. rfind(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  1789. }
  1790. };
  1791. struct string_rfind_tag {};
  1792. struct StringRFind_Helper: proto::extends< proto::terminal<string_rfind_tag>::type, StringRFind_Helper, boost::msm::sm_domain>
  1793. {
  1794. StringRFind_Helper(){}
  1795. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1796. #ifdef BOOST_MSVC
  1797. ,class Arg6
  1798. #endif
  1799. >
  1800. struct In
  1801. {
  1802. typedef StringRFind_<Arg1,Arg2,Arg3,Arg4> type;
  1803. };
  1804. };
  1805. StringRFind_Helper const string_rfind_;
  1806. template <class Container,class Param1, class Param2, class Param3>
  1807. struct StringFindFirstOf_ : euml_action<StringFindFirstOf_<Container,Param1,Param2,Param3> >
  1808. {
  1809. template <class Event,class FSM,class STATE >
  1810. struct state_action_result
  1811. {
  1812. typedef typename remove_reference<
  1813. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1814. };
  1815. template <class EVT,class FSM,class SourceState,class TargetState>
  1816. struct transition_action_result
  1817. {
  1818. typedef typename remove_reference<
  1819. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1820. };
  1821. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1822. template <class EVT,class FSM,class SourceState,class TargetState>
  1823. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1824. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1825. {
  1826. return (Container()(evt,fsm,src,tgt)).
  1827. find_first_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  1828. }
  1829. template <class Event,class FSM,class STATE>
  1830. typename state_action_result<Event,FSM,STATE>::type
  1831. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1832. {
  1833. return (Container()(evt,fsm,state)).
  1834. find_first_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  1835. }
  1836. };
  1837. template <class Container,class Param1>
  1838. struct StringFindFirstOf_ <Container,Param1,void,void>
  1839. : euml_action<StringFindFirstOf_<Container,Param1,void,void> >
  1840. {
  1841. template <class Event,class FSM,class STATE >
  1842. struct state_action_result
  1843. {
  1844. typedef typename remove_reference<
  1845. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1846. };
  1847. template <class EVT,class FSM,class SourceState,class TargetState>
  1848. struct transition_action_result
  1849. {
  1850. typedef typename remove_reference<
  1851. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1852. };
  1853. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1854. template <class EVT,class FSM,class SourceState,class TargetState>
  1855. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1856. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1857. {
  1858. return (Container()(evt,fsm,src,tgt)).find_first_of(Param1()(evt,fsm,src,tgt));
  1859. }
  1860. template <class Event,class FSM,class STATE>
  1861. typename state_action_result<Event,FSM,STATE>::type
  1862. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1863. {
  1864. return (Container()(evt,fsm,state)).find_first_of(Param1()(evt,fsm,state));
  1865. }
  1866. };
  1867. template <class Container,class Param1, class Param2>
  1868. struct StringFindFirstOf_ <Container,Param1,Param2,void>
  1869. : euml_action<StringFindFirstOf_<Container,Param1,Param2,void> >
  1870. {
  1871. template <class Event,class FSM,class STATE >
  1872. struct state_action_result
  1873. {
  1874. typedef typename remove_reference<
  1875. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1876. };
  1877. template <class EVT,class FSM,class SourceState,class TargetState>
  1878. struct transition_action_result
  1879. {
  1880. typedef typename remove_reference<
  1881. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1882. };
  1883. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1884. template <class EVT,class FSM,class SourceState,class TargetState>
  1885. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1886. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1887. {
  1888. return (Container()(evt,fsm,src,tgt)).find_first_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1889. }
  1890. template <class Event,class FSM,class STATE>
  1891. typename state_action_result<Event,FSM,STATE>::type
  1892. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1893. {
  1894. return (Container()(evt,fsm,state)).find_first_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1895. }
  1896. };
  1897. struct string_find_first_of_tag {};
  1898. struct StringFindFirstOf_Helper:
  1899. proto::extends< proto::terminal<string_find_first_of_tag>::type, StringFindFirstOf_Helper, boost::msm::sm_domain>
  1900. {
  1901. StringFindFirstOf_Helper(){}
  1902. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  1903. #ifdef BOOST_MSVC
  1904. ,class Arg6
  1905. #endif
  1906. >
  1907. struct In
  1908. {
  1909. typedef StringFindFirstOf_<Arg1,Arg2,Arg3,Arg4> type;
  1910. };
  1911. };
  1912. StringFindFirstOf_Helper const string_find_first_of_;
  1913. template <class Container, class Param1, class Param2, class Param3, class Enable=void >
  1914. struct StringFindFirstNotOf_ : euml_action<StringFindFirstNotOf_<Container,Param1,Param2,Param3,Enable> >
  1915. {
  1916. };
  1917. template <class Container,class Param1, class Param2, class Param3>
  1918. struct StringFindFirstNotOf_ <
  1919. Container,Param1,Param2,Param3,
  1920. typename ::boost::enable_if<
  1921. typename ::boost::is_same<Param2,void>::type
  1922. >::type
  1923. >
  1924. : euml_action<StringFindFirstNotOf_<Container,Param1,Param2,Param3> >
  1925. {
  1926. template <class Event,class FSM,class STATE >
  1927. struct state_action_result
  1928. {
  1929. typedef typename remove_reference<
  1930. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1931. };
  1932. template <class EVT,class FSM,class SourceState,class TargetState>
  1933. struct transition_action_result
  1934. {
  1935. typedef typename remove_reference<
  1936. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1937. };
  1938. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1939. template <class EVT,class FSM,class SourceState,class TargetState>
  1940. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1941. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1942. {
  1943. return (Container()(evt,fsm,src,tgt)).find_first_not_of(Param1()(evt,fsm,src,tgt));
  1944. }
  1945. template <class Event,class FSM,class STATE>
  1946. typename state_action_result<Event,FSM,STATE>::type
  1947. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1948. {
  1949. return (Container()(evt,fsm,state)).find_first_not_of(Param1()(evt,fsm,state));
  1950. }
  1951. };
  1952. template <class Container,class Param1, class Param2, class Param3>
  1953. struct StringFindFirstNotOf_ <
  1954. Container,Param1,Param2,Param3,
  1955. typename ::boost::enable_if<
  1956. typename ::boost::mpl::and_<
  1957. typename ::boost::is_same<Param3,void>::type,
  1958. typename ::boost::mpl::not_<
  1959. typename ::boost::is_same<Param2,void>::type
  1960. >::type
  1961. >::type
  1962. >::type
  1963. >
  1964. : euml_action<StringFindFirstNotOf_<Container,Param1,Param2,Param3> >
  1965. {
  1966. template <class Event,class FSM,class STATE >
  1967. struct state_action_result
  1968. {
  1969. typedef typename remove_reference<
  1970. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  1971. };
  1972. template <class EVT,class FSM,class SourceState,class TargetState>
  1973. struct transition_action_result
  1974. {
  1975. typedef typename remove_reference<
  1976. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  1977. };
  1978. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  1979. template <class EVT,class FSM,class SourceState,class TargetState>
  1980. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  1981. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  1982. {
  1983. return (Container()(evt,fsm,src,tgt)).find_first_not_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  1984. }
  1985. template <class Event,class FSM,class STATE>
  1986. typename state_action_result<Event,FSM,STATE>::type
  1987. operator()(Event const& evt,FSM& fsm,STATE& state )const
  1988. {
  1989. return (Container()(evt,fsm,state)).find_first_not_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  1990. }
  1991. };
  1992. template <class Container,class Param1, class Param2, class Param3>
  1993. struct StringFindFirstNotOf_<
  1994. Container,Param1,Param2,Param3,
  1995. typename ::boost::disable_if<
  1996. typename ::boost::is_same<Param3,void>::type
  1997. >::type
  1998. >
  1999. : euml_action<StringFindFirstNotOf_<Container,Param1,Param2,Param3> >
  2000. {
  2001. template <class Event,class FSM,class STATE >
  2002. struct state_action_result
  2003. {
  2004. typedef typename remove_reference<
  2005. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2006. };
  2007. template <class EVT,class FSM,class SourceState,class TargetState>
  2008. struct transition_action_result
  2009. {
  2010. typedef typename remove_reference<
  2011. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2012. };
  2013. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2014. template <class EVT,class FSM,class SourceState,class TargetState>
  2015. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2016. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2017. {
  2018. return (Container()(evt,fsm,src,tgt)).
  2019. find_first_not_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  2020. }
  2021. template <class Event,class FSM,class STATE>
  2022. typename state_action_result<Event,FSM,STATE>::type
  2023. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2024. {
  2025. return (Container()(evt,fsm,state)).
  2026. find_first_not_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  2027. }
  2028. };
  2029. struct string_find_first_not_of_tag {};
  2030. struct StringFindFirstNotOf_Helper:
  2031. proto::extends< proto::terminal<string_find_first_not_of_tag>::type, StringFindFirstNotOf_Helper, boost::msm::sm_domain>
  2032. {
  2033. StringFindFirstNotOf_Helper(){}
  2034. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2035. #ifdef BOOST_MSVC
  2036. ,class Arg6
  2037. #endif
  2038. >
  2039. struct In
  2040. {
  2041. typedef StringFindFirstNotOf_<Arg1,Arg2,Arg3,Arg4> type;
  2042. };
  2043. };
  2044. StringFindFirstNotOf_Helper const string_find_first_not_of_;
  2045. template <class Container, class Param1, class Param2, class Param3, class Enable=void >
  2046. struct StringFindLastOf_ : euml_action<StringFindLastOf_<Container,Param1,Param2,Param3,Enable> >
  2047. {
  2048. };
  2049. template <class Container,class Param1, class Param2, class Param3>
  2050. struct StringFindLastOf_ <
  2051. Container,Param1,Param2,Param3,
  2052. typename ::boost::enable_if<
  2053. typename ::boost::is_same<Param2,void>::type
  2054. >::type
  2055. >
  2056. : euml_action<StringFindLastOf_<Container,Param1,Param2,Param3> >
  2057. {
  2058. template <class Event,class FSM,class STATE >
  2059. struct state_action_result
  2060. {
  2061. typedef typename remove_reference<
  2062. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2063. };
  2064. template <class EVT,class FSM,class SourceState,class TargetState>
  2065. struct transition_action_result
  2066. {
  2067. typedef typename remove_reference<
  2068. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2069. };
  2070. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2071. template <class EVT,class FSM,class SourceState,class TargetState>
  2072. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2073. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2074. {
  2075. return (Container()(evt,fsm,src,tgt)).find_last_of(Param1()(evt,fsm,src,tgt));
  2076. }
  2077. template <class Event,class FSM,class STATE>
  2078. typename state_action_result<Event,FSM,STATE>::type
  2079. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2080. {
  2081. return (Container()(evt,fsm,state)).find_last_of(Param1()(evt,fsm,state));
  2082. }
  2083. };
  2084. template <class Container,class Param1, class Param2, class Param3>
  2085. struct StringFindLastOf_ <
  2086. Container,Param1,Param2,Param3,
  2087. typename ::boost::enable_if<
  2088. typename ::boost::mpl::and_<
  2089. typename ::boost::is_same<Param3,void>::type,
  2090. typename ::boost::mpl::not_<
  2091. typename ::boost::is_same<Param2,void>::type
  2092. >::type
  2093. >::type
  2094. >::type
  2095. >
  2096. : euml_action<StringFindLastOf_<Container,Param1,Param2,Param3> >
  2097. {
  2098. template <class Event,class FSM,class STATE >
  2099. struct state_action_result
  2100. {
  2101. typedef typename remove_reference<
  2102. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2103. };
  2104. template <class EVT,class FSM,class SourceState,class TargetState>
  2105. struct transition_action_result
  2106. {
  2107. typedef typename remove_reference<
  2108. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2109. };
  2110. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2111. template <class EVT,class FSM,class SourceState,class TargetState>
  2112. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2113. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2114. {
  2115. return (Container()(evt,fsm,src,tgt)).find_last_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  2116. }
  2117. template <class Event,class FSM,class STATE>
  2118. typename state_action_result<Event,FSM,STATE>::type
  2119. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2120. {
  2121. return (Container()(evt,fsm,state)).find_last_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  2122. }
  2123. };
  2124. template <class Container,class Param1, class Param2, class Param3>
  2125. struct StringFindLastOf_<
  2126. Container,Param1,Param2,Param3,
  2127. typename ::boost::disable_if<
  2128. typename ::boost::is_same<Param3,void>::type
  2129. >::type
  2130. >
  2131. : euml_action<StringFindLastOf_<Container,Param1,Param2,Param3> >
  2132. {
  2133. template <class Event,class FSM,class STATE >
  2134. struct state_action_result
  2135. {
  2136. typedef typename remove_reference<
  2137. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2138. };
  2139. template <class EVT,class FSM,class SourceState,class TargetState>
  2140. struct transition_action_result
  2141. {
  2142. typedef typename remove_reference<
  2143. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2144. };
  2145. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2146. template <class EVT,class FSM,class SourceState,class TargetState>
  2147. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2148. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2149. {
  2150. return (Container()(evt,fsm,src,tgt)).
  2151. find_last_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  2152. }
  2153. template <class Event,class FSM,class STATE>
  2154. typename state_action_result<Event,FSM,STATE>::type
  2155. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2156. {
  2157. return (Container()(evt,fsm,state)).
  2158. find_last_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  2159. }
  2160. };
  2161. struct string_find_last_of_tag {};
  2162. struct StringFindLastOf_Helper:
  2163. proto::extends< proto::terminal<string_find_last_of_tag>::type, StringFindLastOf_Helper, boost::msm::sm_domain>
  2164. {
  2165. StringFindLastOf_Helper(){}
  2166. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2167. #ifdef BOOST_MSVC
  2168. ,class Arg6
  2169. #endif
  2170. >
  2171. struct In
  2172. {
  2173. typedef StringFindLastOf_<Arg1,Arg2,Arg3,Arg4> type;
  2174. };
  2175. };
  2176. StringFindLastOf_Helper const string_find_last_of_;
  2177. template <class Container, class Param1, class Param2, class Param3, class Enable=void >
  2178. struct StringFindLastNotOf_ : euml_action<StringFindLastNotOf_<Container,Param1,Param2,Param3,Enable> >
  2179. {
  2180. };
  2181. template <class Container,class Param1, class Param2, class Param3>
  2182. struct StringFindLastNotOf_ <
  2183. Container,Param1,Param2,Param3,
  2184. typename ::boost::enable_if<
  2185. typename ::boost::is_same<Param2,void>::type
  2186. >::type
  2187. >
  2188. : euml_action<StringFindLastNotOf_<Container,Param1,Param2,Param3> >
  2189. {
  2190. template <class Event,class FSM,class STATE >
  2191. struct state_action_result
  2192. {
  2193. typedef typename remove_reference<
  2194. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2195. };
  2196. template <class EVT,class FSM,class SourceState,class TargetState>
  2197. struct transition_action_result
  2198. {
  2199. typedef typename remove_reference<
  2200. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2201. };
  2202. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2203. template <class EVT,class FSM,class SourceState,class TargetState>
  2204. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2205. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2206. {
  2207. return (Container()(evt,fsm,src,tgt)).find_last_not_of(Param1()(evt,fsm,src,tgt));
  2208. }
  2209. template <class Event,class FSM,class STATE>
  2210. typename state_action_result<Event,FSM,STATE>::type
  2211. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2212. {
  2213. return (Container()(evt,fsm,state)).find_last_not_of(Param1()(evt,fsm,state));
  2214. }
  2215. };
  2216. template <class Container,class Param1, class Param2, class Param3>
  2217. struct StringFindLastNotOf_ <
  2218. Container,Param1,Param2,Param3,
  2219. typename ::boost::enable_if<
  2220. typename ::boost::mpl::and_<
  2221. typename ::boost::is_same<Param3,void>::type,
  2222. typename ::boost::mpl::not_<
  2223. typename ::boost::is_same<Param2,void>::type
  2224. >::type
  2225. >::type
  2226. >::type
  2227. >
  2228. : euml_action<StringFindLastNotOf_<Container,Param1,Param2,Param3> >
  2229. {
  2230. template <class Event,class FSM,class STATE >
  2231. struct state_action_result
  2232. {
  2233. typedef typename remove_reference<
  2234. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2235. };
  2236. template <class EVT,class FSM,class SourceState,class TargetState>
  2237. struct transition_action_result
  2238. {
  2239. typedef typename remove_reference<
  2240. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2241. };
  2242. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2243. template <class EVT,class FSM,class SourceState,class TargetState>
  2244. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2245. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2246. {
  2247. return (Container()(evt,fsm,src,tgt)).find_last_not_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  2248. }
  2249. template <class Event,class FSM,class STATE>
  2250. typename state_action_result<Event,FSM,STATE>::type
  2251. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2252. {
  2253. return (Container()(evt,fsm,state)).find_last_not_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  2254. }
  2255. };
  2256. template <class Container,class Param1, class Param2, class Param3>
  2257. struct StringFindLastNotOf_<
  2258. Container,Param1,Param2,Param3,
  2259. typename ::boost::disable_if<
  2260. typename ::boost::is_same<Param3,void>::type
  2261. >::type
  2262. >
  2263. : euml_action<StringFindLastNotOf_<Container,Param1,Param2,Param3> >
  2264. {
  2265. template <class Event,class FSM,class STATE >
  2266. struct state_action_result
  2267. {
  2268. typedef typename remove_reference<
  2269. typename get_result_type2<Container,Event,FSM,STATE>::type>::type::size_type type;
  2270. };
  2271. template <class EVT,class FSM,class SourceState,class TargetState>
  2272. struct transition_action_result
  2273. {
  2274. typedef typename remove_reference<
  2275. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type::size_type type;
  2276. };
  2277. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2278. template <class EVT,class FSM,class SourceState,class TargetState>
  2279. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2280. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2281. {
  2282. return (Container()(evt,fsm,src,tgt)).
  2283. find_last_not_of(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  2284. }
  2285. template <class Event,class FSM,class STATE>
  2286. typename state_action_result<Event,FSM,STATE>::type
  2287. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2288. {
  2289. return (Container()(evt,fsm,state)).
  2290. find_last_not_of(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  2291. }
  2292. };
  2293. struct string_find_last_not_of_tag {};
  2294. struct StringFindLastNotOf_Helper:
  2295. proto::extends< proto::terminal<string_find_last_of_tag>::type, StringFindLastNotOf_Helper, boost::msm::sm_domain>
  2296. {
  2297. StringFindLastNotOf_Helper(){}
  2298. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2299. #ifdef BOOST_MSVC
  2300. ,class Arg6
  2301. #endif
  2302. >
  2303. struct In
  2304. {
  2305. typedef StringFindLastNotOf_<Arg1,Arg2,Arg3,Arg4> type;
  2306. };
  2307. };
  2308. StringFindLastNotOf_Helper const string_find_last_not_of_;
  2309. template <class Container>
  2310. struct Npos_ : euml_action<Npos_<Container> >
  2311. {
  2312. Npos_(){}
  2313. template <class Event,class FSM,class STATE >
  2314. struct state_action_result
  2315. {
  2316. typedef typename Container::size_type type;
  2317. };
  2318. template <class EVT,class FSM,class SourceState,class TargetState>
  2319. struct transition_action_result
  2320. {
  2321. typedef typename Container::size_type type;
  2322. };
  2323. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2324. template <class EVT,class FSM,class SourceState,class TargetState>
  2325. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2326. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2327. {
  2328. return Container::npos;
  2329. }
  2330. template <class Event,class FSM,class STATE>
  2331. typename state_action_result<Event,FSM,STATE>::type
  2332. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2333. {
  2334. return Container::npos;
  2335. }
  2336. };
  2337. // version for 2 parameters
  2338. template <class Container, class Param1, class Param2>
  2339. struct Associative_Erase_ : euml_action<Associative_Erase_<Container,Param1,Param2> >
  2340. {
  2341. template <class Event,class FSM,class STATE >
  2342. struct state_action_result
  2343. {
  2344. typedef void type;
  2345. };
  2346. template <class EVT,class FSM,class SourceState,class TargetState>
  2347. struct transition_action_result
  2348. {
  2349. typedef void type;
  2350. };
  2351. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2352. template <class EVT,class FSM,class SourceState,class TargetState>
  2353. typename ::boost::enable_if<
  2354. typename ::boost::mpl::has_key<
  2355. typename Container::tag_type,action_tag>::type,
  2356. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2357. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2358. {
  2359. (Container()(evt,fsm,src,tgt)).erase(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  2360. }
  2361. template <class Event,class FSM,class STATE>
  2362. typename ::boost::enable_if<
  2363. typename ::boost::mpl::has_key<
  2364. typename Container::tag_type,state_action_tag>::type,
  2365. typename state_action_result<Event,FSM,STATE>::type >::type
  2366. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2367. {
  2368. (Container()(evt,fsm,state)).erase(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  2369. }
  2370. };
  2371. // version for 1 parameter
  2372. template <class Container, class Param1>
  2373. struct Associative_Erase_ < Container,Param1,void>
  2374. : euml_action<Associative_Erase_<Container,Param1,void> >
  2375. {
  2376. // return value will actually not be correct for set::erase(it), should be void
  2377. // but it's ok as nobody should call an inexistent return type
  2378. template <class Event,class FSM,class STATE >
  2379. struct state_action_result
  2380. {
  2381. typedef typename get_size_type<
  2382. typename ::boost::remove_reference<
  2383. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  2384. };
  2385. template <class EVT,class FSM,class SourceState,class TargetState>
  2386. struct transition_action_result
  2387. {
  2388. typedef typename get_size_type<
  2389. typename ::boost::remove_reference<
  2390. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2391. };
  2392. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2393. // version for transition + param is an iterator
  2394. template <class EVT,class FSM,class SourceState,class TargetState>
  2395. typename ::boost::enable_if<
  2396. typename ::boost::mpl::and_<
  2397. typename ::boost::mpl::has_key<
  2398. typename Container::tag_type,action_tag>::type,
  2399. typename has_iterator_category<
  2400. typename Param1::template transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2401. >::type
  2402. >::type,
  2403. void
  2404. >::type
  2405. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2406. {
  2407. (Container()(evt,fsm,src,tgt)).erase(Param1()(evt,fsm,src,tgt));
  2408. }
  2409. // version for state action + param is an iterator
  2410. template <class Event,class FSM,class STATE>
  2411. typename ::boost::enable_if<
  2412. typename ::boost::mpl::and_<
  2413. typename ::boost::mpl::has_key<
  2414. typename Container::tag_type,state_action_tag>::type,
  2415. typename has_iterator_category<
  2416. typename Param1::template state_action_result<Event,FSM,STATE>::type
  2417. >::type
  2418. >::type,
  2419. void
  2420. >::type
  2421. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2422. {
  2423. (Container()(evt,fsm,state)).erase(Param1()(evt,fsm,state));
  2424. }
  2425. // version for transition + param not an iterator
  2426. template <class EVT,class FSM,class SourceState,class TargetState>
  2427. typename ::boost::enable_if<
  2428. typename ::boost::mpl::and_<
  2429. typename ::boost::mpl::has_key<
  2430. typename Container::tag_type,action_tag>::type,
  2431. typename ::boost::mpl::not_<
  2432. typename has_iterator_category<
  2433. typename Param1::template transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2434. >::type
  2435. >::type
  2436. >::type,
  2437. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2438. >::type
  2439. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2440. {
  2441. return (Container()(evt,fsm,src,tgt)).erase(Param1()(evt,fsm,src,tgt));
  2442. }
  2443. // version for state action + param not an iterator
  2444. template <class Event,class FSM,class STATE>
  2445. typename ::boost::enable_if<
  2446. typename ::boost::mpl::and_<
  2447. typename ::boost::mpl::has_key<
  2448. typename Container::tag_type,state_action_tag>::type,
  2449. typename ::boost::mpl::not_<
  2450. typename has_iterator_category<
  2451. typename Param1::template state_action_result<Event,FSM,STATE>::type
  2452. >::type
  2453. >::type
  2454. >::type,
  2455. typename state_action_result<Event,FSM,STATE>::type
  2456. >::type
  2457. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2458. {
  2459. return (Container()(evt,fsm,state)).erase(Param1()(evt,fsm,state));
  2460. }
  2461. };
  2462. struct associative_erase_tag {};
  2463. struct Associative_Erase_Helper: proto::extends< proto::terminal<associative_erase_tag>::type, Associative_Erase_Helper, boost::msm::sm_domain>
  2464. {
  2465. Associative_Erase_Helper(){}
  2466. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2467. #ifdef BOOST_MSVC
  2468. ,class Arg6
  2469. #endif
  2470. >
  2471. struct In
  2472. {
  2473. typedef Associative_Erase_<Arg1,Arg2,Arg3> type;
  2474. };
  2475. };
  2476. Associative_Erase_Helper const associative_erase_;
  2477. template <class T, class Param>
  2478. struct Associative_Find_ : euml_action<Associative_Find_<T,Param> >
  2479. {
  2480. template <class Event,class FSM,class STATE >
  2481. struct state_action_result
  2482. {
  2483. typedef typename get_iterator<
  2484. typename ::boost::remove_reference<
  2485. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  2486. };
  2487. template <class EVT,class FSM,class SourceState,class TargetState>
  2488. struct transition_action_result
  2489. {
  2490. typedef typename get_iterator<
  2491. typename ::boost::remove_reference<
  2492. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2493. };
  2494. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2495. template <class EVT,class FSM,class SourceState,class TargetState>
  2496. typename ::boost::enable_if<
  2497. typename ::boost::mpl::has_key<
  2498. typename T::tag_type,action_tag>::type,
  2499. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2500. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2501. {
  2502. return (T()(evt,fsm,src,tgt)).find(Param()(evt,fsm,src,tgt));
  2503. }
  2504. template <class Event,class FSM,class STATE>
  2505. typename ::boost::enable_if<
  2506. typename ::boost::mpl::has_key<
  2507. typename T::tag_type,state_action_tag>::type,
  2508. typename state_action_result<Event,FSM,STATE>::type >::type
  2509. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2510. {
  2511. return (T()(evt,fsm,state)).find(Param()(evt,fsm,state));
  2512. }
  2513. };
  2514. struct associative_find_tag {};
  2515. struct Associative_Find_Helper: proto::extends< proto::terminal<associative_find_tag>::type, Associative_Find_Helper, boost::msm::sm_domain>
  2516. {
  2517. Associative_Find_Helper(){}
  2518. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2519. #ifdef BOOST_MSVC
  2520. ,class Arg6
  2521. #endif
  2522. >
  2523. struct In
  2524. {
  2525. typedef Associative_Find_<Arg1,Arg2> type;
  2526. };
  2527. };
  2528. Associative_Find_Helper const associative_find_;
  2529. template <class Container,class Param>
  2530. struct AssociativeCount_ : euml_action<AssociativeCount_<Container,Param> >
  2531. {
  2532. template <class Event,class FSM,class STATE >
  2533. struct state_action_result
  2534. {
  2535. typedef typename get_size_type<
  2536. typename ::boost::remove_reference<
  2537. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  2538. };
  2539. template <class EVT,class FSM,class SourceState,class TargetState>
  2540. struct transition_action_result
  2541. {
  2542. typedef typename get_size_type<
  2543. typename ::boost::remove_reference<
  2544. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2545. };
  2546. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2547. template <class EVT,class FSM,class SourceState,class TargetState>
  2548. typename ::boost::enable_if<
  2549. typename ::boost::mpl::has_key<
  2550. typename Container::tag_type,action_tag>::type,
  2551. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2552. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2553. {
  2554. return (Container()(evt,fsm,src,tgt)).count(Param()(evt,fsm,src,tgt));
  2555. }
  2556. template <class Event,class FSM,class STATE>
  2557. typename ::boost::enable_if<
  2558. typename ::boost::mpl::has_key<
  2559. typename Container::tag_type,state_action_tag>::type,
  2560. typename state_action_result<Event,FSM,STATE>::type >::type
  2561. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2562. {
  2563. return (Container()(evt,fsm,state)).count(Param()(evt,fsm,state));
  2564. }
  2565. };
  2566. struct associative_count_tag {};
  2567. struct AssociativeCount_Helper: proto::extends< proto::terminal<associative_count_tag>::type, AssociativeCount_Helper, boost::msm::sm_domain>
  2568. {
  2569. AssociativeCount_Helper(){}
  2570. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2571. #ifdef BOOST_MSVC
  2572. ,class Arg6
  2573. #endif
  2574. >
  2575. struct In
  2576. {
  2577. typedef AssociativeCount_<Arg1,Arg2> type;
  2578. };
  2579. };
  2580. AssociativeCount_Helper const associative_count_;
  2581. template <class T, class Param>
  2582. struct Associative_Lower_Bound_ : euml_action<Associative_Lower_Bound_<T,Param> >
  2583. {
  2584. template <class Event,class FSM,class STATE >
  2585. struct state_action_result
  2586. {
  2587. typedef typename get_iterator<
  2588. typename ::boost::remove_reference<
  2589. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  2590. };
  2591. template <class EVT,class FSM,class SourceState,class TargetState>
  2592. struct transition_action_result
  2593. {
  2594. typedef typename get_iterator<
  2595. typename ::boost::remove_reference<
  2596. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2597. };
  2598. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2599. template <class EVT,class FSM,class SourceState,class TargetState>
  2600. typename ::boost::enable_if<
  2601. typename ::boost::mpl::has_key<
  2602. typename T::tag_type,action_tag>::type,
  2603. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2604. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2605. {
  2606. return (T()(evt,fsm,src,tgt)).lower_bound(Param()(evt,fsm,src,tgt));
  2607. }
  2608. template <class Event,class FSM,class STATE>
  2609. typename ::boost::enable_if<
  2610. typename ::boost::mpl::has_key<
  2611. typename T::tag_type,state_action_tag>::type,
  2612. typename state_action_result<Event,FSM,STATE>::type >::type
  2613. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2614. {
  2615. return (T()(evt,fsm,state)).lower_bound(Param()(evt,fsm,state));
  2616. }
  2617. };
  2618. struct associative_lower_bound_tag {};
  2619. struct Associative_Lower_Bound_Helper: proto::extends< proto::terminal<associative_lower_bound_tag>::type,
  2620. Associative_Lower_Bound_Helper, boost::msm::sm_domain>
  2621. {
  2622. Associative_Lower_Bound_Helper(){}
  2623. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2624. #ifdef BOOST_MSVC
  2625. ,class Arg6
  2626. #endif
  2627. >
  2628. struct In
  2629. {
  2630. typedef Associative_Lower_Bound_<Arg1,Arg2> type;
  2631. };
  2632. };
  2633. Associative_Lower_Bound_Helper const associative_lower_bound_;
  2634. template <class T, class Param>
  2635. struct Associative_Upper_Bound_ : euml_action<Associative_Upper_Bound_<T,Param> >
  2636. {
  2637. template <class Event,class FSM,class STATE >
  2638. struct state_action_result
  2639. {
  2640. typedef typename get_iterator<
  2641. typename ::boost::remove_reference<
  2642. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  2643. };
  2644. template <class EVT,class FSM,class SourceState,class TargetState>
  2645. struct transition_action_result
  2646. {
  2647. typedef typename get_iterator<
  2648. typename ::boost::remove_reference<
  2649. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2650. };
  2651. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2652. template <class EVT,class FSM,class SourceState,class TargetState>
  2653. typename ::boost::enable_if<
  2654. typename ::boost::mpl::has_key<
  2655. typename T::tag_type,action_tag>::type,
  2656. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2657. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2658. {
  2659. return (T()(evt,fsm,src,tgt)).upper_bound(Param()(evt,fsm,src,tgt));
  2660. }
  2661. template <class Event,class FSM,class STATE>
  2662. typename ::boost::enable_if<
  2663. typename ::boost::mpl::has_key<
  2664. typename T::tag_type,state_action_tag>::type,
  2665. typename state_action_result<Event,FSM,STATE>::type >::type
  2666. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2667. {
  2668. return (T()(evt,fsm,state)).upper_bound(Param()(evt,fsm,state));
  2669. }
  2670. };
  2671. struct associative_upper_bound_tag {};
  2672. struct Associative_Upper_Bound_Helper: proto::extends< proto::terminal<associative_upper_bound_tag>::type,
  2673. Associative_Upper_Bound_Helper, boost::msm::sm_domain>
  2674. {
  2675. Associative_Upper_Bound_Helper(){}
  2676. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2677. #ifdef BOOST_MSVC
  2678. ,class Arg6
  2679. #endif
  2680. >
  2681. struct In
  2682. {
  2683. typedef Associative_Upper_Bound_<Arg1,Arg2> type;
  2684. };
  2685. };
  2686. Associative_Upper_Bound_Helper const associative_upper_bound_;
  2687. template <class T>
  2688. struct First_ : euml_action<First_<T> >
  2689. {
  2690. template <class Event,class FSM,class STATE >
  2691. struct state_action_result
  2692. {
  2693. typedef typename get_first_type<
  2694. typename ::boost::remove_reference<
  2695. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  2696. };
  2697. template <class EVT,class FSM,class SourceState,class TargetState>
  2698. struct transition_action_result
  2699. {
  2700. typedef typename get_first_type<
  2701. typename ::boost::remove_reference<
  2702. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2703. };
  2704. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2705. template <class EVT,class FSM,class SourceState,class TargetState>
  2706. typename ::boost::enable_if<
  2707. typename ::boost::mpl::has_key<
  2708. typename T::tag_type,action_tag>::type,
  2709. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2710. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2711. {
  2712. return (T()(evt,fsm,src,tgt)).first;
  2713. }
  2714. template <class Event,class FSM,class STATE>
  2715. typename ::boost::enable_if<
  2716. typename ::boost::mpl::has_key<
  2717. typename T::tag_type,state_action_tag>::type,
  2718. typename state_action_result<Event,FSM,STATE>::type >::type
  2719. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2720. {
  2721. return (T()(evt,fsm,state)).first;
  2722. }
  2723. };
  2724. struct first_tag {};
  2725. struct First_Helper: proto::extends< proto::terminal<first_tag>::type, First_Helper, boost::msm::sm_domain>
  2726. {
  2727. First_Helper(){}
  2728. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2729. #ifdef BOOST_MSVC
  2730. ,class Arg6
  2731. #endif
  2732. >
  2733. struct In
  2734. {
  2735. typedef First_<Arg1> type;
  2736. };
  2737. };
  2738. First_Helper const first_;
  2739. template <class T>
  2740. struct Second_ : euml_action<Second_<T> >
  2741. {
  2742. template <class Event,class FSM,class STATE >
  2743. struct state_action_result
  2744. {
  2745. typedef typename get_second_type<
  2746. typename ::boost::remove_reference<
  2747. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type type;
  2748. };
  2749. template <class EVT,class FSM,class SourceState,class TargetState>
  2750. struct transition_action_result
  2751. {
  2752. typedef typename get_second_type<
  2753. typename ::boost::remove_reference<
  2754. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  2755. };
  2756. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2757. template <class EVT,class FSM,class SourceState,class TargetState>
  2758. typename ::boost::enable_if<
  2759. typename ::boost::mpl::has_key<
  2760. typename T::tag_type,action_tag>::type,
  2761. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2762. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2763. {
  2764. return (T()(evt,fsm,src,tgt)).second;
  2765. }
  2766. template <class Event,class FSM,class STATE>
  2767. typename ::boost::enable_if<
  2768. typename ::boost::mpl::has_key<
  2769. typename T::tag_type,state_action_tag>::type,
  2770. typename state_action_result<Event,FSM,STATE>::type >::type
  2771. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2772. {
  2773. return (T()(evt,fsm,state)).second;
  2774. }
  2775. };
  2776. struct second_tag {};
  2777. struct Second_Helper: proto::extends< proto::terminal<second_tag>::type, Second_Helper, boost::msm::sm_domain>
  2778. {
  2779. Second_Helper(){}
  2780. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2781. #ifdef BOOST_MSVC
  2782. ,class Arg6
  2783. #endif
  2784. >
  2785. struct In
  2786. {
  2787. typedef Second_<Arg1> type;
  2788. };
  2789. };
  2790. Second_Helper const second_;
  2791. template <class T, class Param>
  2792. struct Associative_Equal_Range_ : euml_action<Associative_Equal_Range_<T,Param> >
  2793. {
  2794. template <class Event,class FSM,class STATE >
  2795. struct state_action_result
  2796. {
  2797. typedef std::pair<
  2798. typename get_iterator<
  2799. typename ::boost::remove_reference<
  2800. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type,
  2801. typename get_iterator<
  2802. typename ::boost::remove_reference<
  2803. typename get_result_type2<T,Event,FSM,STATE>::type>::type>::type > type;
  2804. };
  2805. template <class EVT,class FSM,class SourceState,class TargetState>
  2806. struct transition_action_result
  2807. {
  2808. typedef std::pair<
  2809. typename get_iterator<
  2810. typename ::boost::remove_reference<
  2811. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type,
  2812. typename get_iterator<
  2813. typename ::boost::remove_reference<
  2814. typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type>::type > type;
  2815. };
  2816. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2817. template <class EVT,class FSM,class SourceState,class TargetState>
  2818. typename ::boost::enable_if<
  2819. typename ::boost::mpl::has_key<
  2820. typename T::tag_type,action_tag>::type,
  2821. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2822. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2823. {
  2824. return (T()(evt,fsm,src,tgt)).equal_range(Param()(evt,fsm,src,tgt));
  2825. }
  2826. template <class Event,class FSM,class STATE>
  2827. typename ::boost::enable_if<
  2828. typename ::boost::mpl::has_key<
  2829. typename T::tag_type,state_action_tag>::type,
  2830. typename state_action_result<Event,FSM,STATE>::type >::type
  2831. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2832. {
  2833. return (T()(evt,fsm,state)).equal_range(Param()(evt,fsm,state));
  2834. }
  2835. };
  2836. struct associative_equal_range_tag {};
  2837. struct Associative_Equal_Range_Helper: proto::extends< proto::terminal<associative_equal_range_tag>::type,
  2838. Associative_Equal_Range_Helper, boost::msm::sm_domain>
  2839. {
  2840. Associative_Equal_Range_Helper(){}
  2841. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2842. #ifdef BOOST_MSVC
  2843. ,class Arg6
  2844. #endif
  2845. >
  2846. struct In
  2847. {
  2848. typedef Associative_Equal_Range_<Arg1,Arg2> type;
  2849. };
  2850. };
  2851. Associative_Equal_Range_Helper const associative_equal_range_;
  2852. template <class Container,class Param1, class Param2>
  2853. struct Substr_ : euml_action<Substr_<Container,Param1,Param2> >
  2854. {
  2855. template <class Event,class FSM,class STATE >
  2856. struct state_action_result
  2857. {
  2858. typedef typename remove_reference<
  2859. typename get_result_type2<Container,Event,FSM,STATE>::type>::type type;
  2860. };
  2861. template <class EVT,class FSM,class SourceState,class TargetState>
  2862. struct transition_action_result
  2863. {
  2864. typedef typename remove_reference<
  2865. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type type;
  2866. };
  2867. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2868. template <class EVT,class FSM,class SourceState,class TargetState>
  2869. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2870. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2871. {
  2872. return (Container()(evt,fsm,src,tgt)).
  2873. substr(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  2874. }
  2875. template <class Event,class FSM,class STATE>
  2876. typename state_action_result<Event,FSM,STATE>::type
  2877. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2878. {
  2879. return (Container()(evt,fsm,state)).
  2880. substr(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  2881. }
  2882. };
  2883. template <class Container>
  2884. struct Substr_ <Container,void,void>
  2885. : euml_action<Substr_<Container,void,void> >
  2886. {
  2887. template <class Event,class FSM,class STATE >
  2888. struct state_action_result
  2889. {
  2890. typedef typename remove_reference<
  2891. typename get_result_type2<Container,Event,FSM,STATE>::type>::type type;
  2892. };
  2893. template <class EVT,class FSM,class SourceState,class TargetState>
  2894. struct transition_action_result
  2895. {
  2896. typedef typename remove_reference<
  2897. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type type;
  2898. };
  2899. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2900. template <class EVT,class FSM,class SourceState,class TargetState>
  2901. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2902. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2903. {
  2904. return (Container()(evt,fsm,src,tgt)).substr();
  2905. }
  2906. template <class Event,class FSM,class STATE>
  2907. typename state_action_result<Event,FSM,STATE>::type
  2908. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2909. {
  2910. return (Container()(evt,fsm,state)).substr();
  2911. }
  2912. };
  2913. template <class Container,class Param1>
  2914. struct Substr_ < Container,Param1,void>
  2915. : euml_action<Substr_<Container,Param1,void> >
  2916. {
  2917. template <class Event,class FSM,class STATE >
  2918. struct state_action_result
  2919. {
  2920. typedef typename remove_reference<
  2921. typename get_result_type2<Container,Event,FSM,STATE>::type>::type type;
  2922. };
  2923. template <class EVT,class FSM,class SourceState,class TargetState>
  2924. struct transition_action_result
  2925. {
  2926. typedef typename remove_reference<
  2927. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type type;
  2928. };
  2929. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2930. template <class EVT,class FSM,class SourceState,class TargetState>
  2931. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  2932. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2933. {
  2934. return (Container()(evt,fsm,src,tgt)).substr(Param1()(evt,fsm,src,tgt));
  2935. }
  2936. template <class Event,class FSM,class STATE>
  2937. typename state_action_result<Event,FSM,STATE>::type
  2938. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2939. {
  2940. return (Container()(evt,fsm,state)).substr(Param1()(evt,fsm,state));
  2941. }
  2942. };
  2943. struct substr_tag {};
  2944. struct Substr_Helper: proto::extends< proto::terminal<substr_tag>::type, Substr_Helper, boost::msm::sm_domain>
  2945. {
  2946. Substr_Helper(){}
  2947. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  2948. #ifdef BOOST_MSVC
  2949. ,class Arg6
  2950. #endif
  2951. >
  2952. struct In
  2953. {
  2954. typedef Substr_<Arg1,Arg2,Arg3> type;
  2955. };
  2956. };
  2957. Substr_Helper const substr_;
  2958. template <class Container, class Param1, class Param2, class Param3, class Param4 >
  2959. struct StringCompare_ : euml_action<StringCompare_<Container,Param1,Param2,Param3,Param4> >
  2960. {
  2961. template <class Event,class FSM,class STATE >
  2962. struct state_action_result
  2963. {
  2964. typedef int type;
  2965. };
  2966. template <class EVT,class FSM,class SourceState,class TargetState>
  2967. struct transition_action_result
  2968. {
  2969. typedef int type;
  2970. };
  2971. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  2972. template <class EVT,class FSM,class SourceState,class TargetState>
  2973. typename ::boost::enable_if<
  2974. typename ::boost::mpl::has_key<
  2975. typename Container::tag_type,action_tag>::type,
  2976. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  2977. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  2978. {
  2979. return (Container()(evt,fsm,src,tgt)).compare(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  2980. Param3()(evt,fsm,src,tgt),Param4()(evt,fsm,src,tgt));
  2981. }
  2982. template <class Event,class FSM,class STATE>
  2983. typename ::boost::enable_if<
  2984. typename ::boost::mpl::has_key<
  2985. typename Container::tag_type,state_action_tag>::type,
  2986. typename state_action_result<Event,FSM,STATE>::type >::type
  2987. operator()(Event const& evt,FSM& fsm,STATE& state )const
  2988. {
  2989. return (Container()(evt,fsm,state)).compare(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  2990. Param3()(evt,fsm,state),Param4()(evt,fsm,state));
  2991. }
  2992. };
  2993. template <class Container, class Param1 >
  2994. struct StringCompare_<Container,Param1,void,void,void>
  2995. : euml_action<StringCompare_<Container,Param1,void,void,void> >
  2996. {
  2997. template <class Event,class FSM,class STATE >
  2998. struct state_action_result
  2999. {
  3000. typedef int type;
  3001. };
  3002. template <class EVT,class FSM,class SourceState,class TargetState>
  3003. struct transition_action_result
  3004. {
  3005. typedef int type;
  3006. };
  3007. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3008. template <class EVT,class FSM,class SourceState,class TargetState>
  3009. typename ::boost::enable_if<
  3010. typename ::boost::mpl::has_key<
  3011. typename Container::tag_type,action_tag>::type,
  3012. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3013. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3014. {
  3015. return (Container()(evt,fsm,src,tgt)).compare(Param1()(evt,fsm,src,tgt));
  3016. }
  3017. template <class Event,class FSM,class STATE>
  3018. typename ::boost::enable_if<
  3019. typename ::boost::mpl::has_key<
  3020. typename Container::tag_type,state_action_tag>::type,
  3021. typename state_action_result<Event,FSM,STATE>::type >::type
  3022. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3023. {
  3024. return (Container()(evt,fsm,state)).compare(Param1()(evt,fsm,state));
  3025. }
  3026. };
  3027. template <class Container, class Param1, class Param2>
  3028. struct StringCompare_<Container,Param1,Param2,void,void>
  3029. : euml_action<StringCompare_<Container,Param1,Param2,void,void> >
  3030. {
  3031. template <class Event,class FSM,class STATE >
  3032. struct state_action_result
  3033. {
  3034. typedef int type;
  3035. };
  3036. template <class EVT,class FSM,class SourceState,class TargetState>
  3037. struct transition_action_result
  3038. {
  3039. typedef int type;
  3040. };
  3041. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3042. template <class EVT,class FSM,class SourceState,class TargetState>
  3043. typename ::boost::enable_if<
  3044. typename ::boost::mpl::has_key<
  3045. typename Container::tag_type,action_tag>::type,
  3046. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3047. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3048. {
  3049. return (Container()(evt,fsm,src,tgt)).compare(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  3050. }
  3051. template <class Event,class FSM,class STATE>
  3052. typename ::boost::enable_if<
  3053. typename ::boost::mpl::has_key<
  3054. typename Container::tag_type,state_action_tag>::type,
  3055. typename state_action_result<Event,FSM,STATE>::type >::type
  3056. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3057. {
  3058. return (Container()(evt,fsm,state)).compare(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  3059. }
  3060. };
  3061. template <class Container, class Param1, class Param2, class Param3 >
  3062. struct StringCompare_<Container,Param1,Param2,Param3,void>
  3063. : euml_action<StringCompare_<Container,Param1,Param2,Param3,void> >
  3064. {
  3065. template <class Event,class FSM,class STATE >
  3066. struct state_action_result
  3067. {
  3068. typedef int type;
  3069. };
  3070. template <class EVT,class FSM,class SourceState,class TargetState>
  3071. struct transition_action_result
  3072. {
  3073. typedef int type;
  3074. };
  3075. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3076. template <class EVT,class FSM,class SourceState,class TargetState>
  3077. typename ::boost::enable_if<
  3078. typename ::boost::mpl::has_key<
  3079. typename Container::tag_type,action_tag>::type,
  3080. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3081. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3082. {
  3083. return (Container()(evt,fsm,src,tgt)).compare(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3084. Param3()(evt,fsm,src,tgt));
  3085. }
  3086. template <class Event,class FSM,class STATE>
  3087. typename ::boost::enable_if<
  3088. typename ::boost::mpl::has_key<
  3089. typename Container::tag_type,state_action_tag>::type,
  3090. typename state_action_result<Event,FSM,STATE>::type >::type
  3091. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3092. {
  3093. return (Container()(evt,fsm,state)).compare(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3094. Param3()(evt,fsm,state));
  3095. }
  3096. };
  3097. struct string_compare_tag {};
  3098. struct StringCompare_Helper: proto::extends< proto::terminal<string_compare_tag>::type, StringCompare_Helper, boost::msm::sm_domain>
  3099. {
  3100. StringCompare_Helper(){}
  3101. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3102. #ifdef BOOST_MSVC
  3103. ,class Arg6
  3104. #endif
  3105. >
  3106. struct In
  3107. {
  3108. typedef StringCompare_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
  3109. };
  3110. };
  3111. StringCompare_Helper const string_compare_;
  3112. template <class Container, class Param1, class Param2, class Param3 >
  3113. struct Append_ : euml_action<Append_<Container,Param1,Param2,Param3> >
  3114. {
  3115. template <class Event,class FSM,class STATE >
  3116. struct state_action_result
  3117. {
  3118. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3119. };
  3120. template <class EVT,class FSM,class SourceState,class TargetState>
  3121. struct transition_action_result
  3122. {
  3123. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3124. };
  3125. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3126. template <class EVT,class FSM,class SourceState,class TargetState>
  3127. typename ::boost::enable_if<
  3128. typename ::boost::mpl::has_key<
  3129. typename Container::tag_type,action_tag>::type,
  3130. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3131. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3132. {
  3133. return (Container()(evt,fsm,src,tgt)).append (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3134. Param3()(evt,fsm,src,tgt));
  3135. }
  3136. template <class Event,class FSM,class STATE>
  3137. typename ::boost::enable_if<
  3138. typename ::boost::mpl::has_key<
  3139. typename Container::tag_type,state_action_tag>::type,
  3140. typename state_action_result<Event,FSM,STATE>::type >::type
  3141. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3142. {
  3143. return (Container()(evt,fsm,state)).append (Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3144. Param3()(evt,fsm,state));
  3145. }
  3146. };
  3147. template <class Container, class Param1>
  3148. struct Append_<Container,Param1,void,void>
  3149. : euml_action<Append_<Container,Param1,void,void> >
  3150. {
  3151. template <class Event,class FSM,class STATE >
  3152. struct state_action_result
  3153. {
  3154. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3155. };
  3156. template <class EVT,class FSM,class SourceState,class TargetState>
  3157. struct transition_action_result
  3158. {
  3159. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3160. };
  3161. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3162. template <class EVT,class FSM,class SourceState,class TargetState>
  3163. typename ::boost::enable_if<
  3164. typename ::boost::mpl::has_key<
  3165. typename Container::tag_type,action_tag>::type,
  3166. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3167. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3168. {
  3169. return (Container()(evt,fsm,src,tgt)).append(Param1()(evt,fsm,src,tgt));
  3170. }
  3171. template <class Event,class FSM,class STATE>
  3172. typename ::boost::enable_if<
  3173. typename ::boost::mpl::has_key<
  3174. typename Container::tag_type,state_action_tag>::type,
  3175. typename state_action_result<Event,FSM,STATE>::type >::type
  3176. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3177. {
  3178. return (Container()(evt,fsm,state)).append(Param1()(evt,fsm,state));
  3179. }
  3180. };
  3181. template <class Container, class Param1, class Param2 >
  3182. struct Append_<Container,Param1,Param2,void>
  3183. : euml_action<Append_<Container,Param1,Param2,void> >
  3184. {
  3185. template <class Event,class FSM,class STATE >
  3186. struct state_action_result
  3187. {
  3188. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3189. };
  3190. template <class EVT,class FSM,class SourceState,class TargetState>
  3191. struct transition_action_result
  3192. {
  3193. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3194. };
  3195. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3196. template <class EVT,class FSM,class SourceState,class TargetState>
  3197. typename ::boost::enable_if<
  3198. typename ::boost::mpl::has_key<
  3199. typename Container::tag_type,action_tag>::type,
  3200. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3201. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3202. {
  3203. return (Container()(evt,fsm,src,tgt)).append(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  3204. }
  3205. template <class Event,class FSM,class STATE>
  3206. typename ::boost::enable_if<
  3207. typename ::boost::mpl::has_key<
  3208. typename Container::tag_type,state_action_tag>::type,
  3209. typename state_action_result<Event,FSM,STATE>::type >::type
  3210. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3211. {
  3212. return (Container()(evt,fsm,state)).append(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  3213. }
  3214. };
  3215. struct append_tag {};
  3216. struct Append_Helper: proto::extends< proto::terminal<append_tag>::type, Append_Helper, boost::msm::sm_domain>
  3217. {
  3218. Append_Helper(){}
  3219. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3220. #ifdef BOOST_MSVC
  3221. ,class Arg6
  3222. #endif
  3223. >
  3224. struct In
  3225. {
  3226. typedef Append_<Arg1,Arg2,Arg3,Arg4> type;
  3227. };
  3228. };
  3229. Append_Helper const append_;
  3230. template <class Container, class Param1, class Param2, class Param3, class Param4 >
  3231. struct StringInsert_ : euml_action<StringInsert_<Container,Param1,Param2,Param3,Param4> >
  3232. {
  3233. template <class Event,class FSM,class STATE >
  3234. struct state_action_result
  3235. {
  3236. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3237. };
  3238. template <class EVT,class FSM,class SourceState,class TargetState>
  3239. struct transition_action_result
  3240. {
  3241. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3242. };
  3243. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3244. template <class EVT,class FSM,class SourceState,class TargetState>
  3245. typename ::boost::enable_if<
  3246. typename ::boost::mpl::has_key<
  3247. typename Container::tag_type,action_tag>::type,
  3248. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3249. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3250. {
  3251. return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3252. Param3()(evt,fsm,src,tgt),Param4()(evt,fsm,src,tgt));
  3253. }
  3254. template <class Event,class FSM,class STATE>
  3255. typename ::boost::enable_if<
  3256. typename ::boost::mpl::has_key<
  3257. typename Container::tag_type,state_action_tag>::type,
  3258. typename state_action_result<Event,FSM,STATE>::type >::type
  3259. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3260. {
  3261. return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3262. Param3()(evt,fsm,state),Param4()(evt,fsm,state));
  3263. }
  3264. };
  3265. template <class Container, class Param1, class Param2>
  3266. struct StringInsert_ <Container,Param1,Param2,void,void>
  3267. : euml_action<StringInsert_<Container,Param1,Param2,void,void> >
  3268. {
  3269. template <class Event,class FSM,class STATE >
  3270. struct state_action_result
  3271. {
  3272. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3273. };
  3274. template <class EVT,class FSM,class SourceState,class TargetState>
  3275. struct transition_action_result
  3276. {
  3277. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3278. };
  3279. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3280. template <class EVT,class FSM,class SourceState,class TargetState>
  3281. typename ::boost::enable_if<
  3282. typename ::boost::mpl::has_key<
  3283. typename Container::tag_type,action_tag>::type,
  3284. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3285. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3286. {
  3287. return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  3288. }
  3289. template <class Event,class FSM,class STATE>
  3290. typename ::boost::enable_if<
  3291. typename ::boost::mpl::has_key<
  3292. typename Container::tag_type,state_action_tag>::type,
  3293. typename state_action_result<Event,FSM,STATE>::type >::type
  3294. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3295. {
  3296. return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  3297. }
  3298. };
  3299. template <class Container, class Param1, class Param2, class Param3>
  3300. struct StringInsert_<Container,Param1,Param2,Param3,void>
  3301. : euml_action<StringInsert_<Container,Param1,Param2,Param3,void> >
  3302. {
  3303. template <class Event,class FSM,class STATE >
  3304. struct state_action_result
  3305. {
  3306. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3307. };
  3308. template <class EVT,class FSM,class SourceState,class TargetState>
  3309. struct transition_action_result
  3310. {
  3311. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3312. };
  3313. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3314. template <class EVT,class FSM,class SourceState,class TargetState>
  3315. typename ::boost::enable_if<
  3316. typename ::boost::mpl::has_key<
  3317. typename Container::tag_type,action_tag>::type,
  3318. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3319. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3320. {
  3321. return (Container()(evt,fsm,src,tgt)).insert(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3322. Param3()(evt,fsm,src,tgt));
  3323. }
  3324. template <class Event,class FSM,class STATE>
  3325. typename ::boost::enable_if<
  3326. typename ::boost::mpl::has_key<
  3327. typename Container::tag_type,state_action_tag>::type,
  3328. typename state_action_result<Event,FSM,STATE>::type >::type
  3329. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3330. {
  3331. return (Container()(evt,fsm,state)).insert(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3332. Param3()(evt,fsm,state));
  3333. }
  3334. };
  3335. struct string_insert_tag {};
  3336. struct StringInsert_Helper: proto::extends< proto::terminal<string_insert_tag>::type, StringInsert_Helper, boost::msm::sm_domain>
  3337. {
  3338. StringInsert_Helper(){}
  3339. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3340. #ifdef BOOST_MSVC
  3341. ,class Arg6
  3342. #endif
  3343. >
  3344. struct In
  3345. {
  3346. typedef StringInsert_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
  3347. };
  3348. };
  3349. StringInsert_Helper const string_insert_;
  3350. template <class Container,class Param1, class Param2>
  3351. struct StringErase_ : euml_action<StringErase_<Container,Param1,Param2> >
  3352. {
  3353. template <class Event,class FSM,class STATE >
  3354. struct state_action_result
  3355. {
  3356. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3357. };
  3358. template <class EVT,class FSM,class SourceState,class TargetState>
  3359. struct transition_action_result
  3360. {
  3361. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3362. };
  3363. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3364. template <class EVT,class FSM,class SourceState,class TargetState>
  3365. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  3366. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3367. {
  3368. return (Container()(evt,fsm,src,tgt)).
  3369. erase(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  3370. }
  3371. template <class Event,class FSM,class STATE>
  3372. typename state_action_result<Event,FSM,STATE>::type
  3373. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3374. {
  3375. return (Container()(evt,fsm,state)).
  3376. erase(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  3377. }
  3378. };
  3379. template <class Container>
  3380. struct StringErase_ <Container,void,void>
  3381. : euml_action<StringErase_<Container,void,void> >
  3382. {
  3383. template <class Event,class FSM,class STATE >
  3384. struct state_action_result
  3385. {
  3386. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3387. };
  3388. template <class EVT,class FSM,class SourceState,class TargetState>
  3389. struct transition_action_result
  3390. {
  3391. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3392. };
  3393. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3394. template <class EVT,class FSM,class SourceState,class TargetState>
  3395. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  3396. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3397. {
  3398. return (Container()(evt,fsm,src,tgt)).erase();
  3399. }
  3400. template <class Event,class FSM,class STATE>
  3401. typename state_action_result<Event,FSM,STATE>::type
  3402. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3403. {
  3404. return (Container()(evt,fsm,state)).erase();
  3405. }
  3406. };
  3407. template <class Container,class Param1>
  3408. struct StringErase_ <Container,Param1,void>
  3409. : euml_action<StringErase_<Container,Param1,void> >
  3410. {
  3411. template <class Event,class FSM,class STATE >
  3412. struct state_action_result
  3413. {
  3414. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3415. };
  3416. template <class EVT,class FSM,class SourceState,class TargetState>
  3417. struct transition_action_result
  3418. {
  3419. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3420. };
  3421. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3422. template <class EVT,class FSM,class SourceState,class TargetState>
  3423. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  3424. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3425. {
  3426. return (Container()(evt,fsm,src,tgt)).erase(Param1()(evt,fsm,src,tgt));
  3427. }
  3428. template <class Event,class FSM,class STATE>
  3429. typename state_action_result<Event,FSM,STATE>::type
  3430. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3431. {
  3432. return (Container()(evt,fsm,state)).erase(Param1()(evt,fsm,state));
  3433. }
  3434. };
  3435. struct string_erase_tag {};
  3436. struct StringErase_Helper: proto::extends< proto::terminal<string_erase_tag>::type, StringErase_Helper, boost::msm::sm_domain>
  3437. {
  3438. StringErase_Helper(){}
  3439. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3440. #ifdef BOOST_MSVC
  3441. ,class Arg6
  3442. #endif
  3443. >
  3444. struct In
  3445. {
  3446. typedef StringErase_<Arg1,Arg2,Arg3> type;
  3447. };
  3448. };
  3449. StringErase_Helper const string_erase_;
  3450. template <class Container, class Param1, class Param2, class Param3 >
  3451. struct StringAssign_ : euml_action<StringAssign_<Container,Param1,Param2,Param3> >
  3452. {
  3453. template <class Event,class FSM,class STATE >
  3454. struct state_action_result
  3455. {
  3456. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3457. };
  3458. template <class EVT,class FSM,class SourceState,class TargetState>
  3459. struct transition_action_result
  3460. {
  3461. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3462. };
  3463. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3464. template <class EVT,class FSM,class SourceState,class TargetState>
  3465. typename ::boost::enable_if<
  3466. typename ::boost::mpl::has_key<
  3467. typename Container::tag_type,action_tag>::type,
  3468. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3469. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3470. {
  3471. return (Container()(evt,fsm,src,tgt)).assign (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3472. Param3()(evt,fsm,src,tgt));
  3473. }
  3474. template <class Event,class FSM,class STATE>
  3475. typename ::boost::enable_if<
  3476. typename ::boost::mpl::has_key<
  3477. typename Container::tag_type,state_action_tag>::type,
  3478. typename state_action_result<Event,FSM,STATE>::type >::type
  3479. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3480. {
  3481. return (Container()(evt,fsm,state)).assign (Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3482. Param3()(evt,fsm,state));
  3483. }
  3484. };
  3485. template <class Container,class Param1>
  3486. struct StringAssign_ <
  3487. Container,Param1,void,void>
  3488. : euml_action<StringAssign_<Container,Param1,void,void> >
  3489. {
  3490. template <class Event,class FSM,class STATE >
  3491. struct state_action_result
  3492. {
  3493. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3494. };
  3495. template <class EVT,class FSM,class SourceState,class TargetState>
  3496. struct transition_action_result
  3497. {
  3498. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3499. };
  3500. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3501. template <class EVT,class FSM,class SourceState,class TargetState>
  3502. typename ::boost::enable_if<
  3503. typename ::boost::mpl::has_key<
  3504. typename Container::tag_type,action_tag>::type,
  3505. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3506. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3507. {
  3508. return (Container()(evt,fsm,src,tgt)).assign(Param1()(evt,fsm,src,tgt));
  3509. }
  3510. template <class Event,class FSM,class STATE>
  3511. typename ::boost::enable_if<
  3512. typename ::boost::mpl::has_key<
  3513. typename Container::tag_type,state_action_tag>::type,
  3514. typename state_action_result<Event,FSM,STATE>::type >::type
  3515. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3516. {
  3517. return (Container()(evt,fsm,state)).assign(Param1()(evt,fsm,state));
  3518. }
  3519. };
  3520. template <class Container, class Param1, class Param2 >
  3521. struct StringAssign_<Container,Param1,Param2,void>
  3522. : euml_action<StringAssign_<Container,Param1,Param2,void> >
  3523. {
  3524. template <class Event,class FSM,class STATE >
  3525. struct state_action_result
  3526. {
  3527. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3528. };
  3529. template <class EVT,class FSM,class SourceState,class TargetState>
  3530. struct transition_action_result
  3531. {
  3532. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3533. };
  3534. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3535. template <class EVT,class FSM,class SourceState,class TargetState>
  3536. typename ::boost::enable_if<
  3537. typename ::boost::mpl::has_key<
  3538. typename Container::tag_type,action_tag>::type,
  3539. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3540. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3541. {
  3542. return (Container()(evt,fsm,src,tgt)).assign(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  3543. }
  3544. template <class Event,class FSM,class STATE>
  3545. typename ::boost::enable_if<
  3546. typename ::boost::mpl::has_key<
  3547. typename Container::tag_type,state_action_tag>::type,
  3548. typename state_action_result<Event,FSM,STATE>::type >::type
  3549. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3550. {
  3551. return (Container()(evt,fsm,state)).assign(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  3552. }
  3553. };
  3554. struct assign_tag {};
  3555. struct StringAssign_Helper: proto::extends< proto::terminal<assign_tag>::type, StringAssign_Helper, boost::msm::sm_domain>
  3556. {
  3557. StringAssign_Helper(){}
  3558. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3559. #ifdef BOOST_MSVC
  3560. ,class Arg6
  3561. #endif
  3562. >
  3563. struct In
  3564. {
  3565. typedef StringAssign_<Arg1,Arg2,Arg3,Arg4> type;
  3566. };
  3567. };
  3568. StringAssign_Helper const string_assign_;
  3569. template <class Container,class Param1, class Param2, class Param3, class Param4>
  3570. struct StringReplace_ : euml_action<StringReplace_<Container,Param1,Param2,Param3,Param4> >
  3571. {
  3572. template <class Event,class FSM,class STATE >
  3573. struct state_action_result
  3574. {
  3575. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3576. };
  3577. template <class EVT,class FSM,class SourceState,class TargetState>
  3578. struct transition_action_result
  3579. {
  3580. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3581. };
  3582. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3583. template <class EVT,class FSM,class SourceState,class TargetState>
  3584. typename ::boost::enable_if<
  3585. typename ::boost::mpl::has_key<
  3586. typename Container::tag_type,action_tag>::type,
  3587. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3588. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3589. {
  3590. return (Container()(evt,fsm,src,tgt)).replace (Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3591. Param3()(evt,fsm,src,tgt),Param4()(evt,fsm,src,tgt));
  3592. }
  3593. template <class Event,class FSM,class STATE>
  3594. typename ::boost::enable_if<
  3595. typename ::boost::mpl::has_key<
  3596. typename Container::tag_type,state_action_tag>::type,
  3597. typename state_action_result<Event,FSM,STATE>::type >::type
  3598. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3599. {
  3600. return (Container()(evt,fsm,state)).replace (Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3601. Param3()(evt,fsm,state),Param4()(evt,fsm,state));
  3602. }
  3603. };
  3604. template <class Container,class Param1, class Param2, class Param3>
  3605. struct StringReplace_<Container,Param1,Param2,Param3,void>
  3606. : euml_action<StringReplace_<Container,Param1,Param2,Param3,void> >
  3607. {
  3608. template <class Event,class FSM,class STATE >
  3609. struct state_action_result
  3610. {
  3611. typedef typename get_result_type2<Container,Event,FSM,STATE>::type type;
  3612. };
  3613. template <class EVT,class FSM,class SourceState,class TargetState>
  3614. struct transition_action_result
  3615. {
  3616. typedef typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type type;
  3617. };
  3618. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3619. template <class EVT,class FSM,class SourceState,class TargetState>
  3620. typename ::boost::enable_if<
  3621. typename ::boost::mpl::has_key<
  3622. typename Container::tag_type,action_tag>::type,
  3623. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3624. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3625. {
  3626. return (Container()(evt,fsm,src,tgt)).replace(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),
  3627. Param3()(evt,fsm,src,tgt));
  3628. }
  3629. template <class Event,class FSM,class STATE>
  3630. typename ::boost::enable_if<
  3631. typename ::boost::mpl::has_key<
  3632. typename Container::tag_type,state_action_tag>::type,
  3633. typename state_action_result<Event,FSM,STATE>::type >::type
  3634. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3635. {
  3636. return (Container()(evt,fsm,state)).replace(Param1()(evt,fsm,state),Param2()(evt,fsm,state),
  3637. Param3()(evt,fsm,state));
  3638. }
  3639. };
  3640. struct string_replace_tag {};
  3641. struct StringReplace_Helper: proto::extends< proto::terminal<string_replace_tag>::type, StringReplace_Helper, boost::msm::sm_domain>
  3642. {
  3643. StringReplace_Helper(){}
  3644. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3645. #ifdef BOOST_MSVC
  3646. ,class Arg6
  3647. #endif
  3648. >
  3649. struct In
  3650. {
  3651. typedef StringReplace_<Arg1,Arg2,Arg3,Arg4,Arg5> type;
  3652. };
  3653. };
  3654. StringReplace_Helper const string_replace_;
  3655. template <class Container>
  3656. struct CStr_ : euml_action<CStr_<Container> >
  3657. {
  3658. template <class Event,class FSM,class STATE >
  3659. struct state_action_result
  3660. {
  3661. typedef typename ::boost::add_const<
  3662. typename get_value_type<
  3663. typename ::boost::remove_reference<
  3664. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type>::type* type;
  3665. };
  3666. template <class EVT,class FSM,class SourceState,class TargetState>
  3667. struct transition_action_result
  3668. {
  3669. typedef typename ::boost::add_const<
  3670. typename get_value_type<
  3671. typename ::boost::remove_reference<
  3672. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type>::type* type;
  3673. };
  3674. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3675. template <class EVT,class FSM,class SourceState,class TargetState>
  3676. typename ::boost::enable_if<
  3677. typename ::boost::mpl::has_key<
  3678. typename Container::tag_type,action_tag>::type,
  3679. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3680. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3681. {
  3682. return (Container()(evt,fsm,src,tgt)).c_str();
  3683. }
  3684. template <class Event,class FSM,class STATE>
  3685. typename ::boost::enable_if<
  3686. typename ::boost::mpl::has_key<
  3687. typename Container::tag_type,state_action_tag>::type,
  3688. typename state_action_result<Event,FSM,STATE>::type >::type
  3689. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3690. {
  3691. return (Container()(evt,fsm,state)).c_str();
  3692. }
  3693. };
  3694. struct c_str_tag {};
  3695. struct CStr_Helper: proto::extends< proto::terminal<c_str_tag>::type, CStr_Helper, boost::msm::sm_domain>
  3696. {
  3697. CStr_Helper(){}
  3698. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3699. #ifdef BOOST_MSVC
  3700. ,class Arg6
  3701. #endif
  3702. >
  3703. struct In
  3704. {
  3705. typedef CStr_<Arg1> type;
  3706. };
  3707. };
  3708. CStr_Helper const c_str_;
  3709. template <class Container>
  3710. struct StringData_ : euml_action<StringData_<Container> >
  3711. {
  3712. template <class Event,class FSM,class STATE >
  3713. struct state_action_result
  3714. {
  3715. typedef typename ::boost::add_const<
  3716. typename get_value_type<
  3717. typename ::boost::remove_reference<
  3718. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type>::type* type;
  3719. };
  3720. template <class EVT,class FSM,class SourceState,class TargetState>
  3721. struct transition_action_result
  3722. {
  3723. typedef typename ::boost::add_const<
  3724. typename get_value_type<
  3725. typename ::boost::remove_reference<
  3726. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type>::type* type;
  3727. };
  3728. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3729. template <class EVT,class FSM,class SourceState,class TargetState>
  3730. typename ::boost::enable_if<
  3731. typename ::boost::mpl::has_key<
  3732. typename Container::tag_type,action_tag>::type,
  3733. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
  3734. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3735. {
  3736. return (Container()(evt,fsm,src,tgt)).data();
  3737. }
  3738. template <class Event,class FSM,class STATE>
  3739. typename ::boost::enable_if<
  3740. typename ::boost::mpl::has_key<
  3741. typename Container::tag_type,state_action_tag>::type,
  3742. typename state_action_result<Event,FSM,STATE>::type >::type
  3743. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3744. {
  3745. return (Container()(evt,fsm,state)).data();
  3746. }
  3747. };
  3748. struct string_data_tag {};
  3749. struct StringData_Helper: proto::extends< proto::terminal<string_data_tag>::type, StringData_Helper, boost::msm::sm_domain>
  3750. {
  3751. StringData_Helper(){}
  3752. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3753. #ifdef BOOST_MSVC
  3754. ,class Arg6
  3755. #endif
  3756. >
  3757. struct In
  3758. {
  3759. typedef StringData_<Arg1> type;
  3760. };
  3761. };
  3762. StringData_Helper const string_data_;
  3763. template <class Container, class Param1, class Param2, class Param3, class Enable=void >
  3764. struct StringCopy_ : euml_action<StringCopy_<Container,Param1,Param2,Param3,Enable> >
  3765. {
  3766. };
  3767. template <class Container,class Param1, class Param2, class Param3>
  3768. struct StringCopy_<
  3769. Container,Param1,Param2,Param3,
  3770. typename ::boost::enable_if<
  3771. typename ::boost::is_same<Param3,void>::type
  3772. >::type
  3773. >
  3774. : euml_action<StringCopy_<Container,Param1,Param2,Param3> >
  3775. {
  3776. template <class Event,class FSM,class STATE >
  3777. struct state_action_result
  3778. {
  3779. typedef typename get_size_type<
  3780. typename ::boost::remove_reference<
  3781. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  3782. };
  3783. template <class EVT,class FSM,class SourceState,class TargetState>
  3784. struct transition_action_result
  3785. {
  3786. typedef typename get_size_type<
  3787. typename ::boost::remove_reference<
  3788. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  3789. };
  3790. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3791. template <class EVT,class FSM,class SourceState,class TargetState>
  3792. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  3793. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3794. {
  3795. return (Container()(evt,fsm,src,tgt)).copy(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt));
  3796. }
  3797. template <class Event,class FSM,class STATE>
  3798. typename state_action_result<Event,FSM,STATE>::type
  3799. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3800. {
  3801. return (Container()(evt,fsm,state)).copy(Param1()(evt,fsm,state),Param2()(evt,fsm,state));
  3802. }
  3803. };
  3804. template <class Container,class Param1, class Param2, class Param3>
  3805. struct StringCopy_<
  3806. Container,Param1,Param2,Param3,
  3807. typename ::boost::disable_if<
  3808. typename ::boost::is_same<Param3,void>::type
  3809. >::type
  3810. >
  3811. : euml_action<StringCopy_<Container,Param1,Param2,Param3> >
  3812. {
  3813. template <class Event,class FSM,class STATE >
  3814. struct state_action_result
  3815. {
  3816. typedef typename get_size_type<
  3817. typename ::boost::remove_reference<
  3818. typename get_result_type2<Container,Event,FSM,STATE>::type>::type>::type type;
  3819. };
  3820. template <class EVT,class FSM,class SourceState,class TargetState>
  3821. struct transition_action_result
  3822. {
  3823. typedef typename get_size_type<
  3824. typename ::boost::remove_reference<
  3825. typename get_result_type<Container,EVT,FSM,SourceState,TargetState>::type>::type>::type type;
  3826. };
  3827. typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
  3828. template <class EVT,class FSM,class SourceState,class TargetState>
  3829. typename transition_action_result<EVT,FSM,SourceState,TargetState>::type
  3830. operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
  3831. {
  3832. return (Container()(evt,fsm,src,tgt)).
  3833. copy(Param1()(evt,fsm,src,tgt),Param2()(evt,fsm,src,tgt),Param3()(evt,fsm,src,tgt));
  3834. }
  3835. template <class Event,class FSM,class STATE>
  3836. typename state_action_result<Event,FSM,STATE>::type
  3837. operator()(Event const& evt,FSM& fsm,STATE& state )const
  3838. {
  3839. return (Container()(evt,fsm,state)).
  3840. copy(Param1()(evt,fsm,state),Param2()(evt,fsm,state),Param3()(evt,fsm,state));
  3841. }
  3842. };
  3843. struct string_copy_tag {};
  3844. struct StringCopy_Helper: proto::extends< proto::terminal<string_copy_tag>::type, StringCopy_Helper, boost::msm::sm_domain>
  3845. {
  3846. StringCopy_Helper(){}
  3847. template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
  3848. #ifdef BOOST_MSVC
  3849. ,class Arg6
  3850. #endif
  3851. >
  3852. struct In
  3853. {
  3854. typedef StringCopy_<Arg1,Arg2,Arg3,Arg4> type;
  3855. };
  3856. };
  3857. StringCopy_Helper const string_copy_;
  3858. }}}}
  3859. #endif //BOOST_MSM_FRONT_EUML_CONTAINER_H