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
11#ifndef BOOST_MSM_FRONT_EUML_STATE_GRAMMAR_H
12#define BOOST_MSM_FRONT_EUML_STATE_GRAMMAR_H
13
14#ifdef BOOST_MSM_EUML_PHOENIX_SUPPORT
15#include <boost/phoenix/core/meta_grammar.hpp>
16#endif
17
18#include <boost/msm/front/euml/common.hpp>
19#include <boost/fusion/container/vector.hpp>
20#include <boost/fusion/include/pair.hpp>
21#include <boost/fusion/include/as_map.hpp>
22
23#include <boost/mpl/remove_if.hpp>
24#include <boost/mpl/eval_if.hpp>
25#include <boost/mpl/assert.hpp>
26
27#include <boost/msm/row_tags.hpp>
28#include <boost/msm/front/common_states.hpp>
29#include <boost/msm/front/state_machine_def.hpp>
30#include <boost/msm/front/euml/operator.hpp>
31#include <boost/msm/front/euml/guard_grammar.hpp>
32
33BOOST_MPL_HAS_XXX_TRAIT_DEF(attribute_tag)
34BOOST_MPL_HAS_XXX_TRAIT_DEF(flag_create_tag)
35BOOST_MPL_HAS_XXX_TRAIT_DEF(defer_create_tag)
36BOOST_MPL_HAS_XXX_TRAIT_DEF(control_configure_tag)
37
38namespace proto = boost::proto;
39
40namespace boost { namespace msm { namespace front { namespace euml
41{
42
43// provides the typedefs and interface. Concrete states derive from it.
44template<class StateNameTag,
45 class EntryFunctor=NoAction,
46 class ExitFunctor=NoAction,
47 class Attributes= ::boost::fusion::vector<>,
48 class Flags = ::boost::fusion::vector0<>,
49 class Defer = ::boost::fusion::vector0<>,
50 class BASE = ::boost::msm::front::default_base_state>
51struct func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
52 euml_state_intern<func_state<StateNameTag,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
53{
54 func_state(){}
55 // grammar testing
56 BOOST_MPL_ASSERT_NOT(( boost::is_same<EntryFunctor,invalid_type> ));
57 BOOST_MPL_ASSERT_NOT(( boost::is_same<ExitFunctor,invalid_type> ));
58
59 typedef StateNameTag state_name_tag;
60 // flags
61 typedef Flags flag_list;
62 typedef ::boost::fusion::vector0<> internal_flag_list;
63 // deferred events
64 typedef Defer deferred_events;
65
66 template <class Event,class FSM>
67 void on_entry(Event const& evt,FSM& fsm)
68 {
69 EntryFunctor()(evt,fsm,*this);
70 }
71 template <class Event,class FSM>
72 void on_exit(Event const& evt,FSM& fsm)
73 {
74 ExitFunctor()(evt,fsm,*this);
75 }
76};
77
78// provides the typedefs and interface. Concrete states derive from it.
79template<class StateNameTag,
80 int ZoneIndex=-1,
81 class EntryFunctor=NoAction,
82 class ExitFunctor=NoAction,
83 class Attributes= ::boost::fusion::vector<>,
84 class Flags = ::boost::fusion::vector0<>,
85 class Defer = ::boost::fusion::vector0<>,
86 class BASE = default_base_state>
87struct entry_func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
88 euml_state_intern<entry_func_state<StateNameTag,ZoneIndex,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
89{
90 entry_func_state(){}
91 // grammar testing
92 BOOST_MPL_ASSERT_NOT(( boost::is_same<EntryFunctor,invalid_type> ));
93 BOOST_MPL_ASSERT_NOT(( boost::is_same<ExitFunctor,invalid_type> ));
94
95 typedef StateNameTag state_name_tag;
96 // tags
97 typedef int pseudo_entry;
98 enum {zone_index=ZoneIndex};
99 typedef int explicit_entry_state;
100
101 // flags
102 typedef Flags flag_list;
103 typedef ::boost::fusion::vector0<> internal_flag_list;
104 // deferred events
105 typedef Defer deferred_events;
106
107 template <class Event,class FSM>
108 void on_entry(Event const& evt,FSM& fsm)
109 {
110 EntryFunctor()(evt,fsm,*this);
111 }
112 template <class Event,class FSM>
113 void on_exit(Event const& evt,FSM& fsm)
114 {
115 ExitFunctor()(evt,fsm,*this);
116 }
117};
118// provides the typedefs and interface. Concrete states derive from it.
119template<class StateNameTag,
120 int ZoneIndex=-1,
121 class EntryFunctor=NoAction,
122 class ExitFunctor=NoAction,
123 class Attributes= ::boost::fusion::vector<>,
124 class Flags = ::boost::fusion::vector0<>,
125 class Defer = ::boost::fusion::vector0<>,
126 class BASE = default_base_state>
127struct explicit_entry_func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
128 public ::boost::msm::front::explicit_entry<ZoneIndex>,
129 euml_state_intern<explicit_entry_func_state<StateNameTag,
130 ZoneIndex,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
131{
132 explicit_entry_func_state(){}
133 // grammar testing
134 BOOST_MPL_ASSERT_NOT(( boost::is_same<EntryFunctor,invalid_type> ));
135 BOOST_MPL_ASSERT_NOT(( boost::is_same<ExitFunctor,invalid_type> ));
136
137 typedef StateNameTag state_name_tag;
138 // flags
139 typedef Flags flag_list;
140 typedef ::boost::fusion::vector0<> internal_flag_list;
141 // deferred events
142 typedef Defer deferred_events;
143
144 template <class Event,class FSM>
145 void on_entry(Event const& evt,FSM& fsm)
146 {
147 EntryFunctor()(evt,fsm,*this);
148 }
149 template <class Event,class FSM>
150 void on_exit(Event const& evt,FSM& fsm)
151 {
152 ExitFunctor()(evt,fsm,*this);
153 }
154};
155
156// provides the typedefs and interface. Concrete states derive from it.
157template<class StateNameTag,
158 class Event,
159 class EntryFunctor=NoAction,
160 class ExitFunctor=NoAction,
161 class Attributes= ::boost::fusion::vector<>,
162 class Flags = ::boost::fusion::vector0<>,
163 class Defer = ::boost::fusion::vector0<>,
164 class BASE = default_base_state>
165struct exit_func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
166 euml_state_intern<exit_func_state<StateNameTag,Event,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
167{
168 exit_func_state(){}
169 // grammar testing
170 BOOST_MPL_ASSERT_NOT(( boost::is_same<EntryFunctor,invalid_type> ));
171 BOOST_MPL_ASSERT_NOT(( boost::is_same<ExitFunctor,invalid_type> ));
172
173 typedef StateNameTag state_name_tag;
174 // tags
175 typedef Event event;
176 typedef BASE Base;
177 typedef int pseudo_exit;
178
179 // flags
180 typedef Flags flag_list;
181 typedef ::boost::fusion::vector0<> internal_flag_list;
182 // deferred events
183 typedef Defer deferred_events;
184
185 template <class Evt,class FSM>
186 void on_entry(Evt const& evt,FSM& fsm)
187 {
188 EntryFunctor()(evt,fsm,*this);
189 }
190 template <class Evt,class FSM>
191 void on_exit(Evt const& evt,FSM& fsm)
192 {
193 ExitFunctor()(evt,fsm,*this);
194 }
195};
196
197struct BuildActions;
198struct BuildGuards;
199
200struct BuildActionSequence
201 : proto::or_<
202 proto::when <
203 BuildActions,
204 ActionSequence_<make_vector_one_row<BuildActions(proto::_)>()>()
205 >,
206 proto::when <
207 proto::comma<BuildActions,BuildActions >,
208 ActionSequence_<boost::mpl::push_back<
209 make_vector_one_row<BuildActions(proto::_left)>(),
210 BuildActions(proto::_right)>()>()
211 >,
212 proto::when <
213 proto::comma<BuildActionSequence,BuildActions >,
214 ActionSequence_<boost::mpl::push_back<
215 get_sequence<BuildActionSequence(proto::_left) >(),
216 BuildActions(proto::_right) >() >()
217 >
218 >
219{};
220
221#ifdef BOOST_MSM_EUML_PHOENIX_SUPPORT
222struct CustomPhoenixGrammar
223 : proto::switch_<CustomPhoenixGrammar>
224{
225 template <typename Tag, typename Dummy = void>
226 struct case_
227 : proto::and_<
228 proto::not_<BuildGuards> ,
229 proto::not_<BuildActionSequence>,
230 boost::phoenix::meta_grammar::case_<Tag>
231 >
232 {};
233};
234#endif
235
236struct GuardGrammar
237 : proto::or_<
238#ifdef BOOST_MSM_EUML_PHOENIX_SUPPORT
239 proto::when<
240 CustomPhoenixGrammar ,
241 proto::_
242 >,
243#endif
244 proto::when<
245 BuildGuards ,
246 BuildGuards
247 >
248 >
249 {};
250
251struct ActionGrammar
252 : proto::or_<
253#ifdef BOOST_MSM_EUML_PHOENIX_SUPPORT
254 proto::when<
255 CustomPhoenixGrammar ,
256 proto::_
257 >,
258#endif
259 proto::when<
260 BuildActionSequence ,
261 BuildActionSequence
262 >
263 >
264 {};
265
266struct BuildActionsCases
267{
268 // The primary template matches nothing:
269 template<typename Tag>
270 struct case_
271 : proto::not_<proto::_>
272 {};
273};
274
275template<>
276struct BuildActionsCases::case_<proto::tag::pre_inc>
277 : proto::when<
278 proto::pre_inc<BuildActions >,
279 Pre_inc_< BuildActions(proto::_child)>()
280 >
281{};
282template<>
283struct BuildActionsCases::case_<proto::tag::pre_dec>
284 : proto::when<
285 proto::pre_dec<BuildActions >,
286 Pre_dec_< BuildActions(proto::_child)>()
287 >
288{};
289template<>
290struct BuildActionsCases::case_<proto::tag::post_inc>
291 : proto::when<
292 proto::post_inc<BuildActions >,
293 Post_inc_< BuildActions(proto::_child)>()
294 >
295{};
296template<>
297struct BuildActionsCases::case_<proto::tag::post_dec>
298 : proto::when<
299 proto::post_dec<BuildActions >,
300 Post_dec_< BuildActions(proto::_child)>()
301 >
302{};
303template<>
304struct BuildActionsCases::case_<proto::tag::dereference>
305 : proto::when<
306 proto::dereference<BuildActions >,
307 Deref_< BuildActions(proto::_child)>()
308 >
309{};
310template<>
311struct BuildActionsCases::case_<proto::tag::plus>
312 : proto::when<
313 proto::plus<BuildActions,BuildActions >,
314 Plus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
315 >
316{};
317template<>
318struct BuildActionsCases::case_<proto::tag::minus>
319 : proto::when<
320 proto::minus<BuildActions,BuildActions >,
321 Minus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
322 >
323{};
324template<>
325struct BuildActionsCases::case_<proto::tag::multiplies>
326 : proto::when<
327 proto::multiplies<BuildActions,BuildActions >,
328 Multiplies_<BuildActions(proto::_left),BuildActions(proto::_right)>()
329 >
330{};
331template<>
332struct BuildActionsCases::case_<proto::tag::divides>
333 : proto::when<
334 proto::divides<BuildActions,BuildActions >,
335 Divides_<BuildActions(proto::_left),BuildActions(proto::_right)>()
336 >
337{};
338template<>
339struct BuildActionsCases::case_<proto::tag::modulus>
340 : proto::when<
341 proto::modulus<BuildActions,BuildActions >,
342 Modulus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
343 >
344{};
345template<>
346struct BuildActionsCases::case_<proto::tag::bitwise_and>
347 : proto::when<
348 proto::bitwise_and<BuildActions,BuildActions >,
349 Bitwise_And_<BuildActions(proto::_left),BuildActions(proto::_right)>()
350 >
351{};
352template<>
353struct BuildActionsCases::case_<proto::tag::bitwise_or>
354 : proto::when<
355 proto::bitwise_or<BuildActions,BuildActions >,
356 Bitwise_Or_<BuildActions(proto::_left),BuildActions(proto::_right)>()
357 >
358{};
359template<>
360struct BuildActionsCases::case_<proto::tag::bitwise_xor>
361 : proto::when<
362 proto::bitwise_xor<BuildActions,BuildActions >,
363 Bitwise_Xor_<BuildActions(proto::_left),BuildActions(proto::_right)>()
364 >
365{};
366
367template<>
368struct BuildActionsCases::case_<proto::tag::plus_assign>
369 : proto::when<
370 proto::plus_assign<BuildActions,BuildActions >,
371 Plus_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
372 >
373{};
374template<>
375struct BuildActionsCases::case_<proto::tag::minus_assign>
376 : proto::when<
377 proto::minus_assign<BuildActions,BuildActions >,
378 Minus_Assign_<BuildActions(proto::_left),BuildActions(proto::_right)>()
379 >
380{};
381template<>
382struct BuildActionsCases::case_<proto::tag::multiplies_assign>
383 : proto::when<
384 proto::multiplies_assign<BuildActions,BuildActions >,
385 Multiplies_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
386 >
387{};
388template<>
389struct BuildActionsCases::case_<proto::tag::divides_assign>
390 : proto::when<
391 proto::divides_assign<BuildActions,BuildActions >,
392 Divides_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
393 >
394{};
395template<>
396struct BuildActionsCases::case_<proto::tag::modulus_assign>
397 : proto::when<
398 proto::modulus_assign<BuildActions,BuildActions >,
399 Modulus_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
400 >
401{};
402template<>
403struct BuildActionsCases::case_<proto::tag::shift_left_assign>
404 : proto::when<
405 proto::shift_left_assign<BuildActions,BuildActions >,
406 ShiftLeft_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
407 >
408{};
409template<>
410struct BuildActionsCases::case_<proto::tag::shift_right_assign>
411 : proto::when<
412 proto::shift_right_assign<BuildActions,BuildActions >,
413 ShiftRight_Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
414 >
415{};
416template<>
417struct BuildActionsCases::case_<proto::tag::shift_left>
418 : proto::when<
419 proto::shift_left<BuildActions,BuildActions >,
420 ShiftLeft_< BuildActions(proto::_left),BuildActions(proto::_right)>()
421 >
422{};
423template<>
424struct BuildActionsCases::case_<proto::tag::shift_right>
425 : proto::when<
426 proto::shift_right<BuildActions,BuildActions >,
427 ShiftRight_< BuildActions(proto::_left),BuildActions(proto::_right)>()
428 >
429{};
430template<>
431struct BuildActionsCases::case_<proto::tag::assign>
432 : proto::when<
433 proto::assign<BuildActions,BuildActions >,
434 Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
435 >
436{};
437template<>
438struct BuildActionsCases::case_<proto::tag::subscript>
439 : proto::when<
440 proto::subscript<BuildActions,BuildActions >,
441 Subscript_< BuildActions(proto::_left),BuildActions(proto::_right)>()
442 >
443{};
444template<>
445struct BuildActionsCases::case_<proto::tag::unary_plus>
446 : proto::when<
447 proto::unary_plus<BuildActions >,
448 Unary_Plus_< BuildActions(proto::_child)>()
449 >
450{};
451template<>
452struct BuildActionsCases::case_<proto::tag::negate>
453 : proto::when<
454 proto::negate<BuildActions >,
455 Unary_Minus_< BuildActions(proto::_child)>()
456 >
457{};
458
459template<>
460struct BuildActionsCases::case_<proto::tag::function>
461 : proto::or_<
462 proto::when<
463 proto::function<proto::terminal<if_tag>,BuildGuards,BuildActionSequence,BuildActionSequence >,
464 If_Else_<BuildGuards(proto::_child_c<1>),
465 BuildActionSequence(proto::_child_c<2>),
466 BuildActionSequence(proto::_child_c<3>) >()
467 >,
468 proto::when<
469 proto::function<proto::terminal<if_then_tag>,BuildGuards,BuildActionSequence >,
470 If_Then_<BuildGuards(proto::_child_c<1>),
471 BuildActionSequence(proto::_child_c<2>)>()
472 >,
473 proto::when<
474 proto::function<proto::terminal<while_do_tag>,BuildGuards,BuildActionSequence >,
475 While_Do_<BuildGuards(proto::_child_c<1>),
476 BuildActionSequence(proto::_child_c<2>) >()
477 >,
478 proto::when<
479 proto::function<proto::terminal<do_while_tag>,BuildGuards,BuildActionSequence >,
480 Do_While_<BuildGuards(proto::_child_c<1>),
481 BuildActionSequence(proto::_child_c<2>) >()
482 >,
483 proto::when<
484 proto::function<proto::terminal<for_loop_tag>,
485 BuildActionSequence,BuildGuards,BuildActionSequence,BuildActionSequence>,
486 For_Loop_<BuildActionSequence(proto::_child_c<1>),
487 BuildGuards(proto::_child_c<2>),
488 BuildActionSequence(proto::_child_c<3>),
489 BuildActionSequence(proto::_child_c<4>) >()
490 >,
491 proto::or_<
492 proto::when<
493 proto::function<proto::terminal<proto::_>,BuildActions >,
494 get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>) >()
495 >,
496 proto::when<
497 proto::function<proto::terminal<proto::_> >,
498 get_fct<proto::_child_c<0> >()
499 >,
500 proto::when<
501 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions >,
502 get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>) >()
503 >,
504 proto::when<
505 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions >,
506 get_fct<proto::_child_c<0>,BuildActions(proto::_child_c<1>)
507 ,BuildActions(proto::_child_c<2>),BuildActions(proto::_child_c<3>) >()
508 >,
509 proto::when<
510 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions >,
511 get_fct<proto::_child_c<0>
512 ,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
513 ,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>) >()
514 >,
515 proto::when<
516 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
517 get_fct<proto::_child_c<0>
518 ,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
519 ,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>)
520 ,BuildActions(proto::_child_c<5>) >()
521 >
522#ifdef BOOST_MSVC
523 ,proto::when<
524 proto::function<proto::terminal<proto::_>,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions,BuildActions >,
525 get_fct<proto::_child_c<0>
526 ,BuildActions(proto::_child_c<1>),BuildActions(proto::_child_c<2>)
527 ,BuildActions(proto::_child_c<3>),BuildActions(proto::_child_c<4>)
528 ,BuildActions(proto::_child_c<5>),BuildActions(proto::_child_c<6>) >()
529 >
530#endif
531 >
532 >
533{};
534
535template<>
536struct BuildActionsCases::case_<proto::tag::terminal>
537 : proto::or_<
538 proto::when<
539 proto::terminal<action_tag>,
540 get_action_name<proto::_ >()
541 >,
542 proto::when<
543 proto::terminal<state_tag>,
544 get_state_name<proto::_>()
545 >,
546 proto::when<
547 proto::terminal<flag_tag>,
548 proto::_
549 >,
550 proto::when<
551 proto::terminal<event_tag>,
552 proto::_
553 >,
554 proto::when<
555 proto::terminal<fsm_artefact_tag>,
556 get_fct<proto::_ >()
557 >,
558 proto::when<
559 proto::terminal<proto::_>,
560 proto::_value
561 >
562 >
563{};
564struct BuildActions
565 : proto::switch_<BuildActionsCases>
566{};
567
568// attributes building
569#define BOOST_MSM_EUML_DECLARE_ATTRIBUTE(attr_type,attr_name) \
570struct attr_name ## _ \
571 : proto::extends< proto::terminal< ::boost::msm::front::action_tag>::type, attr_name ## _, boost::msm::sm_domain> \
572 {typedef attr_name ## _ action_name; \
573 typedef ::boost::fusion::pair<attr_name ## _,attr_type> attribute_type; \
574 attr_name ## _ (){} \
575 }; \
576attr_name ## _ const attr_name = attr_name ## _();
577
578struct make_attributes_tag
579{
580 typedef int attribute_tag;
581};
582
583template <class T>
584struct get_attribute_type
585{
586 typedef typename T::attribute_type type;
587};
588template <class Seq>
589struct transform_to_fusion_pair
590{
591 typedef typename ::boost::mpl::fold<
592 Seq,::boost::fusion::vector<>,
593 ::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
594 get_attribute_type< ::boost::mpl::placeholders::_2> >
595 >::type type;
596};
597
598template<class X = proto::is_proto_expr>
599struct attribute
600{
601 BOOST_PROTO_BASIC_EXTENDS(
602 proto::terminal<make_attributes_tag>::type
603 , attribute
604 , boost::msm::sm_domain
605 )
606 typedef ::boost::fusion::pair<int,int> attribute_type;
607};
608
609attribute<> const attributes_ = {.proto_expr_: {.child0: {}}};
610 attribute<> const no_attributes_ = {.proto_expr_: {.child0: {}}};
611
612 struct BuildAttributesHelper
613 : proto::make<
614 ::boost::mpl::pop_front<
615 proto::fold_tree<
616 proto::_
617 , ::boost::fusion::vector<>()
618 , ::boost::mpl::push_back<proto::_state,
619 ::boost::mpl::if_< has_attribute_tag< proto::_value>,
620 proto::_value,
621 get_attribute_type<proto::_> >
622 >()
623 >
624 >
625 >
626 {};
627
628struct BuildAttributes
629 : proto::make<
630 ::boost::mpl::if_<
631 has_attribute_tag< ::boost::mpl::deref< ::boost::mpl::prior< ::boost::mpl::end< BuildAttributesHelper > > > >,
632 ::boost::fusion::result_of::as_map< ::boost::mpl::pop_back< BuildAttributesHelper > >,
633 ::boost::fusion::result_of::as_map< BuildAttributesHelper > >
634 >
635{};
636
637// helper to build a fusion::vector from a << list
638 struct BuildMplVectorHelper
639 : proto::make<
640 ::boost::mpl::pop_front<
641 proto::fold_tree<
642 proto::_
643 , ::boost::fusion::vector0<>()
644 , ::boost::mpl::push_back<proto::_state, proto::_>()
645 >
646 >
647 >
648 {};
649
650// flags building
651struct BuildFlags
652 : proto::make<
653 ::boost::mpl::remove_if<
654 BuildMplVectorHelper,
655 ::boost::mpl::not_< ::boost::is_same<get_euml_tag_type< ::boost::mpl::placeholders::_ >, flag_tag > >
656 >
657 >
658{};
659
660struct control_configure_tag {};
661
662// configuration building
663struct make_configure_tag
664{
665 typedef int control_configure_tag;
666};
667
668template<class X = proto::is_proto_expr>
669struct configure
670{
671 typedef not_euml_tag euml_tag_type;
672 BOOST_PROTO_BASIC_EXTENDS(
673 proto::terminal<make_configure_tag>::type
674 , configure
675 , boost::msm::sm_domain
676 )
677};
678
679 configure<> const configure_ = {.proto_expr_: {.child0: {}}};
680 configure<> const no_configure_ = {.proto_expr_: {.child0: {}}};
681
682struct BuildConfigure
683 : proto::make<
684 ::boost::mpl::remove_if<
685 BuildMplVectorHelper,
686 ::boost::mpl::not_< ::boost::is_same<get_euml_tag_type< ::boost::mpl::placeholders::_ >, config_tag > >
687 >
688 >
689{};
690
691struct BuildDeferred
692 : proto::make<
693 ::boost::mpl::remove_if<
694 BuildMplVectorHelper,
695 ::boost::mpl::not_< ::boost::is_same<get_euml_tag_type< ::boost::mpl::placeholders::_ >, event_tag > >
696 >
697 >
698{};
699
700template<class X = proto::is_proto_expr>
701struct define_init
702{
703 typedef int defer_create_tag;
704 BOOST_PROTO_BASIC_EXTENDS(
705 proto::terminal<state_tag>::type
706 , define_init
707 , boost::msm::sm_domain
708 )
709};
710
711define_init<> const init_ = {.proto_expr_: {.child0: {}}};
712struct BuildInit
713 : proto::make<
714 ::boost::mpl::pop_front<
715 proto::fold_tree<
716 proto::_
717 , ::boost::fusion::vector0<>()
718 , ::boost::mpl::push_back<proto::_state, proto::_>()
719 >
720 >
721 >
722 {};
723
724template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class BASE>
725inline
726func_state<
727StateNameTag,
728typename ::boost::mpl::eval_if<
729 typename proto::matches<Expr1,ActionGrammar>::type,
730 boost::result_of<ActionGrammar(Expr1)>,
731 make_invalid_type>::type,
732typename ::boost::mpl::eval_if<
733 typename proto::matches<Expr2,ActionGrammar>::type,
734 boost::result_of<ActionGrammar(Expr2)>,
735 make_invalid_type>::type,
736typename boost::result_of<BuildAttributes(Attr)>::type,
737typename boost::result_of<BuildFlags(Configure)>::type,
738typename boost::result_of<BuildDeferred(Configure)>::type,
739BASE
740>
741build_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
742{
743 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
744 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
745 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
746 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
747 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
748 return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type,BASE>();
749}
750
751template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure>
752inline
753func_state<
754StateNameTag,
755typename ::boost::mpl::eval_if<
756 typename proto::matches<Expr1,ActionGrammar>::type,
757 boost::result_of<ActionGrammar(Expr1)>,
758 make_invalid_type>::type,
759typename ::boost::mpl::eval_if<
760 typename proto::matches<Expr2,ActionGrammar>::type,
761 boost::result_of<ActionGrammar(Expr2)>,
762 make_invalid_type>::type,
763typename boost::result_of<BuildAttributes(Attr)>::type,
764typename boost::result_of<BuildFlags(Configure)>::type,
765typename boost::result_of<BuildDeferred(Configure)>::type
766>
767build_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
768{
769 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
770 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
771 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
772 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
773 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
774 return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
775}
776
777template <class StateNameTag,class Expr1,class Expr2,class Attr>
778inline
779func_state<
780StateNameTag,
781typename ::boost::mpl::eval_if<
782 typename proto::matches<Expr1,ActionGrammar>::type,
783 boost::result_of<ActionGrammar(Expr1)>,
784 make_invalid_type>::type,
785typename ::boost::mpl::eval_if<
786 typename proto::matches<Expr2,ActionGrammar>::type,
787 boost::result_of<ActionGrammar(Expr2)>,
788 make_invalid_type>::type,
789typename boost::result_of<BuildAttributes(Attr)>::type
790>
791build_state(Expr1 const& ,Expr2 const& ,Attr const&)
792{
793 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
794 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
795 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
796 return func_state<StateNameTag,entry_action,exit_action,attributes_type>();
797}
798
799template <class StateNameTag,class Expr1,class Expr2>
800inline
801func_state<
802StateNameTag,
803typename ::boost::mpl::eval_if<
804 typename proto::matches<Expr1,ActionGrammar>::type,
805 boost::result_of<ActionGrammar(Expr1)>,
806 make_invalid_type>::type,
807typename ::boost::mpl::eval_if<
808 typename proto::matches<Expr2,ActionGrammar>::type,
809 boost::result_of<ActionGrammar(Expr2)>,
810 make_invalid_type>::type
811>
812build_state(Expr1 const& ,Expr2 const& )
813{
814 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
815 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
816 return func_state<StateNameTag,entry_action,exit_action>();
817}
818
819template <class StateNameTag,class Expr1>
820inline
821func_state<
822StateNameTag,
823typename ::boost::mpl::eval_if<
824 typename proto::matches<Expr1,ActionGrammar>::type,
825 boost::result_of<ActionGrammar(Expr1)>,
826 make_invalid_type>::type,
827NoAction
828>
829build_state(Expr1 const& )
830{
831 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
832 return func_state<StateNameTag,entry_action,NoAction>();
833}
834template<class StateNameTag>
835inline
836func_state<
837StateNameTag,
838NoAction,
839NoAction
840>
841build_state()
842{
843 return func_state<StateNameTag,NoAction,NoAction>();
844}
845
846// provides the typedefs and interface. Concrete states derive from it.
847template<class StateNameTag,
848 class STT,
849 class Init,
850 class EntryFunctor=NoAction,
851 class ExitFunctor=NoAction,
852 class Attributes= ::boost::fusion::vector<>,
853 class Flags = ::boost::fusion::vector0<>,
854 class Defer = ::boost::fusion::vector0<>,
855 class Configuration = ::boost::fusion::vector0<>,
856 class NoTransitionFunctor = NoAction,
857 class OnExceptionFunctor = NoAction,
858 class BASE = ::boost::msm::front::default_base_state>
859struct func_state_machine : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
860 euml_state_intern<func_state_machine<StateNameTag,STT,Init,EntryFunctor,ExitFunctor,Attributes,Flags,
861 Defer,NoTransitionFunctor,OnExceptionFunctor,BASE> >
862{
863 func_state_machine(){}
864 // grammar testing
865 BOOST_MPL_ASSERT_NOT(( boost::is_same<EntryFunctor,invalid_type> ));
866 BOOST_MPL_ASSERT_NOT(( boost::is_same<ExitFunctor,invalid_type> ));
867 BOOST_MPL_ASSERT_NOT(( boost::is_same<NoTransitionFunctor,invalid_type> ));
868 BOOST_MPL_ASSERT_NOT(( boost::is_same<OnExceptionFunctor,invalid_type> ));
869 BOOST_MPL_ASSERT_NOT(( boost::is_same<STT,invalid_type> ));
870
871 // flags
872 typedef StateNameTag state_name_tag;
873 typedef Flags flag_list;
874 typedef ::boost::fusion::vector0<> internal_flag_list;
875 // deferred events
876 typedef Defer deferred_events;
877 // customization (message queue, exceptions)
878 typedef Configuration configuration;
879
880
881 typedef BASE BaseAllStates;
882 typedef STT transition_table;
883 // the initial state of the player SM. Must be defined
884 typedef Init initial_state;
885
886 template <class Event,class FSM>
887 void on_entry(Event const& evt,FSM& fsm)
888 {
889 EntryFunctor()(evt,fsm,*this);
890 }
891 template <class Event,class FSM>
892 void on_exit(Event const& evt,FSM& fsm)
893 {
894 ExitFunctor()(evt,fsm,*this);
895 }
896protected:
897 // Default no-transition handler. Can be replaced in the Derived SM class.
898 template <class FSM,class Event>
899 void no_transition(Event const& evt,FSM& fsm,int state)
900 {
901 NoTransitionFunctor()(evt,fsm,state);
902 }
903 // default exception handler. Can be replaced in the Derived SM class.
904 template <class FSM,class Event>
905 void exception_caught (Event const& evt,FSM& fsm,std::exception& e)
906 {
907 OnExceptionFunctor()(evt,fsm,e);
908 }
909};
910
911template <class StateNameTag,class STT,class Init>
912inline
913func_state_machine<
914StateNameTag,
915STT,
916typename boost::result_of<BuildInit(Init)>::type
917>
918build_sm(STT ,Init)
919{
920 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
921 return func_state_machine<StateNameTag,STT,init_type>();
922}
923
924template <class StateNameTag,class STT,class Init,class Expr1>
925inline
926func_state_machine<
927StateNameTag,
928STT,
929typename boost::result_of<BuildInit(Init)>::type,
930typename ::boost::mpl::eval_if<
931 typename proto::matches<Expr1,ActionGrammar>::type,
932 boost::result_of<ActionGrammar(Expr1)>,
933 make_invalid_type>::type
934>
935build_sm(STT ,Init , Expr1 const&)
936{
937 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
938 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
939 return func_state_machine<StateNameTag,STT,init_type,entry_action>();
940}
941
942template <class StateNameTag,class STT,class Init,class Expr1,class Expr2>
943inline
944func_state_machine<
945StateNameTag,
946STT,
947typename boost::result_of<BuildInit(Init)>::type,
948typename ::boost::mpl::eval_if<
949 typename proto::matches<Expr1,ActionGrammar>::type,
950 boost::result_of<ActionGrammar(Expr1)>,
951 make_invalid_type>::type,
952typename ::boost::mpl::eval_if<
953 typename proto::matches<Expr2,ActionGrammar>::type,
954 boost::result_of<ActionGrammar(Expr2)>,
955 make_invalid_type>::type
956>
957build_sm(STT ,Init , Expr1 const& ,Expr2 const& )
958{
959 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
960 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
961 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
962 return func_state_machine<StateNameTag,STT,init_type,entry_action,exit_action>();
963}
964
965template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr>
966inline
967func_state_machine<
968StateNameTag,
969STT,
970typename boost::result_of<BuildInit(Init)>::type,
971typename ::boost::mpl::eval_if<
972 typename proto::matches<Expr1,ActionGrammar>::type,
973 boost::result_of<ActionGrammar(Expr1)>,
974 make_invalid_type>::type,
975typename ::boost::mpl::eval_if<
976 typename proto::matches<Expr2,ActionGrammar>::type,
977 boost::result_of<ActionGrammar(Expr2)>,
978 make_invalid_type>::type,
979typename boost::result_of<BuildAttributes(Attr)>::type
980>
981build_sm(STT ,Init , Expr1 const& ,Expr2 const& ,Attr const&)
982{
983 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
984 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
985 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
986 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
987 return func_state_machine<StateNameTag,STT,init_type,entry_action,exit_action,attributes_type>();
988}
989
990template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure>
991inline
992func_state_machine<
993StateNameTag,
994STT,
995typename boost::result_of<BuildInit(Init)>::type,
996typename ::boost::mpl::eval_if<
997 typename proto::matches<Expr1,ActionGrammar>::type,
998 boost::result_of<ActionGrammar(Expr1)>,
999 make_invalid_type>::type,
1000typename ::boost::mpl::eval_if<
1001 typename proto::matches<Expr2,ActionGrammar>::type,
1002 boost::result_of<ActionGrammar(Expr2)>,
1003 make_invalid_type>::type,
1004typename boost::result_of<BuildAttributes(Attr)>::type,
1005typename boost::result_of<BuildFlags(Configure)>::type,
1006typename boost::result_of<BuildDeferred(Configure)>::type,
1007typename boost::result_of<BuildConfigure(Configure)>::type
1008>
1009build_sm(STT ,Init , Expr1 const& ,Expr2 const& , Attr const&, Configure const& )
1010{
1011 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
1012 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1013 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1014 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1015 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1016 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1017 typedef typename boost::result_of<BuildConfigure(Configure)>::type config_type;
1018 return func_state_machine<StateNameTag,STT,init_type,entry_action,exit_action,attributes_type,flags_type,
1019 deferred_type,config_type>();
1020
1021}
1022
1023template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure,class Expr3>
1024inline
1025func_state_machine<
1026StateNameTag,
1027STT,
1028typename boost::result_of<BuildInit(Init)>::type,
1029typename ::boost::mpl::eval_if<
1030 typename proto::matches<Expr1,ActionGrammar>::type,
1031 boost::result_of<ActionGrammar(Expr1)>,
1032 make_invalid_type>::type,
1033typename ::boost::mpl::eval_if<
1034 typename proto::matches<Expr2,ActionGrammar>::type,
1035 boost::result_of<ActionGrammar(Expr2)>,
1036 make_invalid_type>::type,
1037typename boost::result_of<BuildAttributes(Attr)>::type,
1038typename boost::result_of<BuildFlags(Configure)>::type,
1039typename boost::result_of<BuildDeferred(Configure)>::type,
1040typename boost::result_of<BuildConfigure(Configure)>::type,
1041typename ::boost::mpl::eval_if<
1042 typename proto::matches<Expr3,ActionGrammar>::type,
1043 boost::result_of<ActionGrammar(Expr3)>,
1044 make_invalid_type>::type
1045>
1046build_sm(STT ,Init , Expr1 const& ,Expr2 const& ,Attr const&, Configure const&, Expr3 const& )
1047{
1048 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
1049 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1050 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1051 typedef typename boost::result_of<ActionGrammar(Expr3)>::type no_transition_action;
1052 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1053 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1054 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1055 typedef typename boost::result_of<BuildConfigure(Configure)>::type config_type;
1056 return func_state_machine<StateNameTag,STT,init_type,entry_action,exit_action,attributes_type,flags_type,deferred_type,
1057 config_type,no_transition_action>();
1058}
1059
1060template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure,class Expr3,class Expr4>
1061inline
1062func_state_machine<
1063StateNameTag,
1064STT,
1065typename boost::result_of<BuildInit(Init)>::type,
1066typename ::boost::mpl::eval_if<
1067 typename proto::matches<Expr1,ActionGrammar>::type,
1068 boost::result_of<ActionGrammar(Expr1)>,
1069 make_invalid_type>::type,
1070typename ::boost::mpl::eval_if<
1071 typename proto::matches<Expr2,ActionGrammar>::type,
1072 boost::result_of<ActionGrammar(Expr2)>,
1073 make_invalid_type>::type,
1074typename boost::result_of<BuildAttributes(Attr)>::type,
1075typename boost::result_of<BuildFlags(Configure)>::type,
1076typename boost::result_of<BuildDeferred(Configure)>::type,
1077typename boost::result_of<BuildConfigure(Configure)>::type,
1078typename ::boost::mpl::eval_if<
1079 typename proto::matches<Expr3,ActionGrammar>::type,
1080 boost::result_of<ActionGrammar(Expr3)>,
1081 make_invalid_type>::type,
1082typename ::boost::mpl::eval_if<
1083 typename proto::matches<Expr4,ActionGrammar>::type,
1084 boost::result_of<ActionGrammar(Expr4)>,
1085 make_invalid_type>::type
1086>
1087build_sm(STT ,Init , Expr1 const& ,Expr2 const& , Attr const&, Configure const&, Expr3 const&, Expr4 const& )
1088{
1089 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
1090 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1091 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1092 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1093 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1094 typedef typename boost::result_of<BuildConfigure(Configure)>::type config_type;
1095 typedef typename boost::result_of<ActionGrammar(Expr3)>::type no_transition_action;
1096 typedef typename boost::result_of<ActionGrammar(Expr4)>::type on_exception_action;
1097 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1098 return func_state_machine<StateNameTag,STT,init_type,entry_action,exit_action,attributes_type,flags_type,deferred_type,
1099 config_type,no_transition_action,on_exception_action>();
1100}
1101
1102template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure,class Expr3,class Expr4,class BASE>
1103inline
1104func_state_machine<
1105StateNameTag,
1106STT,
1107typename boost::result_of<BuildInit(Init)>::type,
1108typename ::boost::mpl::eval_if<
1109 typename proto::matches<Expr1,ActionGrammar>::type,
1110 boost::result_of<ActionGrammar(Expr1)>,
1111 make_invalid_type>::type,
1112typename ::boost::mpl::eval_if<
1113 typename proto::matches<Expr2,ActionGrammar>::type,
1114 boost::result_of<ActionGrammar(Expr2)>,
1115 make_invalid_type>::type,
1116typename boost::result_of<BuildAttributes(Attr)>::type,
1117typename boost::result_of<BuildFlags(Configure)>::type,
1118typename boost::result_of<BuildDeferred(Configure)>::type,
1119typename boost::result_of<BuildConfigure(Configure)>::type,
1120typename ::boost::mpl::eval_if<
1121 typename proto::matches<Expr3,ActionGrammar>::type,
1122 boost::result_of<ActionGrammar(Expr3)>,
1123 make_invalid_type>::type,
1124typename ::boost::mpl::eval_if<
1125 typename proto::matches<Expr4,ActionGrammar>::type,
1126 boost::result_of<ActionGrammar(Expr4)>,
1127 make_invalid_type>::type,
1128BASE
1129>
1130build_sm(STT ,Init , Expr1 const& ,Expr2 const& ,Attr const& , Configure const&, Expr3 const&, Expr4 const& , BASE )
1131{
1132 typedef typename boost::result_of<BuildInit(Init)>::type init_type;
1133 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1134 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1135 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1136 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1137 typedef typename boost::result_of<BuildConfigure(Configure)>::type config_type;
1138 typedef typename boost::result_of<ActionGrammar(Expr3)>::type no_transition_action;
1139 typedef typename boost::result_of<ActionGrammar(Expr4)>::type on_exception_action;
1140 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1141 return func_state_machine<StateNameTag,STT,init_type,entry_action,exit_action,attributes_type,flags_type,deferred_type,
1142 config_type,no_transition_action,on_exception_action,BASE>();
1143}
1144
1145template <class Expr>
1146inline
1147::boost::msm::front::detail::inherit_attributes<typename boost::result_of<BuildAttributes(Expr)>::type>
1148build_attributes (Expr const&)
1149{
1150 return ::boost::msm::front::detail::inherit_attributes<typename boost::result_of<BuildAttributes(Expr)>::type> ();
1151}
1152
1153template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1154inline
1155func_state<
1156StateNameTag,
1157typename ::boost::mpl::eval_if<
1158 typename proto::matches<Expr1,ActionGrammar>::type,
1159 boost::result_of<ActionGrammar(Expr1)>,
1160 make_invalid_type>::type,
1161typename ::boost::mpl::eval_if<
1162 typename proto::matches<Expr2,ActionGrammar>::type,
1163 boost::result_of<ActionGrammar(Expr2)>,
1164 make_invalid_type>::type,
1165typename boost::result_of<BuildAttributes(Attr)>::type,
1166typename ::boost::mpl::push_back< typename boost::result_of<BuildFlags(Configure)>::type,
1167 ::boost::msm::TerminateFlag>::type,
1168typename boost::result_of<BuildDeferred(Configure)>::type,
1169BASE
1170>
1171build_terminate_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
1172{
1173 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1174 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1175 typedef typename ::boost::mpl::push_back<
1176 typename boost::result_of<BuildFlags(Configure)>::type,
1177 ::boost::msm::TerminateFlag >::type flags_type;
1178 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1179 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1180 return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type,BASE>();
1181}
1182
1183template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure>
1184inline
1185func_state<
1186StateNameTag,
1187typename ::boost::mpl::eval_if<
1188 typename proto::matches<Expr1,ActionGrammar>::type,
1189 boost::result_of<ActionGrammar(Expr1)>,
1190 make_invalid_type>::type,
1191typename ::boost::mpl::eval_if<
1192 typename proto::matches<Expr2,ActionGrammar>::type,
1193 boost::result_of<ActionGrammar(Expr2)>,
1194 make_invalid_type>::type,
1195typename boost::result_of<BuildAttributes(Attr)>::type,
1196typename ::boost::mpl::push_back< typename boost::result_of<BuildFlags(Configure)>::type,
1197 ::boost::msm::TerminateFlag>::type,
1198typename boost::result_of<BuildDeferred(Configure)>::type
1199>
1200build_terminate_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
1201{
1202 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1203 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1204 typedef typename ::boost::mpl::push_back<
1205 typename boost::result_of<BuildFlags(Configure)>::type,
1206 ::boost::msm::TerminateFlag >::type flags_type;
1207 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1208 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1209
1210 return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
1211}
1212
1213template <class StateNameTag,class Expr1,class Expr2,class Attr>
1214inline
1215func_state<
1216StateNameTag,
1217typename ::boost::mpl::eval_if<
1218 typename proto::matches<Expr1,ActionGrammar>::type,
1219 boost::result_of<ActionGrammar(Expr1)>,
1220 make_invalid_type>::type,
1221typename ::boost::mpl::eval_if<
1222 typename proto::matches<Expr2,ActionGrammar>::type,
1223 boost::result_of<ActionGrammar(Expr2)>,
1224 make_invalid_type>::type,
1225typename boost::result_of<BuildAttributes(Attr)>::type,
1226::boost::fusion::vector<boost::msm::TerminateFlag>
1227>
1228build_terminate_state(Expr1 const& ,Expr2 const& ,Attr const&)
1229{
1230 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1231 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1232 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1233 return func_state<StateNameTag,entry_action,exit_action,attributes_type, ::boost::fusion::vector< ::boost::msm::TerminateFlag> >();
1234}
1235
1236template <class StateNameTag,class Expr1,class Expr2>
1237inline
1238func_state<
1239StateNameTag,
1240typename ::boost::mpl::eval_if<
1241 typename proto::matches<Expr1,ActionGrammar>::type,
1242 boost::result_of<ActionGrammar(Expr1)>,
1243 make_invalid_type>::type,
1244typename ::boost::mpl::eval_if<
1245 typename proto::matches<Expr2,ActionGrammar>::type,
1246 boost::result_of<ActionGrammar(Expr2)>,
1247 make_invalid_type>::type,
1248::boost::fusion::vector<>,
1249::boost::fusion::vector<boost::msm::TerminateFlag>
1250>
1251build_terminate_state(Expr1 const& ,Expr2 const& )
1252{
1253 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1254 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1255 return func_state<StateNameTag,entry_action,exit_action,
1256 ::boost::fusion::vector<>, ::boost::fusion::vector< ::boost::msm::TerminateFlag> >();
1257}
1258
1259template <class StateNameTag,class Expr1>
1260inline
1261func_state<
1262StateNameTag,
1263typename ::boost::mpl::eval_if<
1264 typename proto::matches<Expr1,ActionGrammar>::type,
1265 boost::result_of<ActionGrammar(Expr1)>,
1266 make_invalid_type>::type,
1267NoAction,
1268::boost::fusion::vector<>,
1269::boost::fusion::vector<boost::msm::TerminateFlag>
1270>
1271build_terminate_state(Expr1 const& )
1272{
1273 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1274 return func_state<StateNameTag,entry_action,NoAction,::boost::fusion::vector<>,::boost::fusion::vector<boost::msm::TerminateFlag> >();
1275}
1276template<class StateNameTag>
1277inline
1278func_state<
1279StateNameTag,
1280NoAction,
1281NoAction,
1282::boost::fusion::vector<>,
1283::boost::fusion::vector<boost::msm::TerminateFlag>
1284>
1285build_terminate_state()
1286{
1287 return func_state<StateNameTag,NoAction,NoAction,::boost::fusion::vector<>,::boost::fusion::vector<boost::msm::TerminateFlag> >();
1288}
1289
1290template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class BASE,class EndInterruptEvent>
1291inline
1292func_state<
1293StateNameTag,
1294typename ::boost::mpl::eval_if<
1295 typename proto::matches<Expr1,ActionGrammar>::type,
1296 boost::result_of<ActionGrammar(Expr1)>,
1297 make_invalid_type>::type,
1298typename ::boost::mpl::eval_if<
1299 typename proto::matches<Expr2,ActionGrammar>::type,
1300 boost::result_of<ActionGrammar(Expr2)>,
1301 make_invalid_type>::type,
1302typename boost::result_of<BuildAttributes(Attr)>::type,
1303typename ::boost::mpl::push_back<
1304 typename ::boost::mpl::push_back< typename boost::result_of<BuildFlags(Configure)>::type,
1305 ::boost::msm::InterruptedFlag>::type,
1306 boost::msm::EndInterruptFlag<EndInterruptEvent>
1307 >::type,
1308typename boost::result_of<BuildDeferred(Configure)>::type,
1309BASE
1310>
1311build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
1312{
1313 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1314 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1315 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1316 typedef typename ::boost::mpl::push_back<
1317 typename ::boost::mpl::push_back<
1318 typename boost::result_of<BuildFlags(Configure)>::type,
1319 ::boost::msm::InterruptedFlag>::type,
1320 boost::msm::EndInterruptFlag<EndInterruptEvent>
1321 >::type flags_type;
1322 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1323 return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type,BASE>();
1324}
1325
1326template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class EndInterruptEvent>
1327inline
1328func_state<
1329StateNameTag,
1330typename ::boost::mpl::eval_if<
1331 typename proto::matches<Expr1,ActionGrammar>::type,
1332 boost::result_of<ActionGrammar(Expr1)>,
1333 make_invalid_type>::type,
1334typename ::boost::mpl::eval_if<
1335 typename proto::matches<Expr2,ActionGrammar>::type,
1336 boost::result_of<ActionGrammar(Expr2)>,
1337 make_invalid_type>::type,
1338typename boost::result_of<BuildAttributes(Attr)>::type,
1339typename ::boost::mpl::push_back<
1340 typename ::boost::mpl::push_back< typename boost::result_of<BuildFlags(Configure)>::type,
1341 ::boost::msm::InterruptedFlag>::type,
1342 boost::msm::EndInterruptFlag<EndInterruptEvent>
1343 >::type,
1344typename boost::result_of<BuildDeferred(Configure)>::type
1345>
1346build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
1347{
1348 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1349 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1350 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1351
1352 typedef typename ::boost::mpl::push_back<
1353 typename ::boost::mpl::push_back<
1354 typename boost::result_of<BuildFlags(Configure)>::type,
1355 ::boost::msm::InterruptedFlag>::type,
1356 boost::msm::EndInterruptFlag<EndInterruptEvent>
1357 >::type flags_type;
1358 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1359
1360 return func_state<StateNameTag,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
1361}
1362
1363template <class StateNameTag,class Expr1,class Expr2,class Attr,class EndInterruptEvent>
1364inline
1365func_state<
1366StateNameTag,
1367typename ::boost::mpl::eval_if<
1368 typename proto::matches<Expr1,ActionGrammar>::type,
1369 boost::result_of<ActionGrammar(Expr1)>,
1370 make_invalid_type>::type,
1371typename ::boost::mpl::eval_if<
1372 typename proto::matches<Expr2,ActionGrammar>::type,
1373 boost::result_of<ActionGrammar(Expr2)>,
1374 make_invalid_type>::type,
1375typename boost::result_of<BuildAttributes(Attr)>::type,
1376::boost::fusion::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1377>
1378build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& ,Attr const&)
1379{
1380 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1381 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1382 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1383 return func_state<StateNameTag,entry_action,exit_action,attributes_type,
1384 ::boost::fusion::vector< boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1385}
1386
1387template <class StateNameTag,class Expr1,class Expr2,class EndInterruptEvent>
1388inline
1389func_state<
1390StateNameTag,
1391typename ::boost::mpl::eval_if<
1392 typename proto::matches<Expr1,ActionGrammar>::type,
1393 boost::result_of<ActionGrammar(Expr1)>,
1394 make_invalid_type>::type,
1395typename ::boost::mpl::eval_if<
1396 typename proto::matches<Expr2,ActionGrammar>::type,
1397 boost::result_of<ActionGrammar(Expr2)>,
1398 make_invalid_type>::type,
1399::boost::fusion::vector<>,
1400::boost::fusion::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1401>
1402build_interrupt_state(EndInterruptEvent const&,Expr1 const& ,Expr2 const& )
1403{
1404 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1405 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1406 return func_state<StateNameTag,entry_action,exit_action,
1407 ::boost::fusion::vector<>,
1408 ::boost::fusion::vector< boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1409}
1410
1411template <class StateNameTag,class Expr1,class EndInterruptEvent>
1412inline
1413func_state<
1414StateNameTag,
1415typename ::boost::mpl::eval_if<
1416 typename proto::matches<Expr1,ActionGrammar>::type,
1417 boost::result_of<ActionGrammar(Expr1)>,
1418 make_invalid_type>::type,
1419NoAction,
1420::boost::fusion::vector<>,
1421::boost::fusion::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1422>
1423build_interrupt_state(EndInterruptEvent const&, Expr1 const&)
1424{
1425 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1426 return func_state<StateNameTag,entry_action,NoAction, ::boost::fusion::vector<>,
1427 ::boost::fusion::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1428}
1429
1430template <class StateNameTag,class EndInterruptEvent>
1431inline
1432func_state<
1433StateNameTag,
1434NoAction,
1435NoAction,
1436::boost::fusion::vector<>,
1437::boost::fusion::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1438>
1439build_interrupt_state(EndInterruptEvent const&)
1440{
1441 return func_state<StateNameTag,NoAction,NoAction, ::boost::fusion::vector<>,
1442 ::boost::fusion::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1443}
1444
1445template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1446inline
1447entry_func_state<
1448StateNameTag,
1449ZoneIndex,
1450typename ::boost::mpl::eval_if<
1451 typename proto::matches<Expr1,ActionGrammar>::type,
1452 boost::result_of<ActionGrammar(Expr1)>,
1453 make_invalid_type>::type,
1454typename ::boost::mpl::eval_if<
1455 typename proto::matches<Expr2,ActionGrammar>::type,
1456 boost::result_of<ActionGrammar(Expr2)>,
1457 make_invalid_type>::type,
1458typename boost::result_of<BuildAttributes(Attr)>::type,
1459typename boost::result_of<BuildFlags(Configure)>::type,
1460typename boost::result_of<BuildDeferred(Configure)>::type,
1461BASE
1462>
1463build_entry_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
1464{
1465 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1466 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1467 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1468 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1469 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1470 return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type,flags_type,deferred_type,BASE>();
1471}
1472
1473template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure>
1474inline
1475entry_func_state<
1476StateNameTag,
1477ZoneIndex,
1478typename ::boost::mpl::eval_if<
1479 typename proto::matches<Expr1,ActionGrammar>::type,
1480 boost::result_of<ActionGrammar(Expr1)>,
1481 make_invalid_type>::type,
1482typename ::boost::mpl::eval_if<
1483 typename proto::matches<Expr2,ActionGrammar>::type,
1484 boost::result_of<ActionGrammar(Expr2)>,
1485 make_invalid_type>::type,
1486typename boost::result_of<BuildAttributes(Attr)>::type,
1487typename boost::result_of<BuildFlags(Configure)>::type,
1488typename boost::result_of<BuildDeferred(Configure)>::type
1489>
1490build_entry_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
1491{
1492 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1493 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1494 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1495 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1496 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1497 return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
1498}
1499
1500template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr>
1501inline
1502entry_func_state<
1503StateNameTag,
1504ZoneIndex,
1505typename ::boost::mpl::eval_if<
1506 typename proto::matches<Expr1,ActionGrammar>::type,
1507 boost::result_of<ActionGrammar(Expr1)>,
1508 make_invalid_type>::type,
1509typename ::boost::mpl::eval_if<
1510 typename proto::matches<Expr2,ActionGrammar>::type,
1511 boost::result_of<ActionGrammar(Expr2)>,
1512 make_invalid_type>::type,
1513typename boost::result_of<BuildAttributes(Attr)>::type
1514>
1515build_entry_state(Expr1 const& ,Expr2 const& ,Attr const&)
1516{
1517 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1518 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1519 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1520 return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type>();
1521}
1522
1523template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2>
1524inline
1525entry_func_state<
1526StateNameTag,
1527ZoneIndex,
1528typename ::boost::mpl::eval_if<
1529 typename proto::matches<Expr1,ActionGrammar>::type,
1530 boost::result_of<ActionGrammar(Expr1)>,
1531 make_invalid_type>::type,
1532typename ::boost::mpl::eval_if<
1533 typename proto::matches<Expr2,ActionGrammar>::type,
1534 boost::result_of<ActionGrammar(Expr2)>,
1535 make_invalid_type>::type
1536>
1537build_entry_state(Expr1 const& ,Expr2 const& )
1538{
1539 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1540 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1541 return entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action>();
1542}
1543
1544template <class StateNameTag,int ZoneIndex,class Expr1>
1545inline
1546entry_func_state<
1547StateNameTag,
1548ZoneIndex,
1549typename ::boost::mpl::eval_if<
1550 typename proto::matches<Expr1,ActionGrammar>::type,
1551 boost::result_of<ActionGrammar(Expr1)>,
1552 make_invalid_type>::type,
1553NoAction
1554>
1555build_entry_state(Expr1 const& )
1556{
1557 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1558 return entry_func_state<StateNameTag,ZoneIndex,entry_action,NoAction>();
1559}
1560
1561template <class StateNameTag,int ZoneIndex>
1562inline
1563entry_func_state<
1564StateNameTag,
1565ZoneIndex,
1566NoAction,
1567NoAction
1568>
1569build_entry_state()
1570{
1571 return entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
1572}
1573
1574template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1575inline
1576exit_func_state<
1577StateNameTag,
1578Event,
1579typename ::boost::mpl::eval_if<
1580 typename proto::matches<Expr1,ActionGrammar>::type,
1581 boost::result_of<ActionGrammar(Expr1)>,
1582 make_invalid_type>::type,
1583typename ::boost::mpl::eval_if<
1584 typename proto::matches<Expr2,ActionGrammar>::type,
1585 boost::result_of<ActionGrammar(Expr2)>,
1586 make_invalid_type>::type,
1587typename boost::result_of<BuildAttributes(Attr)>::type,
1588typename boost::result_of<BuildFlags(Configure)>::type,
1589typename boost::result_of<BuildDeferred(Configure)>::type,
1590BASE
1591>
1592build_exit_state(Event const&,Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
1593{
1594 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1595 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1596 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1597 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1598 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1599 return exit_func_state<StateNameTag,Event,entry_action,exit_action,attributes_type,flags_type,deferred_type,BASE>();
1600}
1601
1602template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr,class Configure>
1603inline
1604exit_func_state<
1605StateNameTag,
1606Event,
1607typename ::boost::mpl::eval_if<
1608 typename proto::matches<Expr1,ActionGrammar>::type,
1609 boost::result_of<ActionGrammar(Expr1)>,
1610 make_invalid_type>::type,
1611typename ::boost::mpl::eval_if<
1612 typename proto::matches<Expr2,ActionGrammar>::type,
1613 boost::result_of<ActionGrammar(Expr2)>,
1614 make_invalid_type>::type,
1615typename boost::result_of<BuildAttributes(Attr)>::type,
1616typename boost::result_of<BuildFlags(Configure)>::type,
1617typename boost::result_of<BuildDeferred(Configure)>::type
1618>
1619build_exit_state(Event const&,Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
1620{
1621 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1622 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1623 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1624 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1625 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1626 return exit_func_state<StateNameTag,Event,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
1627}
1628
1629template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr>
1630inline
1631exit_func_state<
1632StateNameTag,
1633Event,
1634typename ::boost::mpl::eval_if<
1635 typename proto::matches<Expr1,ActionGrammar>::type,
1636 boost::result_of<ActionGrammar(Expr1)>,
1637 make_invalid_type>::type,
1638typename ::boost::mpl::eval_if<
1639 typename proto::matches<Expr2,ActionGrammar>::type,
1640 boost::result_of<ActionGrammar(Expr2)>,
1641 make_invalid_type>::type,
1642typename boost::result_of<BuildAttributes(Attr)>::type
1643>
1644build_exit_state(Event const&,Expr1 const& ,Expr2 const& ,Attr const&)
1645{
1646 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1647 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1648 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1649 return exit_func_state<StateNameTag,Event,entry_action,exit_action,attributes_type>();
1650}
1651
1652template <class StateNameTag,class Event,class Expr1,class Expr2>
1653inline
1654exit_func_state<
1655StateNameTag,
1656Event,
1657typename ::boost::mpl::eval_if<
1658 typename proto::matches<Expr1,ActionGrammar>::type,
1659 boost::result_of<ActionGrammar(Expr1)>,
1660 make_invalid_type>::type,
1661typename ::boost::mpl::eval_if<
1662 typename proto::matches<Expr2,ActionGrammar>::type,
1663 boost::result_of<ActionGrammar(Expr2)>,
1664 make_invalid_type>::type
1665>
1666build_exit_state(Event const&,Expr1 const& ,Expr2 const& )
1667{
1668 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1669 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1670 return exit_func_state<StateNameTag,Event,entry_action,exit_action>();
1671}
1672
1673template <class StateNameTag,class Event,class Expr1>
1674inline
1675exit_func_state<
1676StateNameTag,
1677Event,
1678typename ::boost::mpl::eval_if<
1679 typename proto::matches<Expr1,ActionGrammar>::type,
1680 boost::result_of<ActionGrammar(Expr1)>,
1681 make_invalid_type>::type,
1682NoAction
1683>
1684build_exit_state(Event const&, Expr1 const& )
1685{
1686 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1687 return exit_func_state<StateNameTag,Event,entry_action,NoAction>();
1688}
1689
1690template <class StateNameTag,class Event>
1691inline
1692exit_func_state<
1693StateNameTag,
1694Event,
1695NoAction,
1696NoAction
1697>
1698build_exit_state(Event const&)
1699{
1700 return exit_func_state<StateNameTag,Event,NoAction,NoAction>();
1701}
1702
1703template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1704inline
1705explicit_entry_func_state<
1706StateNameTag,
1707ZoneIndex,
1708typename ::boost::mpl::eval_if<
1709 typename proto::matches<Expr1,ActionGrammar>::type,
1710 boost::result_of<ActionGrammar(Expr1)>,
1711 make_invalid_type>::type,
1712typename ::boost::mpl::eval_if<
1713 typename proto::matches<Expr2,ActionGrammar>::type,
1714 boost::result_of<ActionGrammar(Expr2)>,
1715 make_invalid_type>::type,
1716typename boost::result_of<BuildAttributes(Attr)>::type,
1717typename boost::result_of<BuildFlags(Configure)>::type,
1718typename boost::result_of<BuildDeferred(Configure)>::type,
1719BASE
1720>
1721build_explicit_entry_state(Expr1 const& ,Expr2 const& , Attr const&, Configure const&, BASE )
1722{
1723 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1724 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1725 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1726 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1727 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1728 return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type,flags_type,deferred_type,BASE>();
1729}
1730
1731template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure>
1732inline
1733explicit_entry_func_state<
1734StateNameTag,
1735ZoneIndex,
1736typename ::boost::mpl::eval_if<
1737 typename proto::matches<Expr1,ActionGrammar>::type,
1738 boost::result_of<ActionGrammar(Expr1)>,
1739 make_invalid_type>::type,
1740typename ::boost::mpl::eval_if<
1741 typename proto::matches<Expr2,ActionGrammar>::type,
1742 boost::result_of<ActionGrammar(Expr2)>,
1743 make_invalid_type>::type,
1744typename boost::result_of<BuildAttributes(Attr)>::type,
1745typename boost::result_of<BuildFlags(Configure)>::type,
1746typename boost::result_of<BuildDeferred(Configure)>::type
1747>
1748build_explicit_entry_state(Expr1 const& ,Expr2 const& ,Attr const&, Configure const&)
1749{
1750 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1751 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1752 typedef typename boost::result_of<BuildFlags(Configure)>::type flags_type;
1753 typedef typename boost::result_of<BuildDeferred(Configure)>::type deferred_type;
1754 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1755 return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type,flags_type,deferred_type>();
1756}
1757
1758template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr>
1759inline
1760explicit_entry_func_state<
1761StateNameTag,
1762ZoneIndex,
1763typename ::boost::mpl::eval_if<
1764 typename proto::matches<Expr1,ActionGrammar>::type,
1765 boost::result_of<ActionGrammar(Expr1)>,
1766 make_invalid_type>::type,
1767typename ::boost::mpl::eval_if<
1768 typename proto::matches<Expr2,ActionGrammar>::type,
1769 boost::result_of<ActionGrammar(Expr2)>,
1770 make_invalid_type>::type,
1771typename boost::result_of<BuildAttributes(Attr)>::type
1772>
1773build_explicit_entry_state(Expr1 const& ,Expr2 const& ,Attr const&)
1774{
1775 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1776 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1777 typedef typename boost::result_of<BuildAttributes(Attr)>::type attributes_type;
1778 return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action,attributes_type>();
1779}
1780
1781template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2>
1782inline
1783explicit_entry_func_state<
1784StateNameTag,
1785ZoneIndex,
1786typename ::boost::mpl::eval_if<
1787 typename proto::matches<Expr1,ActionGrammar>::type,
1788 boost::result_of<ActionGrammar(Expr1)>,
1789 make_invalid_type>::type,
1790typename ::boost::mpl::eval_if<
1791 typename proto::matches<Expr2,ActionGrammar>::type,
1792 boost::result_of<ActionGrammar(Expr2)>,
1793 make_invalid_type>::type
1794>
1795build_explicit_entry_state(Expr1 const& ,Expr2 const& )
1796{
1797 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1798 typedef typename boost::result_of<ActionGrammar(Expr2)>::type exit_action;
1799 return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,exit_action>();
1800}
1801
1802template <class StateNameTag,int ZoneIndex,class Expr1>
1803inline
1804explicit_entry_func_state<
1805StateNameTag,
1806ZoneIndex,
1807typename ::boost::mpl::eval_if<
1808 typename proto::matches<Expr1,ActionGrammar>::type,
1809 boost::result_of<ActionGrammar(Expr1)>,
1810 make_invalid_type>::type,
1811NoAction
1812>
1813build_explicit_entry_state(Expr1 const& )
1814{
1815 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
1816 return explicit_entry_func_state<StateNameTag,ZoneIndex,entry_action,NoAction>();
1817}
1818
1819template <class StateNameTag,int ZoneIndex>
1820inline
1821explicit_entry_func_state<
1822StateNameTag,
1823ZoneIndex,
1824NoAction,
1825NoAction
1826>
1827build_explicit_entry_state()
1828{
1829 return explicit_entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
1830}
1831
1832
1833
1834}}}}
1835
1836#endif //BOOST_MSM_FRONT_EUML_STATE_GRAMMAR_H
1837
1838

source code of boost/libs/msm/include/boost/msm/front/euml/state_grammar.hpp