Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74850 - in branches/release/boost/msm: . back front front/detail front/euml mpl_graph
From: christophe.j.henry_at_[hidden]
Date: 2011-10-09 09:16:12


Author: chenry
Date: 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
New Revision: 74850
URL: http://svn.boost.org/trac/boost/changeset/74850

Log:
merged revisions 72697 - 74363
Removed:
   branches/release/boost/msm/back/any_event.hpp
Properties modified:
   branches/release/boost/msm/ (props changed)
   branches/release/boost/msm/active_state_switching_policies.hpp (props changed)
   branches/release/boost/msm/back/ (props changed)
   branches/release/boost/msm/back/args.hpp (contents, props changed)
   branches/release/boost/msm/back/bind_helpers.hpp (props changed)
   branches/release/boost/msm/back/common_types.hpp (props changed)
   branches/release/boost/msm/back/copy_policies.hpp (props changed)
   branches/release/boost/msm/back/default_compile_policy.hpp (props changed)
   branches/release/boost/msm/back/dispatch_table.hpp (contents, props changed)
   branches/release/boost/msm/back/favor_compile_time.hpp (contents, props changed)
   branches/release/boost/msm/back/fold_to_list.hpp (props changed)
   branches/release/boost/msm/back/history_policies.hpp (props changed)
   branches/release/boost/msm/back/metafunctions.hpp (contents, props changed)
   branches/release/boost/msm/back/mpl_graph_fsm_check.hpp (props changed)
   branches/release/boost/msm/back/no_fsm_check.hpp (props changed)
   branches/release/boost/msm/back/queue_container_circular.hpp (props changed)
   branches/release/boost/msm/back/queue_container_deque.hpp (props changed)
   branches/release/boost/msm/back/state_machine.hpp (contents, props changed)
   branches/release/boost/msm/back/tools.hpp (props changed)
   branches/release/boost/msm/common.hpp (props changed)
   branches/release/boost/msm/front/ (props changed)
   branches/release/boost/msm/front/common_states.hpp (props changed)
   branches/release/boost/msm/front/completion_event.hpp (contents, props changed)
   branches/release/boost/msm/front/detail/ (props changed)
   branches/release/boost/msm/front/detail/common_states.hpp (props changed)
   branches/release/boost/msm/front/detail/row2_helper.hpp (props changed)
   branches/release/boost/msm/front/euml/ (props changed)
   branches/release/boost/msm/front/euml/algorithm.hpp (props changed)
   branches/release/boost/msm/front/euml/common.hpp (contents, props changed)
   branches/release/boost/msm/front/euml/container.hpp (props changed)
   branches/release/boost/msm/front/euml/euml.hpp (props changed)
   branches/release/boost/msm/front/euml/euml_typeof.hpp (props changed)
   branches/release/boost/msm/front/euml/guard_grammar.hpp (contents, props changed)
   branches/release/boost/msm/front/euml/iteration.hpp (props changed)
   branches/release/boost/msm/front/euml/operator.hpp (props changed)
   branches/release/boost/msm/front/euml/phoenix_placeholders.hpp (props changed)
   branches/release/boost/msm/front/euml/querying.hpp (props changed)
   branches/release/boost/msm/front/euml/state_grammar.hpp (contents, props changed)
   branches/release/boost/msm/front/euml/stl.hpp (props changed)
   branches/release/boost/msm/front/euml/stt_grammar.hpp (contents, props changed)
   branches/release/boost/msm/front/euml/transformation.hpp (props changed)
   branches/release/boost/msm/front/functor_row.hpp (props changed)
   branches/release/boost/msm/front/internal_row.hpp (props changed)
   branches/release/boost/msm/front/row2.hpp (props changed)
   branches/release/boost/msm/front/state_machine_def.hpp (props changed)
   branches/release/boost/msm/front/states.hpp (props changed)
   branches/release/boost/msm/mpl_graph/ (props changed)
   branches/release/boost/msm/msm_grammar.hpp (props changed)
   branches/release/boost/msm/proto_config.hpp (props changed)
   branches/release/boost/msm/row_tags.hpp (props changed)
Text files modified:
   branches/release/boost/msm/back/args.hpp | 6
   branches/release/boost/msm/back/dispatch_table.hpp | 113 ++++++++++++++++--
   branches/release/boost/msm/back/favor_compile_time.hpp | 109 +++++++++++++----
   branches/release/boost/msm/back/metafunctions.hpp | 26 ++++
   branches/release/boost/msm/back/state_machine.hpp | 246 ++++++++++++++++++++++++++++++++++-----
   branches/release/boost/msm/front/completion_event.hpp | 6
   branches/release/boost/msm/front/euml/common.hpp | 233 +++++++++++++++++++++++++++++++++++++
   branches/release/boost/msm/front/euml/guard_grammar.hpp | 2
   branches/release/boost/msm/front/euml/state_grammar.hpp | 12
   branches/release/boost/msm/front/euml/stt_grammar.hpp | 10
   10 files changed, 671 insertions(+), 92 deletions(-)

Deleted: branches/release/boost/msm/back/any_event.hpp
==============================================================================
--- branches/release/boost/msm/back/any_event.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
+++ (empty file)
@@ -1,54 +0,0 @@
-// Copyright 2008 Christophe Henry
-// henry UNDERSCORE christophe AT hotmail DOT com
-// This is an extended version of the state machine available in the boost::mpl library
-// Distributed under the same license as the original.
-// Copyright for the original version:
-// Copyright 2005 David Abrahams and Aleksey Gurtovoy. Distributed
-// under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_MSM_BACK_ANY_EVENT_H
-#define BOOST_MSM_BACK_ANY_EVENT_H
-
-#include <boost/smart_ptr/scoped_ptr.hpp>
-#include <boost/msm/back/common_types.hpp>
-
-namespace boost { namespace msm { namespace back
-{
-class placeholder
-{
-public:
- virtual ::boost::msm::back::HandledEnum process_event() const =0;
-};
-template<class EventType,class FsmType>
-class holder : public placeholder
-{
-public:
- holder(EventType const& evt, FsmType& fsm){}
- virtual ::boost::msm::back::HandledEnum process_event() const
- {
- //default. Will not be called
- return HANDLED_TRUE;
- }
-private:
-};
-
-class any_event
-{
-public:
- template <class EventType,class FsmType>
- any_event(EventType const& evt,FsmType& fsm):content_(new holder<EventType,FsmType>(evt,fsm)){}
- ::boost::msm::back::HandledEnum process_event() const
- {
- return content_->process_event();
- }
-private:
-
- ::boost::scoped_ptr<placeholder> content_;
-};
-
-}}}
-
-#endif //BOOST_MSM_BACK_ANY_EVENT_H
-

Modified: branches/release/boost/msm/back/args.hpp
==============================================================================
--- branches/release/boost/msm/back/args.hpp (original)
+++ branches/release/boost/msm/back/args.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -28,10 +28,10 @@
 
 namespace boost { namespace msm { namespace back
 {
-struct none {};
+struct no_args {};
 #define MSM_ARGS_TYPEDEF_SUB(z, n, unused) typedef ARG ## n argument ## n ;
 #define MSM_ARGS_PRINT(z, n, data) data
-#define MSM_ARGS_NONE_PRINT(z, n, data) class data ## n = none \
+#define MSM_ARGS_NONE_PRINT(z, n, data) class data ## n = no_args \
     BOOST_PP_COMMA_IF( BOOST_PP_LESS(n, BOOST_PP_DEC(BOOST_MSM_VISITOR_ARG_SIZE) ) )
 
 #define MSM_VISITOR_MAIN_ARGS(n) \
@@ -49,7 +49,7 @@
     struct args<RES, \
                 BOOST_PP_ENUM_PARAMS(n,ARG) \
                 BOOST_PP_COMMA_IF(n) \
- BOOST_PP_ENUM(BOOST_PP_SUB(BOOST_MSM_VISITOR_ARG_SIZE,n), MSM_ARGS_PRINT, none) \
+ BOOST_PP_ENUM(BOOST_PP_SUB(BOOST_MSM_VISITOR_ARG_SIZE,n), MSM_ARGS_PRINT, no_args) \
> \
     { \
         typedef ::boost::function<RES(BOOST_PP_ENUM_PARAMS(n, ARG))> type; \

Modified: branches/release/boost/msm/back/dispatch_table.hpp
==============================================================================
--- branches/release/boost/msm/back/dispatch_table.hpp (original)
+++ branches/release/boost/msm/back/dispatch_table.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -18,11 +18,15 @@
 #include <boost/mpl/filter_view.hpp>
 #include <boost/mpl/pop_front.hpp>
 #include <boost/mpl/for_each.hpp>
+#include <boost/mpl/advance.hpp>
+
 #include <boost/type_traits/is_base_of.hpp>
 
 #include <boost/msm/back/metafunctions.hpp>
 #include <boost/msm/back/common_types.hpp>
 
+BOOST_MPL_HAS_XXX_TRAIT_DEF(is_frow)
+
 namespace boost { namespace msm { namespace back
 {
 
@@ -94,9 +98,49 @@
     template< typename Entry >
     struct make_chain_row_from_map_entry
     {
- typedef chain_row<typename Entry::second,Event,
+ // if we have more than one frow with the same state as source, remove the ones extra
+ // note: we know the frow's are located at the beginning so we remove at the beginning (number of frows - 1) elements
+ enum {number_frows = ::boost::mpl::count_if< typename Entry::second,has_is_frow< ::boost::mpl::placeholders::_1> >::value};
+
+ //erases the first NumberToDelete rows
+ template<class Sequence, int NumberToDelete>
+ struct erase_first_rows
+ {
+ typedef typename ::boost::mpl::erase<
+ typename Entry::second,
+ typename ::boost::mpl::begin<Sequence>::type,
+ typename ::boost::mpl::advance<
+ typename ::boost::mpl::begin<Sequence>::type,
+ ::boost::mpl::int_<NumberToDelete> >::type
+ >::type type;
+ };
+ // if we have more than 1 frow with this event (not allowed), delete the spare
+ typedef typename ::boost::mpl::eval_if<
+ typename ::boost::mpl::bool_< number_frows >= 2 >::type,
+ erase_first_rows<typename Entry::second,number_frows-1>,
+ ::boost::mpl::identity<typename Entry::second>
+ >::type filtered_stt;
+
+ typedef chain_row<filtered_stt,Event,
             typename Entry::first > type;
     };
+ // helper for lazy evaluation in eval_if of change_frow_event
+ template <class Transition,class NewEvent>
+ struct replace_event
+ {
+ typedef typename Transition::template replace_event<NewEvent>::type type;
+ };
+ // changes the event type for a frow to the event we are dispatching
+ // this helps ensure that an event does not get processed more than once because of frows and base events.
+ template <class FrowTransition>
+ struct change_frow_event
+ {
+ typedef typename ::boost::mpl::eval_if<
+ typename has_is_frow<FrowTransition>::type,
+ replace_event<FrowTransition,Event>,
+ boost::mpl::identity<FrowTransition>
+ >::type type;
+ };
     // Compute the maximum state value in the sm so we know how big
     // to make the table
     typedef typename generate_state_set<Stt>::type state_list;
@@ -110,22 +154,47 @@
           : self(self_)
         {}
         // version for transition event not base of our event
+ // first for all transitions, then for internal ones of a fsm
         template <class Transition>
- void init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
+ typename ::boost::disable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
         {
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id =
                 (get_state_id<stt,typename Transition::current_state_type>::value));
- self->entries[state_id] = reinterpret_cast<cell>(&Transition::execute);
+ self->entries[state_id+1] = reinterpret_cast<cell>(&Transition::execute);
+ }
+ template <class Transition>
+ typename ::boost::enable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
+ {
+ self->entries[0] = reinterpret_cast<cell>(&Transition::execute);
         }
+
         // version for transition event base of our event
+ // first for all transitions, then for internal ones of a fsm
         template <class Transition>
- void init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
+ typename ::boost::disable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
         {
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id =
                 (get_state_id<stt,typename Transition::current_state_type>::value));
- self->entries[state_id] = &Transition::execute;
+ self->entries[state_id+1] = &Transition::execute;
+ }
+ template <class Transition>
+ typename ::boost::enable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
+ {
+ self->entries[0] = &Transition::execute;
         }
         // Cell initializer function object, used with mpl::for_each
         template <class Transition>
@@ -163,18 +232,35 @@
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
             cell call_no_transition = &Fsm::defer_transition;
- tofill_entries[state_id] = call_no_transition;
+ tofill_entries[state_id+1] = call_no_transition;
         }
         template <class State>
- typename ::boost::disable_if<typename has_state_delayed_event<State,Event>::type,void >::type
+ typename ::boost::disable_if<
+ typename ::boost::mpl::or_<
+ typename has_state_delayed_event<State,Event>::type,
+ typename ::boost::is_same<State,Fsm>::type
+ >::type
+ ,void >::type
         operator()(boost::msm::wrap<State> const&,boost::msm::back::dummy<1> = 0)
         {
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
             cell call_no_transition = &Fsm::call_no_transition;
- tofill_entries[state_id] = call_no_transition;
+ tofill_entries[state_id+1] = call_no_transition;
+ }
+ // case for internal transitions of this fsm
+ template <class State>
+ typename ::boost::enable_if<
+ typename ::boost::mpl::and_<
+ typename ::boost::mpl::not_<typename has_state_delayed_event<State,Event>::type>::type,
+ typename ::boost::is_same<State,Fsm>::type
+ >::type
+ ,void>::type
+ operator()(boost::msm::wrap<State> const&,boost::msm::back::dummy<2> = 0)
+ {
+ cell call_no_transition = &Fsm::call_no_transition_internal;
+ tofill_entries[0] = call_no_transition;
         }
-
         dispatch_table* self;
         cell* tofill_entries;
     };
@@ -197,7 +283,7 @@
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
             cell call_no_transition = &Fsm::default_eventless_transition;
- tofill_entries[state_id] = call_no_transition;
+ tofill_entries[state_id+1] = call_no_transition;
         }
 
         dispatch_table* self;
@@ -233,13 +319,13 @@
                                                    ::boost::mpl::push_back<
                                                         ::boost::mpl::at< ::boost::mpl::placeholders::_1,
                                                         transition_source_type< ::boost::mpl::placeholders::_2> >,
- ::boost::mpl::placeholders::_2 >
+ change_frow_event< ::boost::mpl::placeholders::_2 > >
> >,
                             // first row on this source state, make a vector with 1 element
                             ::boost::mpl::insert<
                                         ::boost::mpl::placeholders::_1,
                                         ::boost::mpl::pair<transition_source_type< ::boost::mpl::placeholders::_2>,
- make_vector< ::boost::mpl::placeholders::_2> > >
+ make_vector< change_frow_event< ::boost::mpl::placeholders::_2> > > >
>
>::type map_of_row_seq;
         // and then build chaining rows for all source states having more than 1 row
@@ -264,7 +350,8 @@
     static const dispatch_table instance;
 
  public: // data members
- cell entries[max_state];
+ // +1 => 0 is reserved for this fsm (internal transitions)
+ cell entries[max_state+1];
 };
 
 }}} // boost::msm::back

Modified: branches/release/boost/msm/back/favor_compile_time.hpp
==============================================================================
--- branches/release/boost/msm/back/favor_compile_time.hpp (original)
+++ branches/release/boost/msm/back/favor_compile_time.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -17,33 +17,51 @@
 #include <boost/mpl/filter_view.hpp>
 #include <boost/mpl/for_each.hpp>
 #include <boost/mpl/bool.hpp>
+#include <boost/any.hpp>
 
 #include <boost/msm/common.hpp>
 #include <boost/msm/back/metafunctions.hpp>
 #include <boost/msm/back/common_types.hpp>
 #include <boost/msm/back/dispatch_table.hpp>
-#include <boost/msm/back/any_event.hpp>
 
 namespace boost { namespace msm { namespace back
 {
 
+template <class Fsm>
+struct process_any_event_helper
+{
+ process_any_event_helper(msm::back::HandledEnum& res_,Fsm* self_,::boost::any any_event_):
+ res(res_),self(self_),any_event(any_event_),finished(false){}
+ template <class Event>
+ void operator()(boost::msm::wrap<Event> const&)
+ {
+ if ( ! finished && ::boost::any_cast<Event>(&any_event)!=0)
+ {
+ finished = true;
+ res = self->process_event(::boost::any_cast<Event>(any_event));
+ }
+ }
+private:
+ msm::back::HandledEnum& res;
+ Fsm* self;
+ ::boost::any any_event;
+ bool finished;
+};
+
 #define BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(fsmname) \
     namespace boost { namespace msm { namespace back{ \
- template<class EventType> \
- class holder<EventType,fsmname> : public placeholder \
- { \
- public: \
- holder(EventType const& evt, fsmname& fsm): event_(evt),fsm_(fsm){} \
- virtual ::boost::msm::back::HandledEnum process_event() const \
- {return fsm_.process_event(event_);} \
- private: \
- EventType const& event_; \
- fsmname& fsm_; \
- }; \
     template<> \
- ::boost::msm::back::HandledEnum fsmname::process_any_event( any_event const& evt)const \
+ ::boost::msm::back::HandledEnum fsmname::process_any_event( ::boost::any const& any_event) \
     { \
- return evt.process_event(); \
+ typedef ::boost::msm::back::recursive_get_transition_table<fsmname>::type stt; \
+ typedef ::boost::msm::back::generate_event_set<stt>::type stt_events; \
+ typedef ::boost::msm::back::recursive_get_internal_transition_table<fsmname, ::boost::mpl::true_ >::type istt; \
+ typedef ::boost::msm::back::generate_event_set<create_real_stt<fsmname,istt>::type >::type istt_events; \
+ typedef ::boost::msm::back::set_insert_range<stt_events,istt_events>::type all_events; \
+ ::boost::msm::back::HandledEnum res= ::boost::msm::back::HANDLED_FALSE; \
+ ::boost::mpl::for_each<all_events, ::boost::msm::wrap< ::boost::mpl::placeholders::_1> > \
+ (::boost::msm::back::process_any_event_helper<fsmname>(res,this,any_event)); \
+ return res; \
     } \
     }}}
 
@@ -92,8 +110,7 @@
     template <class TransitionState>
     static HandledEnum call_submachine(Fsm& fsm, int region, int state, Event const& evt)
     {
- return (fsm.template get_state<TransitionState&>()).process_any_event
- ( any_event(evt,fsm.template get_state<TransitionState&>()) );
+ return (fsm.template get_state<TransitionState&>()).process_any_event( ::boost::any(evt));
     }
     // A function object for use with mpl::for_each that stuffs
     // transitions into cells.
@@ -104,21 +121,44 @@
         {}
         // version for transition event not base of our event
         template <class Transition>
- void init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
+ typename ::boost::disable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
         {
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id =
                 (get_state_id<stt,typename Transition::current_state_type>::value));
- self->entries[state_id].one_state.push_front(reinterpret_cast<cell>(&Transition::execute));
+ self->entries[state_id+1].one_state.push_front(reinterpret_cast<cell>(&Transition::execute));
         }
+ template <class Transition>
+ typename ::boost::enable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::true_ const &) const
+ {
+ self->entries[0].one_state.push_front(reinterpret_cast<cell>(&Transition::execute));
+ }
+
         // version for transition event base of our event
         template <class Transition>
- void init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
+ typename ::boost::disable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
         {
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id =
                 (get_state_id<stt,typename Transition::current_state_type>::value));
- self->entries[state_id].one_state.push_front(&Transition::execute);
+ self->entries[state_id+1].one_state.push_front(&Transition::execute);
+ }
+ template <class Transition>
+ typename ::boost::enable_if<
+ typename ::boost::is_same<typename Transition::current_state_type,Fsm>::type
+ ,void>::type
+ init_event_base_case(Transition const&, ::boost::mpl::false_ const &) const
+ {
+ self->entries[0].one_state.push_front(&Transition::execute);
         }
         // Cell initializer function object, used with mpl::for_each
         template <class Transition>
@@ -160,7 +200,7 @@
                 typedef typename create_stt<Fsm>::type stt;
                 BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
                 cell call_no_transition = &Fsm::defer_transition;
- tofill[state_id].one_state.push_back(call_no_transition);
+ tofill[state_id+1].one_state.push_back(call_no_transition);
             }
         };
         template <int some_dummy> struct helper<true,true,some_dummy>
@@ -171,18 +211,33 @@
                 typedef typename create_stt<Fsm>::type stt;
                 BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
                 cell call_no_transition = &Fsm::defer_transition;
- tofill[state_id].one_state.push_back(call_no_transition);
+ tofill[state_id+1].one_state.push_back(call_no_transition);
             }
         };
         template <int some_dummy> struct helper<false,true,some_dummy>
         {
             template <class State>
- static void execute(boost::msm::wrap<State> const&,chain_row* tofill)
+ static
+ typename ::boost::enable_if<
+ typename ::boost::is_same<State,Fsm>::type
+ ,void>::type
+ execute(boost::msm::wrap<State> const&,chain_row* tofill,boost::msm::back::dummy<0> = 0)
+ {
+ // for internal tables
+ cell call_no_transition_internal = &Fsm::call_no_transition;
+ tofill[0].one_state.push_front(call_no_transition_internal);
+ }
+ template <class State>
+ static
+ typename ::boost::disable_if<
+ typename ::boost::is_same<State,Fsm>::type
+ ,void>::type
+ execute(boost::msm::wrap<State> const&,chain_row* tofill,boost::msm::back::dummy<1> = 0)
             {
                 typedef typename create_stt<Fsm>::type stt;
                 BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
                 cell call_no_transition = &call_submachine< State >;
- tofill[state_id].one_state.push_front(call_no_transition);
+ tofill[state_id+1].one_state.push_front(call_no_transition);
             }
         };
         template <int some_dummy> struct helper<false,false,some_dummy>
@@ -193,7 +248,7 @@
                 typedef typename create_stt<Fsm>::type stt;
                 BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
                 cell call_no_transition = &Fsm::call_no_transition;
- tofill[state_id].one_state.push_back(call_no_transition);
+ tofill[state_id+1].one_state.push_back(call_no_transition);
             }
         };
         template <class State>
@@ -224,7 +279,7 @@
             typedef typename create_stt<Fsm>::type stt;
             BOOST_STATIC_CONSTANT(int, state_id = (get_state_id<stt,State>::value));
             cell call_no_transition = &Fsm::default_eventless_transition;
- tofill_entries[state_id].one_state.push_back(call_no_transition);
+ tofill_entries[state_id+1].one_state.push_back(call_no_transition);
         }
 
         dispatch_table* self;
@@ -252,7 +307,7 @@
     static const dispatch_table instance;
 
  public: // data members
- chain_row entries[max_state];
+ chain_row entries[max_state+1];
 };
 
 template <class Fsm,class Stt, class Event>

Modified: branches/release/boost/msm/back/metafunctions.hpp
==============================================================================
--- branches/release/boost/msm/back/metafunctions.hpp (original)
+++ branches/release/boost/msm/back/metafunctions.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -455,6 +455,29 @@
 {
     typedef typename create_stt<Composite>::type type;
 };
+
+// recursively builds an internal table including those of substates, sub-substates etc.
+// variant for submachines
+template <class StateType,class IsComposite>
+struct recursive_get_internal_transition_table
+{
+ // get the composite's internal table
+ typedef typename StateType::internal_transition_table composite_table;
+ // and for every substate (state of submachine), recursively get the internal transition table
+ typedef typename generate_state_set<typename StateType::stt>::type composite_states;
+ typedef typename ::boost::mpl::fold<
+ composite_states, composite_table,
+ ::boost::mpl::insert_range< ::boost::mpl::placeholders::_1, ::boost::mpl::end< ::boost::mpl::placeholders::_1>,
+ recursive_get_internal_transition_table< ::boost::mpl::placeholders::_2, is_composite_state< ::boost::mpl::placeholders::_2> >
+ >
+ >::type type;
+};
+// stop iterating on leafs (simple states)
+template <class StateType>
+struct recursive_get_internal_transition_table<StateType, ::boost::mpl::false_ >
+{
+ typedef typename StateType::internal_transition_table type;
+};
 // recursively get a transition table for a given composite state.
 // returns the transition table for this state + the tables of all composite sub states recursively
 template <class Composite>
@@ -463,7 +486,8 @@
     // get the transition table of the state if it's a state machine
     typedef typename ::boost::mpl::eval_if<typename is_composite_state<Composite>::type,
         get_transition_table<Composite>,
- ::boost::mpl::vector0<> >::type org_table;
+ ::boost::mpl::vector0<>
+ >::type org_table;
 
     typedef typename generate_state_set<org_table>::type states;
 

Modified: branches/release/boost/msm/back/state_machine.hpp
==============================================================================
--- branches/release/boost/msm/back/state_machine.hpp (original)
+++ branches/release/boost/msm/back/state_machine.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -44,6 +44,9 @@
 #include <boost/bind.hpp>
 #include <boost/bind/apply.hpp>
 #include <boost/function.hpp>
+#ifndef BOOST_NO_RTTI
+#include <boost/any.hpp>
+#endif
 
 #include <boost/serialization/base_object.hpp>
 
@@ -54,14 +57,12 @@
 #include <boost/msm/back/fold_to_list.hpp>
 #include <boost/msm/back/metafunctions.hpp>
 #include <boost/msm/back/history_policies.hpp>
-#include <boost/msm/back/bind_helpers.hpp>
 #include <boost/msm/back/common_types.hpp>
 #include <boost/msm/back/args.hpp>
 #include <boost/msm/back/default_compile_policy.hpp>
 #include <boost/msm/back/dispatch_table.hpp>
 #include <boost/msm/back/no_fsm_check.hpp>
 #include <boost/msm/back/queue_container_deque.hpp>
-#include <boost/msm/back/any_event.hpp>
 
 BOOST_MPL_HAS_XXX_TRAIT_DEF(accept_sig)
 BOOST_MPL_HAS_XXX_TRAIT_DEF(no_automatic_create)
@@ -336,7 +337,8 @@
             template <class ForwardEvent>
             static void helper(ForwardEvent const& ,forwarding_function& )
             {
- // Not our event, ignore
+ // Not our event, assert
+ BOOST_ASSERT(false);
             }
         };
         template <int Dummy>
@@ -815,6 +817,43 @@
         }
     };
     template<
+ typename ROW
+ >
+ struct internal_ <ROW,library_sm>
+ {
+ typedef library_sm current_state_type;
+ typedef library_sm next_state_type;
+ typedef typename ROW::Evt transition_event;
+
+ // if a guard condition is here, call it to check that the event is accepted
+ static bool check_guard(library_sm& fsm,transition_event const& evt)
+ {
+ if ( ROW::guard_call(fsm,evt,
+ fsm,
+ fsm,
+ fsm.m_substate_list) )
+ return true;
+ return false;
+ }
+ // Take the transition action and return the next state.
+ static HandledEnum execute(library_sm& fsm, int , int , transition_event const& evt)
+ {
+ if (!check_guard(fsm,evt))
+ {
+ // guard rejected the event, we stay in the current one
+ return HANDLED_GUARD_REJECT;
+ }
+
+ // then call the action method
+ HandledEnum res = ROW::action_call(fsm,evt,
+ fsm,
+ fsm,
+ fsm.m_substate_list);
+ return res;
+ }
+ };
+
+ template<
         typename ROW,
         typename StateType
>
@@ -836,6 +875,26 @@
         }
     };
     template<
+ typename ROW
+ >
+ struct a_internal_ <ROW,library_sm>
+ {
+ typedef library_sm current_state_type;
+ typedef library_sm next_state_type;
+ typedef typename ROW::Evt transition_event;
+
+ // Take the transition action and return the next state.
+ static HandledEnum execute(library_sm& fsm, int, int, transition_event const& evt)
+ {
+ // then call the action method
+ HandledEnum res = ROW::action_call(fsm,evt,
+ fsm,
+ fsm,
+ fsm.m_substate_list);
+ return res;
+ }
+ };
+ template<
         typename ROW,
         typename StateType
>
@@ -867,6 +926,36 @@
         }
     };
     template<
+ typename ROW
+ >
+ struct g_internal_ <ROW,library_sm>
+ {
+ typedef library_sm current_state_type;
+ typedef library_sm next_state_type;
+ typedef typename ROW::Evt transition_event;
+
+ // if a guard condition is here, call it to check that the event is accepted
+ static bool check_guard(library_sm& fsm,transition_event const& evt)
+ {
+ if ( ROW::guard_call(fsm,evt,
+ fsm,
+ fsm,
+ fsm.m_substate_list) )
+ return true;
+ return false;
+ }
+ // Take the transition action and return the next state.
+ static HandledEnum execute(library_sm& fsm, int, int, transition_event const& evt)
+ {
+ if (!check_guard(fsm,evt))
+ {
+ // guard rejected the event, we stay in the current one
+ return HANDLED_GUARD_REJECT;
+ }
+ return HANDLED_TRUE;
+ }
+ };
+ template<
         typename ROW,
         typename StateType
>
@@ -880,6 +969,19 @@
             return HANDLED_TRUE;
         }
     };
+ template<
+ typename ROW
+ >
+ struct _internal_ <ROW,library_sm>
+ {
+ typedef library_sm current_state_type;
+ typedef library_sm next_state_type;
+ typedef typename ROW::Evt transition_event;
+ static HandledEnum execute(library_sm& , int , int , transition_event const& )
+ {
+ return HANDLED_TRUE;
+ }
+ };
     // Template used to form forwarding rows in the transition table for every row of a composite SM
     template<
         typename T1
@@ -890,6 +992,8 @@
         typedef T1 current_state_type;
         typedef T1 next_state_type;
         typedef Evt transition_event;
+ // tag to find out if a row is a forwarding row
+ typedef int is_frow;
 
         // Take the transition action and return the next state.
         static HandledEnum execute(library_sm& fsm, int region_index, int , transition_event const& evt)
@@ -899,6 +1003,13 @@
              fsm.m_states[region_index]=get_state_id<stt,T1>::type::value;
              return res;
         }
+ // helper metafunctions used by dispatch table and give the frow a new event
+ // (used to avoid double entries in a table because of base events)
+ template <class NewEvent>
+ struct replace_event
+ {
+ typedef frow<T1,NewEvent> type;
+ };
     };
 
     template <class Tag, class Transition,class StateType>
@@ -1000,21 +1111,24 @@
         // first get the table of a composite
         typedef typename recursive_get_transition_table<StateType>::type original_table;
 
- // add the internal events defined in the internal_transition_table
- // Note: these are added first because they must have a lesser prio
- // than the deeper transitions in the sub regions
- typedef typename StateType::internal_transition_table istt_simulated;
+ // we now look for the events the composite has in its internal transitions
+ // the internal ones are searched recursively in sub-sub... states
+ // we go recursively because our states can also have internal tables or substates etc.
+ typedef typename recursive_get_internal_transition_table<StateType, ::boost::mpl::true_>::type recursive_istt;
         typedef typename ::boost::mpl::fold<
- istt_simulated,::boost::mpl::vector0<>,
- ::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
- make_row_tag< ::boost::mpl::placeholders::_2 , StateType> >
- >::type intermediate;
+ recursive_istt,::boost::mpl::vector0<>,
+ ::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
+ make_row_tag< ::boost::mpl::placeholders::_2 , StateType> >
+ >::type recursive_istt_with_tag;
+
+ typedef typename ::boost::mpl::insert_range< original_table, typename ::boost::mpl::end<original_table>::type,
+ recursive_istt_with_tag>::type table_with_all_events;
 
         // and add for every event a forwarding row
         typedef typename ::boost::mpl::eval_if<
                 typename CompilePolicy::add_forwarding_rows,
- add_forwarding_row_helper<original_table,intermediate,StateType>,
- ::boost::mpl::identity<intermediate>
+ add_forwarding_row_helper<table_with_all_events,::boost::mpl::vector0<>,StateType>,
+ ::boost::mpl::identity< ::boost::mpl::vector0<> >
>::type type;
     };
     template <class StateType>
@@ -1022,6 +1136,7 @@
     {
         typedef typename create_real_stt<StateType, typename StateType::internal_transition_table >::type type;
     };
+ // typedefs used internally
     typedef typename create_real_stt<Derived>::type real_transition_table;
     typedef typename create_stt<library_sm>::type stt;
     typedef typename get_initial_states<typename Derived::initial_state>::type initial_states;
@@ -1029,6 +1144,9 @@
     typedef typename HistoryPolicy::template apply<nr_regions::value>::type concrete_history;
 
     typedef typename ::boost::fusion::result_of::as_set<state_list>::type substate_list;
+ typedef typename ::boost::msm::back::generate_event_set<
+ typename create_real_stt<library_sm, typename library_sm::internal_transition_table >::type
+ >::type processable_events_internal_table;
 
     // extends the transition table with rows from composite states
     template <class Composite>
@@ -1037,9 +1155,27 @@
         // add the init states
         //typedef typename create_stt<Composite>::type stt;
         typedef typename Composite::stt Stt;
+
+ // add the internal events defined in the internal_transition_table
+ // Note: these are added first because they must have a lesser prio
+ // than the deeper transitions in the sub regions
+ // table made of a stt + internal transitions of composite
+ typedef typename ::boost::mpl::fold<
+ typename Composite::internal_transition_table,::boost::mpl::vector0<>,
+ ::boost::mpl::push_back< ::boost::mpl::placeholders::_1,
+ make_row_tag< ::boost::mpl::placeholders::_2 , Composite> >
+ >::type internal_stt;
+
+ typedef typename ::boost::mpl::insert_range<
+ Stt,
+ typename ::boost::mpl::end<Stt>::type,
+ internal_stt
+ //typename get_internal_transition_table<Composite, ::boost::mpl::true_ >::type
+ >::type stt_plus_internal;
+
         // for every state, add its transition table (if any)
         // transformed as frow
- typedef typename ::boost::mpl::fold<state_list,Stt,
+ typedef typename ::boost::mpl::fold<state_list,stt_plus_internal,
                 ::boost::mpl::insert_range<
                         ::boost::mpl::placeholders::_1,
                         ::boost::mpl::end< ::boost::mpl::placeholders::_1>,
@@ -1197,12 +1333,12 @@
 
     deferred_events_queue_t& get_deferred_queue()
     {
- return m_deferred_events_queue;
+ return m_deferred_events_queue.m_deferred_events_queue;
     }
 
     const deferred_events_queue_t& get_deferred_queue() const
     {
- return m_deferred_events_queue;
+ return m_deferred_events_queue.m_deferred_events_queue;
     }
 
     // Getter that returns the current state of the FSM
@@ -1350,15 +1486,12 @@
     bool is_flag_active() const
     {
         flag_handler* flags_entries = get_entries_for_flag<Flag>();
-
- return std::accumulate(m_states,
- m_states+nr_regions::value,false,
- ::boost::bind(typename BinaryOp::type(),
- ::boost::bind(::boost::apply<bool>(),
- ::boost::bind(::boost::msm::back::deref<flag_handler>(),
- ::boost::bind(::boost::msm::back::plus2<flag_handler*,int>(),
- flags_entries, _2)),
- ::boost::cref(*this)), _1));
+ bool res = (*flags_entries[ m_states[0] ])(*this);
+ for (int i = 1; i < nr_regions::value ; ++i)
+ {
+ res = typename BinaryOp::type() (res,(*flags_entries[ m_states[i] ])(*this));
+ }
+ return res;
     }
     // checks if a flag is active using no binary op if 1 region, or OR if > 1 regions
     template <class Flag>
@@ -1710,6 +1843,35 @@
         bool handled;
     };
 
+ // helper class called in case the event to process has been found in the fsm's internal stt and is therefore processable
+ template<class Event>
+ struct process_fsm_internal_table
+ {
+ typedef typename ::boost::mpl::has_key<processable_events_internal_table,Event>::type is_event_processable;
+
+ // forward to the correct do_process
+ static void process(Event const& evt,library_sm* self_,HandledEnum& result)
+ {
+ do_process(evt,self_,result,is_event_processable());
+ }
+ private:
+ // the event is processable, let's try!
+ static void do_process(Event const& evt,library_sm* self_,HandledEnum& result, ::boost::mpl::true_)
+ {
+ if (result != HANDLED_TRUE)
+ {
+ typedef dispatch_table<library_sm,complete_table,Event,CompilePolicy> table;
+ HandledEnum res_internal = table::instance.entries[0](*self_, 0, self_->m_states[0], evt);
+ result = (HandledEnum)((int)result | (int)res_internal);
+ }
+ }
+ // version doing nothing if the event is not in the internal stt and we can save ourselves the time trying to process
+ static void do_process(Event const& ,library_sm* ,HandledEnum& , ::boost::mpl::false_)
+ {
+ // do nothing
+ }
+ };
+
     template <class StateType,class Enable=void>
     struct region_processing_helper
     {
@@ -1721,10 +1883,13 @@
         {
             // use this table as if it came directly from the user
             typedef dispatch_table<library_sm,complete_table,Event,CompilePolicy> table;
+ // +1 because index 0 is reserved for this fsm
             HandledEnum res =
- table::instance.entries[self->m_states[0]](
+ table::instance.entries[self->m_states[0]+1](
                 *self, 0, self->m_states[0], evt);
             result = (HandledEnum)((int)result | (int)res);
+ // process the event in the internal table of this fsm if the event is processable (present in the table)
+ process_fsm_internal_table<Event>::process(evt,self,result);
         }
         library_sm* self;
         HandledEnum& result;
@@ -1744,8 +1909,9 @@
             {
                 // use this table as if it came directly from the user
                 typedef dispatch_table<library_sm,complete_table,Event,CompilePolicy> table;
+ // +1 because index 0 is reserved for this fsm
                 HandledEnum res =
- table::instance.entries[self_->m_states[region_id::value]](
+ table::instance.entries[self_->m_states[region_id::value]+1](
                     *self_, region_id::value , self_->m_states[region_id::value], evt);
                 result_ = (HandledEnum)((int)result_ | (int)res);
                 In< ::boost::mpl::int_<region_id::value+1> >::process(evt,self_,result_);
@@ -1756,7 +1922,11 @@
         {
             // end of processing
             template<class Event>
- static void process(Event const& ,library_sm*,HandledEnum&){}
+ static void process(Event const& evt,library_sm* self_,HandledEnum& result_)
+ {
+ // process the event in the internal table of this fsm if the event is processable (present in the table)
+ process_fsm_internal_table<Event>::process(evt,self_,result_);
+ }
         };
         public:
         region_processing_helper(library_sm* self_,HandledEnum& result_)
@@ -1764,8 +1934,6 @@
         template<class Event>
         void process(Event const& evt)
         {
- // use this table as if it came directly from the user
- typedef dispatch_table<library_sm,complete_table,Event,CompilePolicy> table;
             In< ::boost::mpl::int_<0> >::process(evt,self,result);
         }
 
@@ -1803,7 +1971,9 @@
     template <class Event>
     void no_action(Event const&){}
 
- HandledEnum process_any_event( any_event const& evt) const;
+#ifndef BOOST_NO_RTTI
+ HandledEnum process_any_event( ::boost::any const& evt);
+#endif
 
 private:
     // composite accept implementation. First calls accept on the composite, then accept on all its active states.
@@ -2266,7 +2436,7 @@
              (static_cast<Derived*>(self))->on_entry(evt,fsm);
              int state_id = get_state_id<stt,typename EventType::active_state::wrapped_entry>::value;
              BOOST_STATIC_ASSERT(find_region_id<typename EventType::active_state::wrapped_entry>::region_index >= 0);
- BOOST_STATIC_ASSERT(find_region_id<typename EventType::active_state::wrapped_entry>::region_index <= nr_regions::value);
+ BOOST_STATIC_ASSERT(find_region_id<typename EventType::active_state::wrapped_entry>::region_index < nr_regions::value);
              // just set the correct zone, the others will be default/history initialized
              self->m_states[find_region_id<typename EventType::active_state::wrapped_entry>::region_index] = state_id;
              self->internal_start(evt.m_event);
@@ -2323,7 +2493,7 @@
              {
                  int state_id = get_state_id<stt,typename StateType::wrapped_entry>::value;
                  BOOST_STATIC_ASSERT(find_region_id<typename StateType::wrapped_entry>::region_index >= 0);
- BOOST_STATIC_ASSERT(find_region_id<typename StateType::wrapped_entry>::region_index <= nr_regions::value);
+ BOOST_STATIC_ASSERT(find_region_id<typename StateType::wrapped_entry>::region_index < nr_regions::value);
                  helper_self->m_states[find_region_id<typename StateType::wrapped_entry>::region_index] = state_id;
              }
          private:
@@ -2398,6 +2568,14 @@
     {
         return HANDLED_FALSE;
     }
+ // no transition for event for internal transitions (not an error).
+ template <class Event>
+ static HandledEnum call_no_transition_internal(library_sm& , int , int , Event const& )
+ {
+ //// reject to give others a chance to handle
+ //return HANDLED_GUARD_REJECT;
+ return HANDLED_FALSE;
+ }
     // called for deferred events. Address set in the dispatch_table at init
     template <class Event>
     static HandledEnum defer_transition(library_sm& fsm, int , int , Event const& e)
@@ -2408,7 +2586,7 @@
     // called for completion events. Default address set in the dispatch_table at init
     // prevents no-transition detection for completion events
     template <class Event>
- static HandledEnum default_eventless_transition(library_sm& fsm, int, int , Event const&)
+ static HandledEnum default_eventless_transition(library_sm&, int, int , Event const&)
     {
         return HANDLED_FALSE;
     }

Modified: branches/release/boost/msm/front/completion_event.hpp
==============================================================================
--- branches/release/boost/msm/front/completion_event.hpp (original)
+++ branches/release/boost/msm/front/completion_event.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -16,6 +16,12 @@
 
     struct none
     {
+ // make every event convertible to none.
+ // to support standard-conform implementation of pseudo exits.
+ none(){}
+ template <class Event>
+ none(Event const&){}
+
         typedef int completion_event;
     };
 

Modified: branches/release/boost/msm/front/euml/common.hpp
==============================================================================
--- branches/release/boost/msm/front/euml/common.hpp (original)
+++ branches/release/boost/msm/front/euml/common.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -65,6 +65,7 @@
 
 BOOST_MPL_HAS_XXX_TRAIT_DEF(tag_type)
 BOOST_MPL_HAS_XXX_TRAIT_DEF(action_name)
+BOOST_MPL_HAS_XXX_TRAIT_DEF(not_intern_euml_state)
 
 namespace boost { namespace msm { namespace front { namespace euml
 {
@@ -158,6 +159,19 @@
>::type type;
 };
 
+// used to differentiate between different types of euml_state's
+template <class T,class Enable=void>
+struct get_state_name
+{
+ typedef T type;
+};
+
+template <class T>
+struct get_state_name<T,typename ::boost::enable_if<has_not_intern_euml_state<T> >::type>
+{
+ typedef typename T::In::type type;
+};
+
 template <class T>
 struct get_action_name
 {
@@ -225,15 +239,26 @@
     };
 };
 template <class STATE>
-struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, state_domain>
+struct euml_state_intern: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, state_domain>
 {
     typedef state_tag euml_tag_type;
     using proto::extends<typename proto::terminal<state_tag>::type, STATE, state_domain>::operator=;
     template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
 #ifdef BOOST_MSVC
- ,class Arg6
+ ,class Arg6
 #endif
->
+ >
+ struct In
+ {
+ typedef STATE type;
+ };
+};
+template <class STATE>
+struct euml_state: proto::extends<typename proto::terminal< boost::msm::state_tag>::type, STATE, state_domain>
+{
+ typedef state_tag euml_tag_type;
+ typedef int not_intern_euml_state;
+ using proto::extends<typename proto::terminal<state_tag>::type, STATE, state_domain>::operator=;
     struct In
     {
         typedef STATE type;
@@ -1334,6 +1359,37 @@
         (Param3()(evt,fsm,state)).process_event(ToProcessEvt());
     }
 };
+
+//version for process_(event_)
+template <>
+struct Process_ <GetEvent_<void>,void,void,void,void>
+ : euml_action<Process_<GetEvent_<void>, void, void, void, void > >
+{
+ template <class Event,class FSM,class STATE >
+ struct state_action_result
+ {
+ typedef void type;
+ };
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ struct transition_action_result
+ {
+ typedef void type;
+ };
+
+ typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
+
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& )const
+ {
+ fsm.process_event(evt);
+ }
+ template <class Event,class FSM,class STATE>
+ void operator()(Event const& evt,FSM& fsm,STATE& )const
+ {
+ fsm.process_event(evt);
+ }
+};
+
 struct process_tag {};
 struct Process_Helper: proto::extends< proto::terminal<process_tag>::type, Process_Helper, sm_domain>
 {
@@ -1351,6 +1407,177 @@
 };
 Process_Helper const process_ = Process_Helper();
 
+template <class Param1, class Param2, class Param3, class Param4>
+struct Reprocess_ : euml_action<Reprocess_<Param1, Param2, Param3, Param4> >
+{
+ template <class Event,class FSM,class STATE >
+ struct state_action_result
+ {
+ typedef void type;
+ };
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ struct transition_action_result
+ {
+ typedef void type;
+ };
+
+ typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
+
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
+ {
+ (Param1()(evt,fsm,src,tgt)).process_event(evt);
+ (Param2()(evt,fsm,src,tgt)).process_event(evt);
+ (Param3()(evt,fsm,src,tgt)).process_event(evt);
+ (Param4()(evt,fsm,src,tgt)).process_event(evt);
+ }
+ template <class Event,class FSM,class STATE>
+ void operator()(Event const& evt,FSM& fsm,STATE& state)const
+ {
+ (Param1()(evt,fsm,state)).process_event(evt);
+ (Param2()(evt,fsm,state)).process_event(evt);
+ (Param3()(evt,fsm,state)).process_event(evt);
+ (Param4()(evt,fsm,state)).process_event(evt);
+ }
+};
+template <>
+struct Reprocess_ <void,void,void,void>
+ : euml_action<Reprocess_<void, void, void, void > >
+{
+ template <class Event,class FSM,class STATE >
+ struct state_action_result
+ {
+ typedef void type;
+ };
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ struct transition_action_result
+ {
+ typedef void type;
+ };
+
+ typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
+
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ void operator()(EVT const& evt,FSM& fsm,SourceState& ,TargetState& )const
+ {
+ fsm.process_event(evt);
+ }
+ template <class Event,class FSM,class STATE>
+ void operator()(Event const& evt,FSM& fsm,STATE& )const
+ {
+ fsm.process_event(evt);
+ }
+};
+
+template <class Param1>
+struct Reprocess_ <Param1,void,void,void>
+ : euml_action<Reprocess_<Param1, void, void, void> >
+{
+ template <class Event,class FSM,class STATE >
+ struct state_action_result
+ {
+ typedef void type;
+ };
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ struct transition_action_result
+ {
+ typedef void type;
+ };
+
+ typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
+
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
+ {
+ (Param1()(evt,fsm,src,tgt)).process_event(evt);
+ }
+ template <class Event,class FSM,class STATE>
+ void operator()(Event const& evt,FSM& fsm,STATE& state)const
+ {
+ (Param1()(evt,fsm,state)).process_event(evt);
+ }
+};
+
+template <class Param1, class Param2>
+struct Reprocess_ <Param1,Param2,void,void>
+ : euml_action<Reprocess_<Param1, Param2, void, void> >
+{
+ template <class Event,class FSM,class STATE >
+ struct state_action_result
+ {
+ typedef void type;
+ };
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ struct transition_action_result
+ {
+ typedef void type;
+ };
+
+ typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
+
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
+ {
+ (Param1()(evt,fsm,src,tgt)).process_event(evt);
+ (Param2()(evt,fsm,src,tgt)).process_event(evt);
+ }
+ template <class Event,class FSM,class STATE>
+ void operator()(Event const& evt,FSM& fsm,STATE& state)const
+ {
+ (Param1()(evt,fsm,state)).process_event(evt);
+ (Param2()(evt,fsm,state)).process_event(evt);
+ }
+};
+
+template <class Param1, class Param2, class Param3>
+struct Reprocess_ <Param1,Param2,Param3,void>
+ : euml_action<Reprocess_<Param1, Param2, Param3, void> >
+{
+ template <class Event,class FSM,class STATE >
+ struct state_action_result
+ {
+ typedef void type;
+ };
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ struct transition_action_result
+ {
+ typedef void type;
+ };
+
+ typedef ::boost::mpl::set<state_action_tag,action_tag> tag_type;
+
+ template <class EVT,class FSM,class SourceState,class TargetState>
+ void operator()(EVT const& evt,FSM& fsm,SourceState& src,TargetState& tgt)const
+ {
+ (Param1()(evt,fsm,src,tgt)).process_event(evt);
+ (Param2()(evt,fsm,src,tgt)).process_event(evt);
+ (Param3()(evt,fsm,src,tgt)).process_event(evt);
+ }
+ template <class Event,class FSM,class STATE>
+ void operator()(Event const& evt,FSM& fsm,STATE& state)const
+ {
+ (Param1()(evt,fsm,state)).process_event(evt);
+ (Param2()(evt,fsm,state)).process_event(evt);
+ (Param3()(evt,fsm,state)).process_event(evt);
+ }
+};
+struct reprocess_tag {};
+struct Reprocess_Helper: proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, sm_domain>
+{
+ Reprocess_Helper(){}
+ using proto::extends< proto::terminal<reprocess_tag>::type, Reprocess_Helper, sm_domain>::operator=;
+ template <class Arg1,class Arg2,class Arg3,class Arg4,class Arg5
+#ifdef BOOST_MSVC
+ ,class Arg6
+#endif
+>
+ struct In
+ {
+ typedef Reprocess_<Arg1,Arg2,Arg3,Arg4> type;
+ };
+};
+Reprocess_Helper const reprocess_ = Reprocess_Helper();
+
 template <class ToProcessEvt,class Value,class Param1, class Param2, class Param3>
 struct Process2_ : euml_action<Process2_<ToProcessEvt,Value, Param1, Param2, Param3> >
 {

Modified: branches/release/boost/msm/front/euml/guard_grammar.hpp
==============================================================================
--- branches/release/boost/msm/front/euml/guard_grammar.hpp (original)
+++ branches/release/boost/msm/front/euml/guard_grammar.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -326,7 +326,7 @@
>,
         proto::when<
             proto::terminal<state_tag>,
- proto::_
+ get_state_name<proto::_>()
>,
         proto::when<
             proto::terminal<flag_tag>,

Modified: branches/release/boost/msm/front/euml/state_grammar.hpp
==============================================================================
--- branches/release/boost/msm/front/euml/state_grammar.hpp (original)
+++ branches/release/boost/msm/front/euml/state_grammar.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -49,7 +49,7 @@
          class Defer = ::boost::mpl::vector0<>,
          class BASE = ::boost::msm::front::default_base_state>
 struct func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
- euml_state<func_state<StateNameTag,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
+ euml_state_intern<func_state<StateNameTag,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
 {
     func_state(){}
     // grammar testing
@@ -84,7 +84,7 @@
          class Defer = ::boost::mpl::vector0<>,
          class BASE = default_base_state>
 struct entry_func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
- euml_state<entry_func_state<StateNameTag,ZoneIndex,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
+ euml_state_intern<entry_func_state<StateNameTag,ZoneIndex,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
 {
     entry_func_state(){}
     // grammar testing
@@ -124,7 +124,7 @@
          class BASE = default_base_state>
 struct explicit_entry_func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
                                     public ::boost::msm::front::explicit_entry<ZoneIndex>,
- euml_state<explicit_entry_func_state<StateNameTag,
+ euml_state_intern<explicit_entry_func_state<StateNameTag,
                                         ZoneIndex,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
 {
     explicit_entry_func_state(){}
@@ -160,7 +160,7 @@
          class Defer = ::boost::mpl::vector0<>,
          class BASE = default_base_state>
 struct exit_func_state : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
- euml_state<exit_func_state<StateNameTag,Event,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
+ euml_state_intern<exit_func_state<StateNameTag,Event,EntryFunctor,ExitFunctor,Attributes,Flags,Defer,BASE> >
 {
     exit_func_state(){}
     // grammar testing
@@ -537,7 +537,7 @@
>,
         proto::when<
             proto::terminal<state_tag>,
- proto::_
+ get_state_name<proto::_>()
>,
         proto::when<
             proto::terminal<flag_tag>,
@@ -853,7 +853,7 @@
          class OnExceptionFunctor = NoAction,
          class BASE = ::boost::msm::front::default_base_state>
 struct func_state_machine : public ::boost::msm::front::detail::state_base<BASE,Attributes>,
- euml_state<func_state_machine<StateNameTag,STT,Init,EntryFunctor,ExitFunctor,Attributes,Flags,
+ euml_state_intern<func_state_machine<StateNameTag,STT,Init,EntryFunctor,ExitFunctor,Attributes,Flags,
                                                         Defer,NoTransitionFunctor,OnExceptionFunctor,BASE> >
 {
     func_state_machine(){}

Modified: branches/release/boost/msm/front/euml/stt_grammar.hpp
==============================================================================
--- branches/release/boost/msm/front/euml/stt_grammar.hpp (original)
+++ branches/release/boost/msm/front/euml/stt_grammar.hpp 2011-10-09 09:16:10 EDT (Sun, 09 Oct 2011)
@@ -48,10 +48,12 @@
 };
 // explicit + fork + entry point + exit point grammar
 struct BuildEntry
- : proto::when<
+ : proto::or_<
+ proto::when<
                     proto::function<proto::terminal<proto::_>,proto::terminal<state_tag>,proto::terminal<state_tag> >,
- get_fct<proto::_child_c<0>,proto::_child_c<1>,proto::_child_c<2> >()
+ get_fct<proto::_child_c<0>,get_state_name<proto::_child_c<1>() >(),get_state_name<proto::_child_c<2>() >() >()
>
+ >
 {};
 
 // row grammar
@@ -59,7 +61,7 @@
    : proto::or_<
         proto::when<
                     proto::terminal<state_tag>,
- proto::_
+ get_state_name<proto::_>()
>,
         proto::when<
                       BuildEntry,
@@ -118,7 +120,7 @@
    : proto::or_<
         proto::when<
                     proto::terminal<state_tag>,
- proto::_
+ get_state_name<proto::_>()
>,
         proto::when<
                     BuildEntry,


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk