]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/msm/front/euml/state_grammar.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / msm / front / euml / state_grammar.hpp
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
33 BOOST_MPL_HAS_XXX_TRAIT_DEF(attribute_tag)
34 BOOST_MPL_HAS_XXX_TRAIT_DEF(flag_create_tag)
35 BOOST_MPL_HAS_XXX_TRAIT_DEF(defer_create_tag)
36 BOOST_MPL_HAS_XXX_TRAIT_DEF(control_configure_tag)
37
38 namespace proto = boost::proto;
39
40 namespace boost { namespace msm { namespace front { namespace euml
41 {
42
43 // provides the typedefs and interface. Concrete states derive from it.
44 template<class StateNameTag,
45 class EntryFunctor=NoAction,
46 class ExitFunctor=NoAction,
47 class Attributes= ::boost::fusion::vector<>,
48 class Flags = ::boost::mpl::vector0<>,
49 class Defer = ::boost::mpl::vector0<>,
50 class BASE = ::boost::msm::front::default_base_state>
51 struct 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::mpl::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.
79 template<class StateNameTag,
80 int ZoneIndex=-1,
81 class EntryFunctor=NoAction,
82 class ExitFunctor=NoAction,
83 class Attributes= ::boost::fusion::vector<>,
84 class Flags = ::boost::mpl::vector0<>,
85 class Defer = ::boost::mpl::vector0<>,
86 class BASE = default_base_state>
87 struct 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::mpl::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.
119 template<class StateNameTag,
120 int ZoneIndex=-1,
121 class EntryFunctor=NoAction,
122 class ExitFunctor=NoAction,
123 class Attributes= ::boost::fusion::vector<>,
124 class Flags = ::boost::mpl::vector0<>,
125 class Defer = ::boost::mpl::vector0<>,
126 class BASE = default_base_state>
127 struct 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::mpl::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.
157 template<class StateNameTag,
158 class Event,
159 class EntryFunctor=NoAction,
160 class ExitFunctor=NoAction,
161 class Attributes= ::boost::fusion::vector<>,
162 class Flags = ::boost::mpl::vector0<>,
163 class Defer = ::boost::mpl::vector0<>,
164 class BASE = default_base_state>
165 struct 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::mpl::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
197 struct BuildActions;
198 struct BuildGuards;
199
200 struct 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
222 struct 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
236 struct 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
251 struct 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
266 struct BuildActionsCases
267 {
268 // The primary template matches nothing:
269 template<typename Tag>
270 struct case_
271 : proto::not_<proto::_>
272 {};
273 };
274
275 template<>
276 struct BuildActionsCases::case_<proto::tag::pre_inc>
277 : proto::when<
278 proto::pre_inc<BuildActions >,
279 Pre_inc_< BuildActions(proto::_child)>()
280 >
281 {};
282 template<>
283 struct BuildActionsCases::case_<proto::tag::pre_dec>
284 : proto::when<
285 proto::pre_dec<BuildActions >,
286 Pre_dec_< BuildActions(proto::_child)>()
287 >
288 {};
289 template<>
290 struct BuildActionsCases::case_<proto::tag::post_inc>
291 : proto::when<
292 proto::post_inc<BuildActions >,
293 Post_inc_< BuildActions(proto::_child)>()
294 >
295 {};
296 template<>
297 struct BuildActionsCases::case_<proto::tag::post_dec>
298 : proto::when<
299 proto::post_dec<BuildActions >,
300 Post_dec_< BuildActions(proto::_child)>()
301 >
302 {};
303 template<>
304 struct BuildActionsCases::case_<proto::tag::dereference>
305 : proto::when<
306 proto::dereference<BuildActions >,
307 Deref_< BuildActions(proto::_child)>()
308 >
309 {};
310 template<>
311 struct BuildActionsCases::case_<proto::tag::plus>
312 : proto::when<
313 proto::plus<BuildActions,BuildActions >,
314 Plus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
315 >
316 {};
317 template<>
318 struct BuildActionsCases::case_<proto::tag::minus>
319 : proto::when<
320 proto::minus<BuildActions,BuildActions >,
321 Minus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
322 >
323 {};
324 template<>
325 struct BuildActionsCases::case_<proto::tag::multiplies>
326 : proto::when<
327 proto::multiplies<BuildActions,BuildActions >,
328 Multiplies_<BuildActions(proto::_left),BuildActions(proto::_right)>()
329 >
330 {};
331 template<>
332 struct BuildActionsCases::case_<proto::tag::divides>
333 : proto::when<
334 proto::divides<BuildActions,BuildActions >,
335 Divides_<BuildActions(proto::_left),BuildActions(proto::_right)>()
336 >
337 {};
338 template<>
339 struct BuildActionsCases::case_<proto::tag::modulus>
340 : proto::when<
341 proto::modulus<BuildActions,BuildActions >,
342 Modulus_<BuildActions(proto::_left),BuildActions(proto::_right)>()
343 >
344 {};
345 template<>
346 struct 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 {};
352 template<>
353 struct 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 {};
359 template<>
360 struct 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
367 template<>
368 struct 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 {};
374 template<>
375 struct 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 {};
381 template<>
382 struct 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 {};
388 template<>
389 struct 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 {};
395 template<>
396 struct 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 {};
402 template<>
403 struct 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 {};
409 template<>
410 struct 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 {};
416 template<>
417 struct 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 {};
423 template<>
424 struct 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 {};
430 template<>
431 struct BuildActionsCases::case_<proto::tag::assign>
432 : proto::when<
433 proto::assign<BuildActions,BuildActions >,
434 Assign_< BuildActions(proto::_left),BuildActions(proto::_right)>()
435 >
436 {};
437 template<>
438 struct BuildActionsCases::case_<proto::tag::subscript>
439 : proto::when<
440 proto::subscript<BuildActions,BuildActions >,
441 Subscript_< BuildActions(proto::_left),BuildActions(proto::_right)>()
442 >
443 {};
444 template<>
445 struct BuildActionsCases::case_<proto::tag::unary_plus>
446 : proto::when<
447 proto::unary_plus<BuildActions >,
448 Unary_Plus_< BuildActions(proto::_child)>()
449 >
450 {};
451 template<>
452 struct BuildActionsCases::case_<proto::tag::negate>
453 : proto::when<
454 proto::negate<BuildActions >,
455 Unary_Minus_< BuildActions(proto::_child)>()
456 >
457 {};
458
459 template<>
460 struct 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
535 template<>
536 struct 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 {};
564 struct BuildActions
565 : proto::switch_<BuildActionsCases>
566 {};
567
568 // attributes building
569 #define BOOST_MSM_EUML_DECLARE_ATTRIBUTE(attr_type,attr_name) \
570 struct 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 }; \
576 attr_name ## _ const attr_name = attr_name ## _();
577
578 struct make_attributes_tag
579 {
580 typedef int attribute_tag;
581 };
582
583 template <class T>
584 struct get_attribute_type
585 {
586 typedef typename T::attribute_type type;
587 };
588 template <class Seq>
589 struct transform_to_fusion_pair
590 {
591 typedef typename ::boost::mpl::fold<
592 Seq,::boost::mpl::vector<>,
593 ::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
594 get_attribute_type< ::boost::mpl::placeholders::_2> >
595 >::type type;
596 };
597
598 template<class X = proto::is_proto_expr>
599 struct 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
609 attribute<> const attributes_ = {{{}}};
610 attribute<> const no_attributes_ = {{{}}};
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
628 struct 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 mpl::vector from a << list
638 struct BuildMplVectorHelper
639 : proto::make<
640 ::boost::mpl::pop_front<
641 proto::fold_tree<
642 proto::_
643 , ::boost::mpl::vector0<>()
644 , ::boost::mpl::push_back<proto::_state, proto::_>()
645 >
646 >
647 >
648 {};
649
650 // flags building
651 struct 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
660 struct control_configure_tag {};
661
662 // configuration building
663 struct make_configure_tag
664 {
665 typedef int control_configure_tag;
666 };
667
668 template<class X = proto::is_proto_expr>
669 struct 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_ = {{{}}};
680 configure<> const no_configure_ = {{{}}};
681
682 struct 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
691 struct 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
700 template<class X = proto::is_proto_expr>
701 struct 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
711 define_init<> const init_ = {{{}}};
712 struct BuildInit
713 : proto::make<
714 ::boost::mpl::pop_front<
715 proto::fold_tree<
716 proto::_
717 , ::boost::mpl::vector0<>()
718 , ::boost::mpl::push_back<proto::_state, proto::_>()
719 >
720 >
721 >
722 {};
723
724 template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class BASE>
725 inline
726 func_state<
727 StateNameTag,
728 typename ::boost::mpl::eval_if<
729 typename proto::matches<Expr1,ActionGrammar>::type,
730 boost::result_of<ActionGrammar(Expr1)>,
731 make_invalid_type>::type,
732 typename ::boost::mpl::eval_if<
733 typename proto::matches<Expr2,ActionGrammar>::type,
734 boost::result_of<ActionGrammar(Expr2)>,
735 make_invalid_type>::type,
736 typename boost::result_of<BuildAttributes(Attr)>::type,
737 typename boost::result_of<BuildFlags(Configure)>::type,
738 typename boost::result_of<BuildDeferred(Configure)>::type,
739 BASE
740 >
741 build_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
751 template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure>
752 inline
753 func_state<
754 StateNameTag,
755 typename ::boost::mpl::eval_if<
756 typename proto::matches<Expr1,ActionGrammar>::type,
757 boost::result_of<ActionGrammar(Expr1)>,
758 make_invalid_type>::type,
759 typename ::boost::mpl::eval_if<
760 typename proto::matches<Expr2,ActionGrammar>::type,
761 boost::result_of<ActionGrammar(Expr2)>,
762 make_invalid_type>::type,
763 typename boost::result_of<BuildAttributes(Attr)>::type,
764 typename boost::result_of<BuildFlags(Configure)>::type,
765 typename boost::result_of<BuildDeferred(Configure)>::type
766 >
767 build_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
777 template <class StateNameTag,class Expr1,class Expr2,class Attr>
778 inline
779 func_state<
780 StateNameTag,
781 typename ::boost::mpl::eval_if<
782 typename proto::matches<Expr1,ActionGrammar>::type,
783 boost::result_of<ActionGrammar(Expr1)>,
784 make_invalid_type>::type,
785 typename ::boost::mpl::eval_if<
786 typename proto::matches<Expr2,ActionGrammar>::type,
787 boost::result_of<ActionGrammar(Expr2)>,
788 make_invalid_type>::type,
789 typename boost::result_of<BuildAttributes(Attr)>::type
790 >
791 build_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
799 template <class StateNameTag,class Expr1,class Expr2>
800 inline
801 func_state<
802 StateNameTag,
803 typename ::boost::mpl::eval_if<
804 typename proto::matches<Expr1,ActionGrammar>::type,
805 boost::result_of<ActionGrammar(Expr1)>,
806 make_invalid_type>::type,
807 typename ::boost::mpl::eval_if<
808 typename proto::matches<Expr2,ActionGrammar>::type,
809 boost::result_of<ActionGrammar(Expr2)>,
810 make_invalid_type>::type
811 >
812 build_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
819 template <class StateNameTag,class Expr1>
820 inline
821 func_state<
822 StateNameTag,
823 typename ::boost::mpl::eval_if<
824 typename proto::matches<Expr1,ActionGrammar>::type,
825 boost::result_of<ActionGrammar(Expr1)>,
826 make_invalid_type>::type,
827 NoAction
828 >
829 build_state(Expr1 const& )
830 {
831 typedef typename boost::result_of<ActionGrammar(Expr1)>::type entry_action;
832 return func_state<StateNameTag,entry_action,NoAction>();
833 }
834 template<class StateNameTag>
835 inline
836 func_state<
837 StateNameTag,
838 NoAction,
839 NoAction
840 >
841 build_state()
842 {
843 return func_state<StateNameTag,NoAction,NoAction>();
844 }
845
846 // provides the typedefs and interface. Concrete states derive from it.
847 template<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::mpl::vector0<>,
854 class Defer = ::boost::mpl::vector0<>,
855 class Configuration = ::boost::mpl::vector0<>,
856 class NoTransitionFunctor = NoAction,
857 class OnExceptionFunctor = NoAction,
858 class BASE = ::boost::msm::front::default_base_state>
859 struct 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::mpl::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 }
896 protected:
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
911 template <class StateNameTag,class STT,class Init>
912 inline
913 func_state_machine<
914 StateNameTag,
915 STT,
916 typename boost::result_of<BuildInit(Init)>::type
917 >
918 build_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
924 template <class StateNameTag,class STT,class Init,class Expr1>
925 inline
926 func_state_machine<
927 StateNameTag,
928 STT,
929 typename boost::result_of<BuildInit(Init)>::type,
930 typename ::boost::mpl::eval_if<
931 typename proto::matches<Expr1,ActionGrammar>::type,
932 boost::result_of<ActionGrammar(Expr1)>,
933 make_invalid_type>::type
934 >
935 build_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
942 template <class StateNameTag,class STT,class Init,class Expr1,class Expr2>
943 inline
944 func_state_machine<
945 StateNameTag,
946 STT,
947 typename boost::result_of<BuildInit(Init)>::type,
948 typename ::boost::mpl::eval_if<
949 typename proto::matches<Expr1,ActionGrammar>::type,
950 boost::result_of<ActionGrammar(Expr1)>,
951 make_invalid_type>::type,
952 typename ::boost::mpl::eval_if<
953 typename proto::matches<Expr2,ActionGrammar>::type,
954 boost::result_of<ActionGrammar(Expr2)>,
955 make_invalid_type>::type
956 >
957 build_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
965 template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr>
966 inline
967 func_state_machine<
968 StateNameTag,
969 STT,
970 typename boost::result_of<BuildInit(Init)>::type,
971 typename ::boost::mpl::eval_if<
972 typename proto::matches<Expr1,ActionGrammar>::type,
973 boost::result_of<ActionGrammar(Expr1)>,
974 make_invalid_type>::type,
975 typename ::boost::mpl::eval_if<
976 typename proto::matches<Expr2,ActionGrammar>::type,
977 boost::result_of<ActionGrammar(Expr2)>,
978 make_invalid_type>::type,
979 typename boost::result_of<BuildAttributes(Attr)>::type
980 >
981 build_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
990 template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure>
991 inline
992 func_state_machine<
993 StateNameTag,
994 STT,
995 typename boost::result_of<BuildInit(Init)>::type,
996 typename ::boost::mpl::eval_if<
997 typename proto::matches<Expr1,ActionGrammar>::type,
998 boost::result_of<ActionGrammar(Expr1)>,
999 make_invalid_type>::type,
1000 typename ::boost::mpl::eval_if<
1001 typename proto::matches<Expr2,ActionGrammar>::type,
1002 boost::result_of<ActionGrammar(Expr2)>,
1003 make_invalid_type>::type,
1004 typename boost::result_of<BuildAttributes(Attr)>::type,
1005 typename boost::result_of<BuildFlags(Configure)>::type,
1006 typename boost::result_of<BuildDeferred(Configure)>::type,
1007 typename boost::result_of<BuildConfigure(Configure)>::type
1008 >
1009 build_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
1023 template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure,class Expr3>
1024 inline
1025 func_state_machine<
1026 StateNameTag,
1027 STT,
1028 typename boost::result_of<BuildInit(Init)>::type,
1029 typename ::boost::mpl::eval_if<
1030 typename proto::matches<Expr1,ActionGrammar>::type,
1031 boost::result_of<ActionGrammar(Expr1)>,
1032 make_invalid_type>::type,
1033 typename ::boost::mpl::eval_if<
1034 typename proto::matches<Expr2,ActionGrammar>::type,
1035 boost::result_of<ActionGrammar(Expr2)>,
1036 make_invalid_type>::type,
1037 typename boost::result_of<BuildAttributes(Attr)>::type,
1038 typename boost::result_of<BuildFlags(Configure)>::type,
1039 typename boost::result_of<BuildDeferred(Configure)>::type,
1040 typename boost::result_of<BuildConfigure(Configure)>::type,
1041 typename ::boost::mpl::eval_if<
1042 typename proto::matches<Expr3,ActionGrammar>::type,
1043 boost::result_of<ActionGrammar(Expr3)>,
1044 make_invalid_type>::type
1045 >
1046 build_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
1060 template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure,class Expr3,class Expr4>
1061 inline
1062 func_state_machine<
1063 StateNameTag,
1064 STT,
1065 typename boost::result_of<BuildInit(Init)>::type,
1066 typename ::boost::mpl::eval_if<
1067 typename proto::matches<Expr1,ActionGrammar>::type,
1068 boost::result_of<ActionGrammar(Expr1)>,
1069 make_invalid_type>::type,
1070 typename ::boost::mpl::eval_if<
1071 typename proto::matches<Expr2,ActionGrammar>::type,
1072 boost::result_of<ActionGrammar(Expr2)>,
1073 make_invalid_type>::type,
1074 typename boost::result_of<BuildAttributes(Attr)>::type,
1075 typename boost::result_of<BuildFlags(Configure)>::type,
1076 typename boost::result_of<BuildDeferred(Configure)>::type,
1077 typename boost::result_of<BuildConfigure(Configure)>::type,
1078 typename ::boost::mpl::eval_if<
1079 typename proto::matches<Expr3,ActionGrammar>::type,
1080 boost::result_of<ActionGrammar(Expr3)>,
1081 make_invalid_type>::type,
1082 typename ::boost::mpl::eval_if<
1083 typename proto::matches<Expr4,ActionGrammar>::type,
1084 boost::result_of<ActionGrammar(Expr4)>,
1085 make_invalid_type>::type
1086 >
1087 build_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
1102 template <class StateNameTag,class STT,class Init,class Expr1,class Expr2,class Attr,class Configure,class Expr3,class Expr4,class BASE>
1103 inline
1104 func_state_machine<
1105 StateNameTag,
1106 STT,
1107 typename boost::result_of<BuildInit(Init)>::type,
1108 typename ::boost::mpl::eval_if<
1109 typename proto::matches<Expr1,ActionGrammar>::type,
1110 boost::result_of<ActionGrammar(Expr1)>,
1111 make_invalid_type>::type,
1112 typename ::boost::mpl::eval_if<
1113 typename proto::matches<Expr2,ActionGrammar>::type,
1114 boost::result_of<ActionGrammar(Expr2)>,
1115 make_invalid_type>::type,
1116 typename boost::result_of<BuildAttributes(Attr)>::type,
1117 typename boost::result_of<BuildFlags(Configure)>::type,
1118 typename boost::result_of<BuildDeferred(Configure)>::type,
1119 typename boost::result_of<BuildConfigure(Configure)>::type,
1120 typename ::boost::mpl::eval_if<
1121 typename proto::matches<Expr3,ActionGrammar>::type,
1122 boost::result_of<ActionGrammar(Expr3)>,
1123 make_invalid_type>::type,
1124 typename ::boost::mpl::eval_if<
1125 typename proto::matches<Expr4,ActionGrammar>::type,
1126 boost::result_of<ActionGrammar(Expr4)>,
1127 make_invalid_type>::type,
1128 BASE
1129 >
1130 build_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
1145 template <class Expr>
1146 inline
1147 ::boost::msm::front::detail::inherit_attributes<typename boost::result_of<BuildAttributes(Expr)>::type>
1148 build_attributes (Expr const&)
1149 {
1150 return ::boost::msm::front::detail::inherit_attributes<typename boost::result_of<BuildAttributes(Expr)>::type> ();
1151 }
1152
1153 template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1154 inline
1155 func_state<
1156 StateNameTag,
1157 typename ::boost::mpl::eval_if<
1158 typename proto::matches<Expr1,ActionGrammar>::type,
1159 boost::result_of<ActionGrammar(Expr1)>,
1160 make_invalid_type>::type,
1161 typename ::boost::mpl::eval_if<
1162 typename proto::matches<Expr2,ActionGrammar>::type,
1163 boost::result_of<ActionGrammar(Expr2)>,
1164 make_invalid_type>::type,
1165 typename boost::result_of<BuildAttributes(Attr)>::type,
1166 typename ::boost::mpl::push_back< typename boost::result_of<BuildFlags(Configure)>::type,
1167 ::boost::msm::TerminateFlag>::type,
1168 typename boost::result_of<BuildDeferred(Configure)>::type,
1169 BASE
1170 >
1171 build_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
1183 template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure>
1184 inline
1185 func_state<
1186 StateNameTag,
1187 typename ::boost::mpl::eval_if<
1188 typename proto::matches<Expr1,ActionGrammar>::type,
1189 boost::result_of<ActionGrammar(Expr1)>,
1190 make_invalid_type>::type,
1191 typename ::boost::mpl::eval_if<
1192 typename proto::matches<Expr2,ActionGrammar>::type,
1193 boost::result_of<ActionGrammar(Expr2)>,
1194 make_invalid_type>::type,
1195 typename boost::result_of<BuildAttributes(Attr)>::type,
1196 typename ::boost::mpl::push_back< typename boost::result_of<BuildFlags(Configure)>::type,
1197 ::boost::msm::TerminateFlag>::type,
1198 typename boost::result_of<BuildDeferred(Configure)>::type
1199 >
1200 build_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
1213 template <class StateNameTag,class Expr1,class Expr2,class Attr>
1214 inline
1215 func_state<
1216 StateNameTag,
1217 typename ::boost::mpl::eval_if<
1218 typename proto::matches<Expr1,ActionGrammar>::type,
1219 boost::result_of<ActionGrammar(Expr1)>,
1220 make_invalid_type>::type,
1221 typename ::boost::mpl::eval_if<
1222 typename proto::matches<Expr2,ActionGrammar>::type,
1223 boost::result_of<ActionGrammar(Expr2)>,
1224 make_invalid_type>::type,
1225 typename boost::result_of<BuildAttributes(Attr)>::type,
1226 ::boost::mpl::vector<boost::msm::TerminateFlag>
1227 >
1228 build_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::mpl::vector< ::boost::msm::TerminateFlag> >();
1234 }
1235
1236 template <class StateNameTag,class Expr1,class Expr2>
1237 inline
1238 func_state<
1239 StateNameTag,
1240 typename ::boost::mpl::eval_if<
1241 typename proto::matches<Expr1,ActionGrammar>::type,
1242 boost::result_of<ActionGrammar(Expr1)>,
1243 make_invalid_type>::type,
1244 typename ::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::mpl::vector<boost::msm::TerminateFlag>
1250 >
1251 build_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::mpl::vector< ::boost::msm::TerminateFlag> >();
1257 }
1258
1259 template <class StateNameTag,class Expr1>
1260 inline
1261 func_state<
1262 StateNameTag,
1263 typename ::boost::mpl::eval_if<
1264 typename proto::matches<Expr1,ActionGrammar>::type,
1265 boost::result_of<ActionGrammar(Expr1)>,
1266 make_invalid_type>::type,
1267 NoAction,
1268 ::boost::fusion::vector<>,
1269 ::boost::mpl::vector<boost::msm::TerminateFlag>
1270 >
1271 build_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::mpl::vector<boost::msm::TerminateFlag> >();
1275 }
1276 template<class StateNameTag>
1277 inline
1278 func_state<
1279 StateNameTag,
1280 NoAction,
1281 NoAction,
1282 ::boost::fusion::vector<>,
1283 ::boost::mpl::vector<boost::msm::TerminateFlag>
1284 >
1285 build_terminate_state()
1286 {
1287 return func_state<StateNameTag,NoAction,NoAction,::boost::fusion::vector<>,::boost::mpl::vector<boost::msm::TerminateFlag> >();
1288 }
1289
1290 template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class BASE,class EndInterruptEvent>
1291 inline
1292 func_state<
1293 StateNameTag,
1294 typename ::boost::mpl::eval_if<
1295 typename proto::matches<Expr1,ActionGrammar>::type,
1296 boost::result_of<ActionGrammar(Expr1)>,
1297 make_invalid_type>::type,
1298 typename ::boost::mpl::eval_if<
1299 typename proto::matches<Expr2,ActionGrammar>::type,
1300 boost::result_of<ActionGrammar(Expr2)>,
1301 make_invalid_type>::type,
1302 typename boost::result_of<BuildAttributes(Attr)>::type,
1303 typename ::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,
1308 typename boost::result_of<BuildDeferred(Configure)>::type,
1309 BASE
1310 >
1311 build_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
1326 template <class StateNameTag,class Expr1,class Expr2,class Attr,class Configure,class EndInterruptEvent>
1327 inline
1328 func_state<
1329 StateNameTag,
1330 typename ::boost::mpl::eval_if<
1331 typename proto::matches<Expr1,ActionGrammar>::type,
1332 boost::result_of<ActionGrammar(Expr1)>,
1333 make_invalid_type>::type,
1334 typename ::boost::mpl::eval_if<
1335 typename proto::matches<Expr2,ActionGrammar>::type,
1336 boost::result_of<ActionGrammar(Expr2)>,
1337 make_invalid_type>::type,
1338 typename boost::result_of<BuildAttributes(Attr)>::type,
1339 typename ::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,
1344 typename boost::result_of<BuildDeferred(Configure)>::type
1345 >
1346 build_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
1363 template <class StateNameTag,class Expr1,class Expr2,class Attr,class EndInterruptEvent>
1364 inline
1365 func_state<
1366 StateNameTag,
1367 typename ::boost::mpl::eval_if<
1368 typename proto::matches<Expr1,ActionGrammar>::type,
1369 boost::result_of<ActionGrammar(Expr1)>,
1370 make_invalid_type>::type,
1371 typename ::boost::mpl::eval_if<
1372 typename proto::matches<Expr2,ActionGrammar>::type,
1373 boost::result_of<ActionGrammar(Expr2)>,
1374 make_invalid_type>::type,
1375 typename boost::result_of<BuildAttributes(Attr)>::type,
1376 ::boost::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1377 >
1378 build_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::mpl::vector< boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1385 }
1386
1387 template <class StateNameTag,class Expr1,class Expr2,class EndInterruptEvent>
1388 inline
1389 func_state<
1390 StateNameTag,
1391 typename ::boost::mpl::eval_if<
1392 typename proto::matches<Expr1,ActionGrammar>::type,
1393 boost::result_of<ActionGrammar(Expr1)>,
1394 make_invalid_type>::type,
1395 typename ::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::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1401 >
1402 build_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::mpl::vector< boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1409 }
1410
1411 template <class StateNameTag,class Expr1,class EndInterruptEvent>
1412 inline
1413 func_state<
1414 StateNameTag,
1415 typename ::boost::mpl::eval_if<
1416 typename proto::matches<Expr1,ActionGrammar>::type,
1417 boost::result_of<ActionGrammar(Expr1)>,
1418 make_invalid_type>::type,
1419 NoAction,
1420 ::boost::fusion::vector<>,
1421 ::boost::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1422 >
1423 build_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::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1428 }
1429
1430 template <class StateNameTag,class EndInterruptEvent>
1431 inline
1432 func_state<
1433 StateNameTag,
1434 NoAction,
1435 NoAction,
1436 ::boost::fusion::vector<>,
1437 ::boost::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> >
1438 >
1439 build_interrupt_state(EndInterruptEvent const&)
1440 {
1441 return func_state<StateNameTag,NoAction,NoAction, ::boost::fusion::vector<>,
1442 ::boost::mpl::vector<boost::msm::InterruptedFlag, boost::msm::EndInterruptFlag<EndInterruptEvent> > >();
1443 }
1444
1445 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1446 inline
1447 entry_func_state<
1448 StateNameTag,
1449 ZoneIndex,
1450 typename ::boost::mpl::eval_if<
1451 typename proto::matches<Expr1,ActionGrammar>::type,
1452 boost::result_of<ActionGrammar(Expr1)>,
1453 make_invalid_type>::type,
1454 typename ::boost::mpl::eval_if<
1455 typename proto::matches<Expr2,ActionGrammar>::type,
1456 boost::result_of<ActionGrammar(Expr2)>,
1457 make_invalid_type>::type,
1458 typename boost::result_of<BuildAttributes(Attr)>::type,
1459 typename boost::result_of<BuildFlags(Configure)>::type,
1460 typename boost::result_of<BuildDeferred(Configure)>::type,
1461 BASE
1462 >
1463 build_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
1473 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure>
1474 inline
1475 entry_func_state<
1476 StateNameTag,
1477 ZoneIndex,
1478 typename ::boost::mpl::eval_if<
1479 typename proto::matches<Expr1,ActionGrammar>::type,
1480 boost::result_of<ActionGrammar(Expr1)>,
1481 make_invalid_type>::type,
1482 typename ::boost::mpl::eval_if<
1483 typename proto::matches<Expr2,ActionGrammar>::type,
1484 boost::result_of<ActionGrammar(Expr2)>,
1485 make_invalid_type>::type,
1486 typename boost::result_of<BuildAttributes(Attr)>::type,
1487 typename boost::result_of<BuildFlags(Configure)>::type,
1488 typename boost::result_of<BuildDeferred(Configure)>::type
1489 >
1490 build_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
1500 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr>
1501 inline
1502 entry_func_state<
1503 StateNameTag,
1504 ZoneIndex,
1505 typename ::boost::mpl::eval_if<
1506 typename proto::matches<Expr1,ActionGrammar>::type,
1507 boost::result_of<ActionGrammar(Expr1)>,
1508 make_invalid_type>::type,
1509 typename ::boost::mpl::eval_if<
1510 typename proto::matches<Expr2,ActionGrammar>::type,
1511 boost::result_of<ActionGrammar(Expr2)>,
1512 make_invalid_type>::type,
1513 typename boost::result_of<BuildAttributes(Attr)>::type
1514 >
1515 build_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
1523 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2>
1524 inline
1525 entry_func_state<
1526 StateNameTag,
1527 ZoneIndex,
1528 typename ::boost::mpl::eval_if<
1529 typename proto::matches<Expr1,ActionGrammar>::type,
1530 boost::result_of<ActionGrammar(Expr1)>,
1531 make_invalid_type>::type,
1532 typename ::boost::mpl::eval_if<
1533 typename proto::matches<Expr2,ActionGrammar>::type,
1534 boost::result_of<ActionGrammar(Expr2)>,
1535 make_invalid_type>::type
1536 >
1537 build_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
1544 template <class StateNameTag,int ZoneIndex,class Expr1>
1545 inline
1546 entry_func_state<
1547 StateNameTag,
1548 ZoneIndex,
1549 typename ::boost::mpl::eval_if<
1550 typename proto::matches<Expr1,ActionGrammar>::type,
1551 boost::result_of<ActionGrammar(Expr1)>,
1552 make_invalid_type>::type,
1553 NoAction
1554 >
1555 build_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
1561 template <class StateNameTag,int ZoneIndex>
1562 inline
1563 entry_func_state<
1564 StateNameTag,
1565 ZoneIndex,
1566 NoAction,
1567 NoAction
1568 >
1569 build_entry_state()
1570 {
1571 return entry_func_state<StateNameTag,ZoneIndex,NoAction,NoAction>();
1572 }
1573
1574 template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1575 inline
1576 exit_func_state<
1577 StateNameTag,
1578 Event,
1579 typename ::boost::mpl::eval_if<
1580 typename proto::matches<Expr1,ActionGrammar>::type,
1581 boost::result_of<ActionGrammar(Expr1)>,
1582 make_invalid_type>::type,
1583 typename ::boost::mpl::eval_if<
1584 typename proto::matches<Expr2,ActionGrammar>::type,
1585 boost::result_of<ActionGrammar(Expr2)>,
1586 make_invalid_type>::type,
1587 typename boost::result_of<BuildAttributes(Attr)>::type,
1588 typename boost::result_of<BuildFlags(Configure)>::type,
1589 typename boost::result_of<BuildDeferred(Configure)>::type,
1590 BASE
1591 >
1592 build_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
1602 template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr,class Configure>
1603 inline
1604 exit_func_state<
1605 StateNameTag,
1606 Event,
1607 typename ::boost::mpl::eval_if<
1608 typename proto::matches<Expr1,ActionGrammar>::type,
1609 boost::result_of<ActionGrammar(Expr1)>,
1610 make_invalid_type>::type,
1611 typename ::boost::mpl::eval_if<
1612 typename proto::matches<Expr2,ActionGrammar>::type,
1613 boost::result_of<ActionGrammar(Expr2)>,
1614 make_invalid_type>::type,
1615 typename boost::result_of<BuildAttributes(Attr)>::type,
1616 typename boost::result_of<BuildFlags(Configure)>::type,
1617 typename boost::result_of<BuildDeferred(Configure)>::type
1618 >
1619 build_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
1629 template <class StateNameTag,class Event,class Expr1,class Expr2,class Attr>
1630 inline
1631 exit_func_state<
1632 StateNameTag,
1633 Event,
1634 typename ::boost::mpl::eval_if<
1635 typename proto::matches<Expr1,ActionGrammar>::type,
1636 boost::result_of<ActionGrammar(Expr1)>,
1637 make_invalid_type>::type,
1638 typename ::boost::mpl::eval_if<
1639 typename proto::matches<Expr2,ActionGrammar>::type,
1640 boost::result_of<ActionGrammar(Expr2)>,
1641 make_invalid_type>::type,
1642 typename boost::result_of<BuildAttributes(Attr)>::type
1643 >
1644 build_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
1652 template <class StateNameTag,class Event,class Expr1,class Expr2>
1653 inline
1654 exit_func_state<
1655 StateNameTag,
1656 Event,
1657 typename ::boost::mpl::eval_if<
1658 typename proto::matches<Expr1,ActionGrammar>::type,
1659 boost::result_of<ActionGrammar(Expr1)>,
1660 make_invalid_type>::type,
1661 typename ::boost::mpl::eval_if<
1662 typename proto::matches<Expr2,ActionGrammar>::type,
1663 boost::result_of<ActionGrammar(Expr2)>,
1664 make_invalid_type>::type
1665 >
1666 build_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
1673 template <class StateNameTag,class Event,class Expr1>
1674 inline
1675 exit_func_state<
1676 StateNameTag,
1677 Event,
1678 typename ::boost::mpl::eval_if<
1679 typename proto::matches<Expr1,ActionGrammar>::type,
1680 boost::result_of<ActionGrammar(Expr1)>,
1681 make_invalid_type>::type,
1682 NoAction
1683 >
1684 build_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
1690 template <class StateNameTag,class Event>
1691 inline
1692 exit_func_state<
1693 StateNameTag,
1694 Event,
1695 NoAction,
1696 NoAction
1697 >
1698 build_exit_state(Event const&)
1699 {
1700 return exit_func_state<StateNameTag,Event,NoAction,NoAction>();
1701 }
1702
1703 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure,class BASE>
1704 inline
1705 explicit_entry_func_state<
1706 StateNameTag,
1707 ZoneIndex,
1708 typename ::boost::mpl::eval_if<
1709 typename proto::matches<Expr1,ActionGrammar>::type,
1710 boost::result_of<ActionGrammar(Expr1)>,
1711 make_invalid_type>::type,
1712 typename ::boost::mpl::eval_if<
1713 typename proto::matches<Expr2,ActionGrammar>::type,
1714 boost::result_of<ActionGrammar(Expr2)>,
1715 make_invalid_type>::type,
1716 typename boost::result_of<BuildAttributes(Attr)>::type,
1717 typename boost::result_of<BuildFlags(Configure)>::type,
1718 typename boost::result_of<BuildDeferred(Configure)>::type,
1719 BASE
1720 >
1721 build_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
1731 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr,class Configure>
1732 inline
1733 explicit_entry_func_state<
1734 StateNameTag,
1735 ZoneIndex,
1736 typename ::boost::mpl::eval_if<
1737 typename proto::matches<Expr1,ActionGrammar>::type,
1738 boost::result_of<ActionGrammar(Expr1)>,
1739 make_invalid_type>::type,
1740 typename ::boost::mpl::eval_if<
1741 typename proto::matches<Expr2,ActionGrammar>::type,
1742 boost::result_of<ActionGrammar(Expr2)>,
1743 make_invalid_type>::type,
1744 typename boost::result_of<BuildAttributes(Attr)>::type,
1745 typename boost::result_of<BuildFlags(Configure)>::type,
1746 typename boost::result_of<BuildDeferred(Configure)>::type
1747 >
1748 build_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
1758 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2,class Attr>
1759 inline
1760 explicit_entry_func_state<
1761 StateNameTag,
1762 ZoneIndex,
1763 typename ::boost::mpl::eval_if<
1764 typename proto::matches<Expr1,ActionGrammar>::type,
1765 boost::result_of<ActionGrammar(Expr1)>,
1766 make_invalid_type>::type,
1767 typename ::boost::mpl::eval_if<
1768 typename proto::matches<Expr2,ActionGrammar>::type,
1769 boost::result_of<ActionGrammar(Expr2)>,
1770 make_invalid_type>::type,
1771 typename boost::result_of<BuildAttributes(Attr)>::type
1772 >
1773 build_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
1781 template <class StateNameTag,int ZoneIndex,class Expr1,class Expr2>
1782 inline
1783 explicit_entry_func_state<
1784 StateNameTag,
1785 ZoneIndex,
1786 typename ::boost::mpl::eval_if<
1787 typename proto::matches<Expr1,ActionGrammar>::type,
1788 boost::result_of<ActionGrammar(Expr1)>,
1789 make_invalid_type>::type,
1790 typename ::boost::mpl::eval_if<
1791 typename proto::matches<Expr2,ActionGrammar>::type,
1792 boost::result_of<ActionGrammar(Expr2)>,
1793 make_invalid_type>::type
1794 >
1795 build_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
1802 template <class StateNameTag,int ZoneIndex,class Expr1>
1803 inline
1804 explicit_entry_func_state<
1805 StateNameTag,
1806 ZoneIndex,
1807 typename ::boost::mpl::eval_if<
1808 typename proto::matches<Expr1,ActionGrammar>::type,
1809 boost::result_of<ActionGrammar(Expr1)>,
1810 make_invalid_type>::type,
1811 NoAction
1812 >
1813 build_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
1819 template <class StateNameTag,int ZoneIndex>
1820 inline
1821 explicit_entry_func_state<
1822 StateNameTag,
1823 ZoneIndex,
1824 NoAction,
1825 NoAction
1826 >
1827 build_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