Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74046 - trunk/boost/msm/back
From: christophe.j.henry_at_[hidden]
Date: 2011-08-24 16:42:20


Author: chenry
Date: 2011-08-24 16:42:19 EDT (Wed, 24 Aug 2011)
New Revision: 74046
URL: http://svn.boost.org/trac/boost/changeset/74046

Log:
fixed bug created by rev. 73289
Text files modified:
   trunk/boost/msm/back/metafunctions.hpp | 2 +-
   trunk/boost/msm/back/state_machine.hpp | 20 +++++++++++++++++---
   2 files changed, 18 insertions(+), 4 deletions(-)

Modified: trunk/boost/msm/back/metafunctions.hpp
==============================================================================
--- trunk/boost/msm/back/metafunctions.hpp (original)
+++ trunk/boost/msm/back/metafunctions.hpp 2011-08-24 16:42:19 EDT (Wed, 24 Aug 2011)
@@ -467,7 +467,7 @@
     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<mpl::placeholders::_1>,
+ ::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;

Modified: trunk/boost/msm/back/state_machine.hpp
==============================================================================
--- trunk/boost/msm/back/state_machine.hpp (original)
+++ trunk/boost/msm/back/state_machine.hpp 2011-08-24 16:42:19 EDT (Wed, 24 Aug 2011)
@@ -1002,18 +1002,32 @@
         // 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
- // 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 istt_simulated;
+ typedef typename StateType::internal_transition_table istt_simulated;
+
+ // table made of a stt + internal transitions of composite
         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;
 
+ // 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<
+ 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>,
+ add_forwarding_row_helper<table_with_all_events,intermediate,StateType>,
                 ::boost::mpl::identity<intermediate>
>::type type;
     };


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