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)
11 #ifndef BOOST_MSM_FRONT_EUML_OPERATOR_H
12 #define BOOST_MSM_FRONT_EUML_OPERATOR_H
15 #include <boost/msm/front/euml/common.hpp>
16 #include <boost/type_traits/remove_reference.hpp>
17 #include <boost/utility/enable_if.hpp>
18 #include <boost/mpl/has_key.hpp>
19 #include <boost/mpl/eval_if.hpp>
20 #include <boost/mpl/set.hpp>
21 #include <boost/type_traits.hpp>
23 BOOST_MPL_HAS_XXX_TRAIT_DEF(reference)
24 BOOST_MPL_HAS_XXX_TRAIT_DEF(key_type)
26 namespace boost { namespace msm { namespace front { namespace euml
29 template <class T1,class T2>
30 struct Or_ : euml_action<Or_<T1,T2> >
32 template <class EVT,class FSM,class SourceState,class TargetState>
33 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
35 return (T1()(evt,fsm,src,tgt) || T2()(evt,fsm,src,tgt));
37 template <class Event,class FSM,class STATE>
38 bool operator()(Event const& evt,FSM& fsm,STATE& state)
40 return (T1()(evt,fsm,state) || T2()(evt,fsm,state));
43 template <class T1,class T2>
44 struct And_ : euml_action<And_<T1,T2> >
46 template <class EVT,class FSM,class SourceState,class TargetState>
47 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
49 return (T1()(evt,fsm,src,tgt) && T2()(evt,fsm,src,tgt));
51 template <class Event,class FSM,class STATE>
52 bool operator()(Event const& evt,FSM& fsm,STATE& state)
54 return (T1()(evt,fsm,state) && T2()(evt,fsm,state));
58 struct Not_ : euml_action<Not_<T1> >
60 template <class EVT,class FSM,class SourceState,class TargetState>
61 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)
63 return !(T1()(evt,fsm,src,tgt));
65 template <class Event,class FSM,class STATE>
66 bool operator()(Event const& evt,FSM& fsm,STATE& state)
68 return !(T1()(evt,fsm,state));
72 template <class Condition,class Action1,class Action2, class Enable=void >
73 struct If_Else_ : euml_action<If_Else_<Condition,Action1,Action2,Enable> > {};
75 template <class Condition,class Action1,class Action2>
76 struct If_Else_<Condition,Action1,Action2
77 , typename ::boost::enable_if<typename has_tag_type<Action1>::type >::type>
78 : euml_action<If_Else_<Condition,Action1,Action2> >
80 template <class Event,class FSM,class STATE >
81 struct state_action_result
83 typedef typename get_result_type2<Action1,Event,FSM,STATE>::type type;
85 template <class EVT,class FSM,class SourceState,class TargetState>
86 struct transition_action_result
88 typedef typename get_result_type<Action1,EVT,FSM,SourceState,TargetState>::type type;
90 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
92 template <class EVT,class FSM,class SourceState,class TargetState>
93 typename ::boost::enable_if<
94 typename ::boost::mpl::has_key<
95 typename Action1::tag_type,action_tag>::type,
96 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
97 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
99 if (Condition()(evt,fsm,src,tgt))
101 return Action1()(evt,fsm,src,tgt);
103 return Action2()(evt,fsm,src,tgt);
105 template <class Event,class FSM,class STATE>
106 typename ::boost::enable_if<
107 typename ::boost::mpl::has_key<
108 typename Action1::tag_type,state_action_tag>::type,
109 typename state_action_result<Event,FSM,STATE>::type >::type
110 operator()(Event const& evt,FSM& fsm,STATE& state )const
112 if (Condition()(evt,fsm,state))
114 return Action1()(evt,fsm,state);
116 return Action2()(evt,fsm,state);
120 template <class Condition,class Action1,class Action2>
121 struct If_Else_<Condition,Action1,Action2
122 , typename ::boost::disable_if<typename has_tag_type<Action1>::type >::type>
123 : euml_action<If_Else_<Condition,Action1,Action2> >
125 template <class Event,class FSM,class STATE >
126 struct state_action_result
130 template <class EVT,class FSM,class SourceState,class TargetState>
131 struct transition_action_result
135 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
137 template <class EVT,class FSM,class SourceState,class TargetState>
138 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
140 if (Condition()(evt,fsm,src,tgt))
142 return Action1()(evt,fsm,src,tgt);
144 return Action2()(evt,fsm,src,tgt);
146 template <class Event,class FSM,class STATE>
147 bool operator()(Event const& evt,FSM& fsm,STATE& state )const
149 if (Condition()(evt,fsm,state))
151 return Action1()(evt,fsm,state);
153 return Action2()(evt,fsm,state);
160 struct If : proto::extends<proto::terminal<if_tag>::type, If, boost::msm::sm_domain>
163 using proto::extends< proto::terminal<if_tag>::type, If, boost::msm::sm_domain>::operator=;
164 template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
171 typedef If_Else_<Arg1,Arg2,Arg3> type;
174 If const if_then_else_;
176 template <class Condition,class Action1, class Enable=void >
177 struct If_Then_ : euml_action<If_Then_<Condition,Action1,Enable> > {};
179 template <class Condition,class Action1>
180 struct If_Then_<Condition,Action1
181 , typename ::boost::enable_if<typename has_tag_type<Action1>::type >::type>
182 : euml_action<If_Then_<Condition,Action1> >
184 template <class Event,class FSM,class STATE >
185 struct state_action_result
187 typedef typename get_result_type2<Action1,Event,FSM,STATE>::type type;
189 template <class EVT,class FSM,class SourceState,class TargetState>
190 struct transition_action_result
192 typedef typename get_result_type<Action1,EVT,FSM,SourceState,TargetState>::type type;
194 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
196 template <class EVT,class FSM,class SourceState,class TargetState>
197 typename ::boost::enable_if<
198 typename ::boost::mpl::has_key<
199 typename Action1::tag_type,action_tag>::type,
200 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
201 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
203 if (Condition()(evt,fsm,src,tgt))
205 return Action1()(evt,fsm,src,tgt);
208 template <class Event,class FSM,class STATE>
209 typename ::boost::enable_if<
210 typename ::boost::mpl::has_key<
211 typename Action1::tag_type,state_action_tag>::type,
212 typename state_action_result<Event,FSM,STATE>::type >::type
213 operator()(Event const& evt,FSM& fsm,STATE& state )const
215 if (Condition()(evt,fsm,state))
217 return Action1()(evt,fsm,state);
222 template <class Condition,class Action1>
223 struct If_Then_<Condition,Action1
224 , typename ::boost::disable_if<typename has_tag_type<Action1>::type >::type>
225 : euml_action<If_Then_<Condition,Action1> >
227 template <class Event,class FSM,class STATE >
228 struct state_action_result
232 template <class EVT,class FSM,class SourceState,class TargetState>
233 struct transition_action_result
237 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
239 template <class EVT,class FSM,class SourceState,class TargetState>
240 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
242 if (Condition()(evt,fsm,src,tgt))
244 return Action1()(evt,fsm,src,tgt);
247 template <class Event,class FSM,class STATE>
248 bool operator()(Event const& evt,FSM& fsm,STATE& state )const
250 if (Condition()(evt,fsm,state))
252 return Action1()(evt,fsm,state);
259 struct If_Then : proto::extends< proto::terminal<if_then_tag>::type, If_Then, boost::msm::sm_domain>
262 using proto::extends< proto::terminal<if_then_tag>::type, If_Then, boost::msm::sm_domain>::operator=;
263 template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
270 typedef If_Then_<Arg1,Arg2> type;
273 If_Then const if_then_;
275 template <class Condition,class Body>
276 struct While_Do_ : euml_action<While_Do_<Condition,Body> >
278 template <class Event,class FSM,class STATE >
279 struct state_action_result
283 template <class EVT,class FSM,class SourceState,class TargetState>
284 struct transition_action_result
289 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
291 template <class EVT,class FSM,class SourceState,class TargetState>
292 void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
296 while (cond_(evt,fsm,src,tgt))
298 body_(evt,fsm,src,tgt);
301 template <class Event,class FSM,class STATE>
302 void operator()(Event const& evt,FSM& fsm,STATE& state )const
306 while (cond_(evt,fsm,state))
308 body_(evt,fsm,state);
315 struct While_Do_Helper : proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, boost::msm::sm_domain>
318 using proto::extends< proto::terminal<while_do_tag>::type, While_Do_Helper, boost::msm::sm_domain>::operator=;
319 template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
326 typedef While_Do_<Arg1,Arg2> type;
329 While_Do_Helper const while_;
331 template <class Condition,class Body>
332 struct Do_While_ : euml_action<Do_While_<Condition,Body> >
334 template <class Event,class FSM,class STATE >
335 struct state_action_result
339 template <class EVT,class FSM,class SourceState,class TargetState>
340 struct transition_action_result
345 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
347 template <class EVT,class FSM,class SourceState,class TargetState>
348 void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
354 body_(evt,fsm,src,tgt);
355 } while (cond_(evt,fsm,src,tgt));
357 template <class Event,class FSM,class STATE>
358 void operator()(Event const& evt,FSM& fsm,STATE& state )const
364 body_(evt,fsm,state);
365 } while (cond_(evt,fsm,state));
371 struct Do_While_Helper : proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, boost::msm::sm_domain>
374 using proto::extends< proto::terminal<do_while_tag>::type, Do_While_Helper, boost::msm::sm_domain>::operator=;
375 template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
382 typedef Do_While_<Arg1,Arg2> type;
385 Do_While_Helper const do_while_;
387 template <class Begin,class End,class EndLoop,class Body>
388 struct For_Loop_ : euml_action<For_Loop_<Begin,End,EndLoop,Body> >
390 template <class Event,class FSM,class STATE >
391 struct state_action_result
395 template <class EVT,class FSM,class SourceState,class TargetState>
396 struct transition_action_result
401 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
403 template <class EVT,class FSM,class SourceState,class TargetState>
404 void operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
409 for(Begin()(evt,fsm,src,tgt);end_(evt,fsm,src,tgt);end_loop_(evt,fsm,src,tgt))
411 body_(evt,fsm,src,tgt);
414 template <class Event,class FSM,class STATE>
415 void operator()(Event const& evt,FSM& fsm,STATE& state )const
420 for(Begin()(evt,fsm,state);end_(evt,fsm,state);end_loop_(evt,fsm,state))
422 body_(evt,fsm,state);
429 struct For_Loop_Helper : proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, boost::msm::sm_domain>
432 using proto::extends< proto::terminal<for_loop_tag>::type, For_Loop_Helper, boost::msm::sm_domain>::operator=;
433 template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
440 typedef For_Loop_<Arg1,Arg2,Arg3,Arg4> type;
443 For_Loop_Helper const for_;
449 struct Deref_ : euml_action<Deref_<T> >
452 using euml_action<Deref_<T> >::operator=;
453 template <class Event,class FSM,class STATE >
454 struct state_action_result
456 typedef typename ::boost::add_reference<
457 typename std::iterator_traits <
458 typename ::boost::remove_reference<
459 typename get_result_type2<T,Event,FSM,STATE>::type>::type>::value_type>::type type;
461 template <class EVT,class FSM,class SourceState,class TargetState>
462 struct transition_action_result
464 typedef typename ::boost::add_reference<
465 typename std::iterator_traits<
466 typename ::boost::remove_reference<
467 typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type
471 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
473 template <class EVT,class FSM,class SourceState,class TargetState>
474 typename ::boost::enable_if<
475 typename ::boost::mpl::has_key<
476 typename T::tag_type,action_tag>::type,
477 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
478 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
480 return *(T()(evt,fsm,src,tgt));
482 template <class Event,class FSM,class STATE>
483 typename ::boost::enable_if<
484 typename ::boost::mpl::has_key<
485 typename T::tag_type,state_action_tag>::type,
486 typename state_action_result<Event,FSM,STATE>::type >::type
487 operator()(Event const& evt,FSM& fsm,STATE& state )const
489 return *(T()(evt,fsm,state));
494 struct Pre_inc_ : euml_action<Pre_inc_<T> >
496 using euml_action<Pre_inc_<T> >::operator=;
498 template <class Event,class FSM,class STATE >
499 struct state_action_result
501 typedef typename get_result_type2<T,Event,FSM,STATE>::type type;
503 template <class EVT,class FSM,class SourceState,class TargetState>
504 struct transition_action_result
506 typedef typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type type;
508 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
510 template <class EVT,class FSM,class SourceState,class TargetState>
511 typename ::boost::enable_if<
512 typename ::boost::mpl::has_key<
513 typename T::tag_type,action_tag>::type,
514 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
515 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
517 return ++T()(evt,fsm,src,tgt);
519 template <class Event,class FSM,class STATE>
520 typename ::boost::enable_if<
521 typename ::boost::mpl::has_key<
522 typename T::tag_type,state_action_tag>::type,
523 typename state_action_result<Event,FSM,STATE>::type >::type
524 operator()(Event const& evt,FSM& fsm,STATE& state )const
526 return ++T()(evt,fsm,state);
530 struct Pre_dec_ : euml_action<Pre_dec_<T> >
532 using euml_action<Pre_dec_<T> >::operator=;
534 template <class Event,class FSM,class STATE >
535 struct state_action_result
537 typedef typename get_result_type2<T,Event,FSM,STATE>::type type;
539 template <class EVT,class FSM,class SourceState,class TargetState>
540 struct transition_action_result
542 typedef typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type type;
544 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
546 template <class EVT,class FSM,class SourceState,class TargetState>
547 typename ::boost::enable_if<
548 typename ::boost::mpl::has_key<
549 typename T::tag_type,action_tag>::type,
550 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
551 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
553 return --T()(evt,fsm,src,tgt);
555 template <class Event,class FSM,class STATE>
556 typename ::boost::enable_if<
557 typename ::boost::mpl::has_key<
558 typename T::tag_type,state_action_tag>::type,
559 typename state_action_result<Event,FSM,STATE>::type >::type
560 operator()(Event const& evt,FSM& fsm,STATE& state )const
562 return --T()(evt,fsm,state);
566 struct Post_inc_ : euml_action<Post_inc_<T> >
568 using euml_action<Post_inc_<T> >::operator=;
570 template <class Event,class FSM,class STATE >
571 struct state_action_result
573 typedef typename ::boost::remove_reference<
574 typename get_result_type2<T,Event,FSM,STATE>::type>::type type;
576 template <class EVT,class FSM,class SourceState,class TargetState>
577 struct transition_action_result
579 typedef typename ::boost::remove_reference<
580 typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type type;
582 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
584 template <class EVT,class FSM,class SourceState,class TargetState>
585 typename ::boost::enable_if<
586 typename ::boost::mpl::has_key<
587 typename T::tag_type,action_tag>::type,
588 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
589 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
591 return T()(evt,fsm,src,tgt)++;
593 template <class Event,class FSM,class STATE>
594 typename ::boost::enable_if<
595 typename ::boost::mpl::has_key<
596 typename T::tag_type,state_action_tag>::type,
597 typename state_action_result<Event,FSM,STATE>::type >::type
598 operator()(Event const& evt,FSM& fsm,STATE& state )const
600 return T()(evt,fsm,state)++;
604 struct Post_dec_ : euml_action<Post_dec_<T> >
606 using euml_action<Post_dec_<T> >::operator=;
608 template <class Event,class FSM,class STATE >
609 struct state_action_result
611 typedef typename ::boost::remove_reference<
612 typename get_result_type2<T,Event,FSM,STATE>::type>::type type;
614 template <class EVT,class FSM,class SourceState,class TargetState>
615 struct transition_action_result
617 typedef typename ::boost::remove_reference<
618 typename get_result_type<T,EVT,FSM,SourceState,TargetState>::type>::type type;
620 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
622 template <class EVT,class FSM,class SourceState,class TargetState>
623 typename ::boost::enable_if<
624 typename ::boost::mpl::has_key<
625 typename T::tag_type,action_tag>::type,
626 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
627 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
629 return T()(evt,fsm,src,tgt)--;
631 template <class Event,class FSM,class STATE>
632 typename ::boost::enable_if<
633 typename ::boost::mpl::has_key<
634 typename T::tag_type,state_action_tag>::type,
635 typename state_action_result<Event,FSM,STATE>::type >::type
636 operator()(Event const& evt,FSM& fsm,STATE& state )const
638 return T()(evt,fsm,state)--;
642 template <class T1,class T2>
643 struct Plus_ : euml_action<Plus_<T1,T2> >
645 template <class Event,class FSM,class STATE >
646 struct state_action_result
648 typedef typename ::boost::remove_reference<
649 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
651 template <class EVT,class FSM,class SourceState,class TargetState>
652 struct transition_action_result
654 typedef typename ::boost::remove_reference<
655 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
657 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
659 template <class EVT,class FSM,class SourceState,class TargetState>
660 typename ::boost::enable_if<
661 typename ::boost::mpl::has_key<
662 typename T1::tag_type,action_tag>::type,
663 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
664 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
666 return T1()(evt,fsm,src,tgt)+T2()(evt,fsm,src,tgt);
668 template <class Event,class FSM,class STATE>
669 typename ::boost::enable_if<
670 typename ::boost::mpl::has_key<
671 typename T1::tag_type,state_action_tag>::type,
672 typename state_action_result<Event,FSM,STATE>::type >::type
673 operator()(Event const& evt,FSM& fsm,STATE& state )const
675 return T1()(evt,fsm,state)+T2()(evt,fsm,state);
678 template <class T1,class T2>
679 struct Minus_ : euml_action<Minus_<T1,T2> >
681 template <class Event,class FSM,class STATE >
682 struct state_action_result
684 typedef typename ::boost::remove_reference<
685 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
687 template <class EVT,class FSM,class SourceState,class TargetState>
688 struct transition_action_result
690 typedef typename ::boost::remove_reference<
691 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
693 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
695 template <class EVT,class FSM,class SourceState,class TargetState>
696 typename ::boost::enable_if<
697 typename ::boost::mpl::has_key<
698 typename T1::tag_type,action_tag>::type,
699 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
700 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
702 return T1()(evt,fsm,src,tgt)-T2()(evt,fsm,src,tgt);
704 template <class Event,class FSM,class STATE>
705 typename ::boost::enable_if<
706 typename ::boost::mpl::has_key<
707 typename T1::tag_type,state_action_tag>::type,
708 typename state_action_result<Event,FSM,STATE>::type >::type
709 operator()(Event const& evt,FSM& fsm,STATE& state )const
711 return T1()(evt,fsm,state)-T2()(evt,fsm,state);
714 template <class T1,class T2>
715 struct Multiplies_ : euml_action<Multiplies_<T1,T2> >
717 template <class Event,class FSM,class STATE >
718 struct state_action_result
720 typedef typename ::boost::remove_reference<
721 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
723 template <class EVT,class FSM,class SourceState,class TargetState>
724 struct transition_action_result
726 typedef typename ::boost::remove_reference<
727 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
729 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
731 template <class EVT,class FSM,class SourceState,class TargetState>
732 typename ::boost::enable_if<
733 typename ::boost::mpl::has_key<
734 typename T1::tag_type,action_tag>::type,
735 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
736 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
738 return T1()(evt,fsm,src,tgt)*T2()(evt,fsm,src,tgt);
740 template <class Event,class FSM,class STATE>
741 typename ::boost::enable_if<
742 typename ::boost::mpl::has_key<
743 typename T1::tag_type,state_action_tag>::type,
744 typename state_action_result<Event,FSM,STATE>::type >::type
745 operator()(Event const& evt,FSM& fsm,STATE& state )const
747 return T1()(evt,fsm,state)*T2()(evt,fsm,state);
750 template <class T1,class T2>
751 struct Divides_ : euml_action<Divides_<T1,T2> >
753 template <class Event,class FSM,class STATE >
754 struct state_action_result
756 typedef typename ::boost::remove_reference<
757 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
759 template <class EVT,class FSM,class SourceState,class TargetState>
760 struct transition_action_result
762 typedef typename ::boost::remove_reference<
763 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
765 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
767 template <class EVT,class FSM,class SourceState,class TargetState>
768 typename ::boost::enable_if<
769 typename ::boost::mpl::has_key<
770 typename T1::tag_type,action_tag>::type,
771 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
772 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
774 return T1()(evt,fsm,src,tgt)/T2()(evt,fsm,src,tgt);
776 template <class Event,class FSM,class STATE>
777 typename ::boost::enable_if<
778 typename ::boost::mpl::has_key<
779 typename T1::tag_type,state_action_tag>::type,
780 typename state_action_result<Event,FSM,STATE>::type >::type
781 operator()(Event const& evt,FSM& fsm,STATE& state )const
783 return T1()(evt,fsm,state)/T2()(evt,fsm,state);
786 template <class T1,class T2>
787 struct Modulus_ : euml_action<Modulus_<T1,T2> >
789 template <class Event,class FSM,class STATE >
790 struct state_action_result
792 typedef typename ::boost::remove_reference<
793 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
795 template <class EVT,class FSM,class SourceState,class TargetState>
796 struct transition_action_result
798 typedef typename ::boost::remove_reference<
799 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
801 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
803 template <class EVT,class FSM,class SourceState,class TargetState>
804 typename ::boost::enable_if<
805 typename ::boost::mpl::has_key<
806 typename T1::tag_type,action_tag>::type,
807 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
808 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
810 return T1()(evt,fsm,src,tgt)%T2()(evt,fsm,src,tgt);
812 template <class Event,class FSM,class STATE>
813 typename ::boost::enable_if<
814 typename ::boost::mpl::has_key<
815 typename T1::tag_type,state_action_tag>::type,
816 typename state_action_result<Event,FSM,STATE>::type >::type
817 operator()(Event const& evt,FSM& fsm,STATE& state )const
819 return T1()(evt,fsm,state)%T2()(evt,fsm,state);
822 template <class T1,class T2>
823 struct Bitwise_And_ : euml_action<Bitwise_And_<T1,T2> >
825 template <class Event,class FSM,class STATE >
826 struct state_action_result
828 typedef typename ::boost::remove_reference<
829 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
831 template <class EVT,class FSM,class SourceState,class TargetState>
832 struct transition_action_result
834 typedef typename ::boost::remove_reference<
835 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
837 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
839 template <class EVT,class FSM,class SourceState,class TargetState>
840 typename ::boost::enable_if<
841 typename ::boost::mpl::has_key<
842 typename T1::tag_type,action_tag>::type,
843 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
844 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
846 return T1()(evt,fsm,src,tgt)&T2()(evt,fsm,src,tgt);
848 template <class Event,class FSM,class STATE>
849 typename ::boost::enable_if<
850 typename ::boost::mpl::has_key<
851 typename T1::tag_type,state_action_tag>::type,
852 typename state_action_result<Event,FSM,STATE>::type >::type
853 operator()(Event const& evt,FSM& fsm,STATE& state )const
855 return T1()(evt,fsm,state)&T2()(evt,fsm,state);
858 template <class T1,class T2>
859 struct Bitwise_Or_ : euml_action<Bitwise_Or_<T1,T2> >
861 template <class Event,class FSM,class STATE >
862 struct state_action_result
864 typedef typename ::boost::remove_reference<
865 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
867 template <class EVT,class FSM,class SourceState,class TargetState>
868 struct transition_action_result
870 typedef typename ::boost::remove_reference<
871 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
873 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
875 template <class EVT,class FSM,class SourceState,class TargetState>
876 typename ::boost::enable_if<
877 typename ::boost::mpl::has_key<
878 typename T1::tag_type,action_tag>::type,
879 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
880 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
882 return T1()(evt,fsm,src,tgt)|T2()(evt,fsm,src,tgt);
884 template <class Event,class FSM,class STATE>
885 typename ::boost::enable_if<
886 typename ::boost::mpl::has_key<
887 typename T1::tag_type,state_action_tag>::type,
888 typename state_action_result<Event,FSM,STATE>::type >::type
889 operator()(Event const& evt,FSM& fsm,STATE& state )const
891 return T1()(evt,fsm,state)|T2()(evt,fsm,state);
894 template <class T1,class T2>
895 struct Bitwise_Xor_ : euml_action<Bitwise_Xor_<T1,T2> >
897 template <class Event,class FSM,class STATE >
898 struct state_action_result
900 typedef typename ::boost::remove_reference<
901 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
903 template <class EVT,class FSM,class SourceState,class TargetState>
904 struct transition_action_result
906 typedef typename ::boost::remove_reference<
907 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
909 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
911 template <class EVT,class FSM,class SourceState,class TargetState>
912 typename ::boost::enable_if<
913 typename ::boost::mpl::has_key<
914 typename T1::tag_type,action_tag>::type,
915 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
916 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
918 return T1()(evt,fsm,src,tgt)^T2()(evt,fsm,src,tgt);
920 template <class Event,class FSM,class STATE>
921 typename ::boost::enable_if<
922 typename ::boost::mpl::has_key<
923 typename T1::tag_type,state_action_tag>::type,
924 typename state_action_result<Event,FSM,STATE>::type >::type
925 operator()(Event const& evt,FSM& fsm,STATE& state )const
927 return T1()(evt,fsm,state)^T2()(evt,fsm,state);
930 template <class T1,class T2>
931 struct Subscript_ : euml_action<Subscript_<T1,T2> >
936 typedef typename T::reference type;
939 struct get_mapped_type
941 typedef typename T::value_type::second_type& type;
943 template <class Event,class FSM,class STATE >
944 struct state_action_result
946 typedef typename ::boost::remove_reference<
947 typename get_result_type2<T1,Event,FSM,STATE>::type>::type container_type;
948 typedef typename ::boost::mpl::eval_if<
949 typename has_key_type<container_type>::type,
950 get_mapped_type<container_type>,
951 ::boost::mpl::eval_if<
952 typename ::boost::is_pointer<container_type>::type,
953 ::boost::add_reference<typename ::boost::remove_pointer<container_type>::type >,
954 get_reference<container_type>
958 template <class EVT,class FSM,class SourceState,class TargetState>
959 struct transition_action_result
961 typedef typename ::boost::remove_reference<
962 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type container_type;
963 typedef typename ::boost::mpl::eval_if<
964 typename has_key_type<container_type>::type,
965 get_mapped_type<container_type>,
966 ::boost::mpl::eval_if<
967 typename ::boost::is_pointer<container_type>::type,
968 ::boost::add_reference<typename ::boost::remove_pointer<container_type>::type >,
969 get_reference<container_type>
973 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
975 template <class EVT,class FSM,class SourceState,class TargetState>
976 typename ::boost::enable_if<
977 typename ::boost::mpl::has_key<
978 typename T1::tag_type,action_tag>::type,
979 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
980 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
982 return T1()(evt,fsm,src,tgt)[T2()(evt,fsm,src,tgt)];
984 template <class Event,class FSM,class STATE>
985 typename ::boost::enable_if<
986 typename ::boost::mpl::has_key<
987 typename T1::tag_type,state_action_tag>::type,
988 typename state_action_result<Event,FSM,STATE>::type >::type
989 operator()(Event const& evt,FSM& fsm,STATE& state )const
991 return T1()(evt,fsm,state)[T2()(evt,fsm,state)];
994 template <class T1,class T2>
995 struct Plus_Assign_ : euml_action<Plus_Assign_<T1,T2> >
997 template <class Event,class FSM,class STATE >
998 struct state_action_result
1000 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1002 template <class EVT,class FSM,class SourceState,class TargetState>
1003 struct transition_action_result
1005 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1007 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1009 template <class EVT,class FSM,class SourceState,class TargetState>
1010 typename ::boost::enable_if<
1011 typename ::boost::mpl::has_key<
1012 typename T1::tag_type,action_tag>::type,
1013 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1014 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1016 return (T1()(evt,fsm,src,tgt)+=T2()(evt,fsm,src,tgt));
1018 template <class Event,class FSM,class STATE>
1019 typename ::boost::enable_if<
1020 typename ::boost::mpl::has_key<
1021 typename T1::tag_type,state_action_tag>::type,
1022 typename state_action_result<Event,FSM,STATE>::type >::type
1023 operator()(Event const& evt,FSM& fsm,STATE& state )const
1025 return (T1()(evt,fsm,state)+=T2()(evt,fsm,state));
1028 template <class T1,class T2>
1029 struct Minus_Assign_ : euml_action<Minus_Assign_<T1,T2> >
1031 template <class Event,class FSM,class STATE >
1032 struct state_action_result
1034 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1036 template <class EVT,class FSM,class SourceState,class TargetState>
1037 struct transition_action_result
1039 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1041 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1043 template <class EVT,class FSM,class SourceState,class TargetState>
1044 typename ::boost::enable_if<
1045 typename ::boost::mpl::has_key<
1046 typename T1::tag_type,action_tag>::type,
1047 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1048 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1050 return (T1()(evt,fsm,src,tgt)-=T2()(evt,fsm,src,tgt));
1052 template <class Event,class FSM,class STATE>
1053 typename ::boost::enable_if<
1054 typename ::boost::mpl::has_key<
1055 typename T1::tag_type,state_action_tag>::type,
1056 typename state_action_result<Event,FSM,STATE>::type >::type
1057 operator()(Event const& evt,FSM& fsm,STATE& state )const
1059 return (T1()(evt,fsm,state)-=T2()(evt,fsm,state));
1062 template <class T1,class T2>
1063 struct Multiplies_Assign_ : euml_action<Multiplies_Assign_<T1,T2> >
1065 template <class Event,class FSM,class STATE >
1066 struct state_action_result
1068 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1070 template <class EVT,class FSM,class SourceState,class TargetState>
1071 struct transition_action_result
1073 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1075 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1077 template <class EVT,class FSM,class SourceState,class TargetState>
1078 typename ::boost::enable_if<
1079 typename ::boost::mpl::has_key<
1080 typename T1::tag_type,action_tag>::type,
1081 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1082 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1084 return (T1()(evt,fsm,src,tgt)*=T2()(evt,fsm,src,tgt));
1086 template <class Event,class FSM,class STATE>
1087 typename ::boost::enable_if<
1088 typename ::boost::mpl::has_key<
1089 typename T1::tag_type,state_action_tag>::type,
1090 typename state_action_result<Event,FSM,STATE>::type >::type
1091 operator()(Event const& evt,FSM& fsm,STATE& state )const
1093 return (T1()(evt,fsm,state)*=T2()(evt,fsm,state));
1096 template <class T1,class T2>
1097 struct Divides_Assign_ : euml_action<Divides_Assign_<T1,T2> >
1099 template <class Event,class FSM,class STATE >
1100 struct state_action_result
1102 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1104 template <class EVT,class FSM,class SourceState,class TargetState>
1105 struct transition_action_result
1107 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1109 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1111 template <class EVT,class FSM,class SourceState,class TargetState>
1112 typename ::boost::enable_if<
1113 typename ::boost::mpl::has_key<
1114 typename T1::tag_type,action_tag>::type,
1115 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1116 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1118 return (T1()(evt,fsm,src,tgt)/=T2()(evt,fsm,src,tgt));
1120 template <class Event,class FSM,class STATE>
1121 typename ::boost::enable_if<
1122 typename ::boost::mpl::has_key<
1123 typename T1::tag_type,state_action_tag>::type,
1124 typename state_action_result<Event,FSM,STATE>::type >::type
1125 operator()(Event const& evt,FSM& fsm,STATE& state )const
1127 return (T1()(evt,fsm,state)/=T2()(evt,fsm,state));
1130 template <class T1,class T2>
1131 struct Modulus_Assign_ : euml_action<Modulus_Assign_<T1,T2> >
1133 template <class Event,class FSM,class STATE >
1134 struct state_action_result
1136 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1138 template <class EVT,class FSM,class SourceState,class TargetState>
1139 struct transition_action_result
1141 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1143 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1145 template <class EVT,class FSM,class SourceState,class TargetState>
1146 typename ::boost::enable_if<
1147 typename ::boost::mpl::has_key<
1148 typename T1::tag_type,action_tag>::type,
1149 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1150 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1152 return (T1()(evt,fsm,src,tgt)%=T2()(evt,fsm,src,tgt));
1154 template <class Event,class FSM,class STATE>
1155 typename ::boost::enable_if<
1156 typename ::boost::mpl::has_key<
1157 typename T1::tag_type,state_action_tag>::type,
1158 typename state_action_result<Event,FSM,STATE>::type >::type
1159 operator()(Event const& evt,FSM& fsm,STATE& state )const
1161 return (T1()(evt,fsm,state)%=T2()(evt,fsm,state));
1164 template <class T1,class T2>
1165 struct ShiftLeft_Assign_ : euml_action<ShiftLeft_Assign_<T1,T2> >
1167 template <class Event,class FSM,class STATE >
1168 struct state_action_result
1170 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1172 template <class EVT,class FSM,class SourceState,class TargetState>
1173 struct transition_action_result
1175 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1177 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1179 template <class EVT,class FSM,class SourceState,class TargetState>
1180 typename ::boost::enable_if<
1181 typename ::boost::mpl::has_key<
1182 typename T1::tag_type,action_tag>::type,
1183 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1184 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1186 return (T1()(evt,fsm,src,tgt)<<=T2()(evt,fsm,src,tgt));
1188 template <class Event,class FSM,class STATE>
1189 typename ::boost::enable_if<
1190 typename ::boost::mpl::has_key<
1191 typename T1::tag_type,state_action_tag>::type,
1192 typename state_action_result<Event,FSM,STATE>::type >::type
1193 operator()(Event const& evt,FSM& fsm,STATE& state )const
1195 return (T1()(evt,fsm,state)<<=T2()(evt,fsm,state));
1198 template <class T1,class T2>
1199 struct ShiftRight_Assign_ : euml_action<ShiftRight_Assign_<T1,T2> >
1201 template <class Event,class FSM,class STATE >
1202 struct state_action_result
1204 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1206 template <class EVT,class FSM,class SourceState,class TargetState>
1207 struct transition_action_result
1209 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1211 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1213 template <class EVT,class FSM,class SourceState,class TargetState>
1214 typename ::boost::enable_if<
1215 typename ::boost::mpl::has_key<
1216 typename T1::tag_type,action_tag>::type,
1217 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1218 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1220 return (T1()(evt,fsm,src,tgt)>>=T2()(evt,fsm,src,tgt));
1222 template <class Event,class FSM,class STATE>
1223 typename ::boost::enable_if<
1224 typename ::boost::mpl::has_key<
1225 typename T1::tag_type,state_action_tag>::type,
1226 typename state_action_result<Event,FSM,STATE>::type >::type
1227 operator()(Event const& evt,FSM& fsm,STATE& state )const
1229 return (T1()(evt,fsm,state)>>=T2()(evt,fsm,state));
1232 template <class T1,class T2>
1233 struct ShiftLeft_ : euml_action<ShiftLeft_<T1,T2> >
1235 template <class Event,class FSM,class STATE >
1236 struct state_action_result
1238 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1240 template <class EVT,class FSM,class SourceState,class TargetState>
1241 struct transition_action_result
1243 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1245 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1247 template <class EVT,class FSM,class SourceState,class TargetState>
1248 typename ::boost::enable_if<
1249 typename ::boost::mpl::has_key<
1250 typename T1::tag_type,action_tag>::type,
1251 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1252 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1254 return (T1()(evt,fsm,src,tgt)<<T2()(evt,fsm,src,tgt));
1256 template <class Event,class FSM,class STATE>
1257 typename ::boost::enable_if<
1258 typename ::boost::mpl::has_key<
1259 typename T1::tag_type,state_action_tag>::type,
1260 typename state_action_result<Event,FSM,STATE>::type >::type
1261 operator()(Event const& evt,FSM& fsm,STATE& state )const
1263 return (T1()(evt,fsm,state)<<T2()(evt,fsm,state));
1266 template <class T1,class T2>
1267 struct ShiftRight_ : euml_action<ShiftRight_<T1,T2> >
1269 template <class Event,class FSM,class STATE >
1270 struct state_action_result
1272 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1274 template <class EVT,class FSM,class SourceState,class TargetState>
1275 struct transition_action_result
1277 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1279 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1281 template <class EVT,class FSM,class SourceState,class TargetState>
1282 typename ::boost::enable_if<
1283 typename ::boost::mpl::has_key<
1284 typename T1::tag_type,action_tag>::type,
1285 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1286 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1288 return (T1()(evt,fsm,src,tgt)>>T2()(evt,fsm,src,tgt));
1290 template <class Event,class FSM,class STATE>
1291 typename ::boost::enable_if<
1292 typename ::boost::mpl::has_key<
1293 typename T1::tag_type,state_action_tag>::type,
1294 typename state_action_result<Event,FSM,STATE>::type >::type
1295 operator()(Event const& evt,FSM& fsm,STATE& state )const
1297 return (T1()(evt,fsm,state)>>T2()(evt,fsm,state));
1300 template <class T1,class T2>
1301 struct Assign_ : euml_action<Assign_<T1,T2> >
1303 using euml_action< Assign_<T1,T2> >::operator=;
1304 template <class Event,class FSM,class STATE >
1305 struct state_action_result
1307 typedef typename get_result_type2<T1,Event,FSM,STATE>::type type;
1309 template <class EVT,class FSM,class SourceState,class TargetState>
1310 struct transition_action_result
1312 typedef typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type type;
1314 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1316 template <class EVT,class FSM,class SourceState,class TargetState>
1317 typename ::boost::enable_if<
1318 typename ::boost::mpl::has_key<
1319 typename T1::tag_type,action_tag>::type,
1320 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1321 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1323 return (T1()(evt,fsm,src,tgt)=T2()(evt,fsm,src,tgt));
1325 template <class Event,class FSM,class STATE>
1326 typename ::boost::enable_if<
1327 typename ::boost::mpl::has_key<
1328 typename T1::tag_type,state_action_tag>::type,
1329 typename state_action_result<Event,FSM,STATE>::type >::type
1330 operator()(Event const& evt,FSM& fsm,STATE& state )const
1332 return (T1()(evt,fsm,state)=T2()(evt,fsm,state));
1336 struct Unary_Plus_ : euml_action<Unary_Plus_<T1> >
1338 template <class Event,class FSM,class STATE >
1339 struct state_action_result
1341 typedef typename ::boost::remove_reference<
1342 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
1344 template <class EVT,class FSM,class SourceState,class TargetState>
1345 struct transition_action_result
1347 typedef typename ::boost::remove_reference<
1348 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
1350 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1352 template <class EVT,class FSM,class SourceState,class TargetState>
1353 typename ::boost::enable_if<
1354 typename ::boost::mpl::has_key<
1355 typename T1::tag_type,action_tag>::type,
1356 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1357 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1359 return +T1()(evt,fsm,src,tgt);
1361 template <class Event,class FSM,class STATE>
1362 typename ::boost::enable_if<
1363 typename ::boost::mpl::has_key<
1364 typename T1::tag_type,state_action_tag>::type,
1365 typename state_action_result<Event,FSM,STATE>::type >::type
1366 operator()(Event const& evt,FSM& fsm,STATE& state )const
1368 return +T1()(evt,fsm,state);
1372 struct Unary_Minus_ : euml_action<Unary_Minus_<T1> >
1374 template <class Event,class FSM,class STATE >
1375 struct state_action_result
1377 typedef typename ::boost::remove_reference<
1378 typename get_result_type2<T1,Event,FSM,STATE>::type>::type type;
1380 template <class EVT,class FSM,class SourceState,class TargetState>
1381 struct transition_action_result
1383 typedef typename ::boost::remove_reference<
1384 typename get_result_type<T1,EVT,FSM,SourceState,TargetState>::type>::type type;
1386 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1388 template <class EVT,class FSM,class SourceState,class TargetState>
1389 typename ::boost::enable_if<
1390 typename ::boost::mpl::has_key<
1391 typename T1::tag_type,action_tag>::type,
1392 typename transition_action_result<EVT,FSM,SourceState,TargetState>::type >::type
1393 operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1395 return -(T1()(evt,fsm,src,tgt));
1397 template <class Event,class FSM,class STATE>
1398 typename ::boost::enable_if<
1399 typename ::boost::mpl::has_key<
1400 typename T1::tag_type,state_action_tag>::type,
1401 typename state_action_result<Event,FSM,STATE>::type >::type
1402 operator()(Event const& evt,FSM& fsm,STATE& state )const
1404 return -(T1()(evt,fsm,state));
1407 template <class T1,class T2>
1408 struct Less_ : euml_action<Less_<T1,T2> >
1410 template <class Event,class FSM,class STATE >
1411 struct state_action_result
1415 template <class EVT,class FSM,class SourceState,class TargetState>
1416 struct transition_action_result
1420 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1422 template <class EVT,class FSM,class SourceState,class TargetState>
1423 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1425 return (T1()(evt,fsm,src,tgt) < T2()(evt,fsm,src,tgt));
1427 template <class Event,class FSM,class STATE>
1428 bool operator()(Event const& evt,FSM& fsm,STATE& state)const
1430 return (T1()(evt,fsm,state) < T2()(evt,fsm,state));
1433 template <class T1,class T2>
1434 struct LessEqual_ : euml_action<LessEqual_<T1,T2> >
1436 template <class Event,class FSM,class STATE >
1437 struct state_action_result
1441 template <class EVT,class FSM,class SourceState,class TargetState>
1442 struct transition_action_result
1446 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1448 template <class EVT,class FSM,class SourceState,class TargetState>
1449 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1451 return (T1()(evt,fsm,src,tgt) <= T2()(evt,fsm,src,tgt));
1453 template <class Event,class FSM,class STATE>
1454 bool operator()(Event const& evt,FSM& fsm,STATE& state)const
1456 return (T1()(evt,fsm,state) <= T2()(evt,fsm,state));
1459 template <class T1,class T2>
1460 struct Greater_ : euml_action<Greater_<T1,T2> >
1462 template <class Event,class FSM,class STATE >
1463 struct state_action_result
1467 template <class EVT,class FSM,class SourceState,class TargetState>
1468 struct transition_action_result
1472 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1474 template <class EVT,class FSM,class SourceState,class TargetState>
1475 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1477 return (T1()(evt,fsm,src,tgt) > T2()(evt,fsm,src,tgt));
1479 template <class Event,class FSM,class STATE>
1480 bool operator()(Event const& evt,FSM& fsm,STATE& state)const
1482 return (T1()(evt,fsm,state) > T2()(evt,fsm,state));
1485 template <class T1,class T2>
1486 struct GreaterEqual_ : euml_action<GreaterEqual_<T1,T2> >
1488 template <class Event,class FSM,class STATE >
1489 struct state_action_result
1493 template <class EVT,class FSM,class SourceState,class TargetState>
1494 struct transition_action_result
1498 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1500 template <class EVT,class FSM,class SourceState,class TargetState>
1501 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1503 return (T1()(evt,fsm,src,tgt) >= T2()(evt,fsm,src,tgt));
1505 template <class Event,class FSM,class STATE>
1506 bool operator()(Event const& evt,FSM& fsm,STATE& state)const
1508 return (T1()(evt,fsm,state) >= T2()(evt,fsm,state));
1511 template <class T1,class T2>
1512 struct EqualTo_ : euml_action<EqualTo_<T1,T2> >
1514 template <class Event,class FSM,class STATE >
1515 struct state_action_result
1519 template <class EVT,class FSM,class SourceState,class TargetState>
1520 struct transition_action_result
1524 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1526 template <class EVT,class FSM,class SourceState,class TargetState>
1527 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1529 return (T1()(evt,fsm,src,tgt) == T2()(evt,fsm,src,tgt));
1531 template <class Event,class FSM,class STATE>
1532 bool operator()(Event const& evt,FSM& fsm,STATE& state)const
1534 return (T1()(evt,fsm,state) == T2()(evt,fsm,state));
1537 template <class T1,class T2>
1538 struct NotEqualTo_ : euml_action<NotEqualTo_<T1,T2> >
1540 template <class Event,class FSM,class STATE >
1541 struct state_action_result
1545 template <class EVT,class FSM,class SourceState,class TargetState>
1546 struct transition_action_result
1550 typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
1552 template <class EVT,class FSM,class SourceState,class TargetState>
1553 bool operator()(EVT const& evt, FSM& fsm,SourceState& src,TargetState& tgt)const
1555 return (T1()(evt,fsm,src,tgt) != T2()(evt,fsm,src,tgt));
1557 template <class Event,class FSM,class STATE>
1558 bool operator()(Event const& evt,FSM& fsm,STATE& state)const
1560 return (T1()(evt,fsm,state) != T2()(evt,fsm,state));
1566 #endif // BOOST_MSM_FRONT_EUML_OPERATOR_H