Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85820 - in branches/release/boost/msm: . back front front/detail front/euml mpl_graph
From: christophe.j.henry_at_[hidden]
Date: 2013-09-22 06:12:21


Author: chenry
Date: 2013-09-22 06:12:20 EDT (Sun, 22 Sep 2013)
New Revision: 85820
URL: http://svn.boost.org/trac/boost/changeset/85820

Log:
merged rev. 84642-85778

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 (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 (props changed)
   branches/release/boost/msm/back/favor_compile_time.hpp (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/event_traits.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 (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 (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 (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 (props changed)
   branches/release/boost/msm/front/euml/stl.hpp (props changed)
   branches/release/boost/msm/front/euml/stt_grammar.hpp (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 (contents, 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/metafunctions.hpp | 38 +++++++++++++++++++++++++++++++++++++-
   branches/release/boost/msm/back/state_machine.hpp | 13 ++++++++++---
   branches/release/boost/msm/front/states.hpp | 8 +++++---
   3 files changed, 52 insertions(+), 7 deletions(-)

Modified: branches/release/boost/msm/back/metafunctions.hpp
==============================================================================
--- branches/release/boost/msm/back/metafunctions.hpp Sun Sep 22 06:04:38 2013 (r85819)
+++ branches/release/boost/msm/back/metafunctions.hpp 2013-09-22 06:12:20 EDT (Sun, 22 Sep 2013) (r85820)
@@ -46,6 +46,8 @@
 #include <boost/type_traits/is_same.hpp>
 #include <boost/utility/enable_if.hpp>
 
+#include <boost/msm/row_tags.hpp>
+
 // mpl_graph graph implementation and depth first search
 #include <boost/msm/mpl_graph/incidence_list_graph.hpp>
 #include <boost/msm/mpl_graph/depth_first_search.hpp>
@@ -202,7 +204,6 @@
         States,
         typename ::boost::mpl::push_back< ::boost::mpl::vector0<>,States>::type >::type type;
 };
-
 // returns a mpl::int_ containing the size of a region. If the argument is not a sequence, returns 1
 template <class region>
 struct get_number_of_regions
@@ -935,6 +936,41 @@
     return false;
 }
 
+// transformation metafunction to end interrupt flags
+template <class Event>
+struct transform_to_end_interrupt
+{
+ typedef boost::msm::EndInterruptFlag<Event> type;
+};
+// transform a sequence of events into another one of EndInterruptFlag<Event>
+template <class Events>
+struct apply_end_interrupt_flag
+{
+ typedef typename
+ ::boost::mpl::transform<
+ Events,transform_to_end_interrupt< ::boost::mpl::placeholders::_1> >::type type;
+};
+// returns a mpl vector containing all end interrupt events if sequence, otherwise the same event
+template <class Event>
+struct get_interrupt_events
+{
+ typedef typename ::boost::mpl::eval_if<
+ ::boost::mpl::is_sequence<Event>,
+ boost::msm::back::apply_end_interrupt_flag<Event>,
+ boost::mpl::vector1<boost::msm::EndInterruptFlag<Event> > >::type type;
+};
+
+template <class Events>
+struct build_interrupt_state_flag_list
+{
+ typedef ::boost::mpl::vector<boost::msm::InterruptedFlag> first_part;
+ typedef typename ::boost::mpl::insert_range<
+ first_part,
+ typename ::boost::mpl::end< first_part >::type,
+ Events
+ >::type type;
+};
+
 } } }//boost::msm::back
 
 #endif // BOOST_MSM_BACK_METAFUNCTIONS_H

Modified: branches/release/boost/msm/back/state_machine.hpp
==============================================================================
--- branches/release/boost/msm/back/state_machine.hpp Sun Sep 22 06:04:38 2013 (r85819)
+++ branches/release/boost/msm/back/state_machine.hpp 2013-09-22 06:12:20 EDT (Sun, 22 Sep 2013) (r85820)
@@ -17,6 +17,8 @@
 #include <numeric>
 #include <utility>
 
+#include <boost/detail/no_exceptions_support.hpp>
+
 #include <boost/mpl/contains.hpp>
 #include <boost/mpl/deref.hpp>
 #include <boost/mpl/assert.hpp>
@@ -1732,15 +1734,20 @@
     template <class StateType,class EventType>
     HandledEnum do_process_helper(EventType const& evt, ::boost::mpl::false_ const &, bool is_direct_call)
     {
- try
+ // when compiling without exception support there is no formal parameter "e" in the catch handler.
+ // Declaring a local variable here does not hurt and will be "used" to make the code in the handler
+ // compilable although the code will never be executed.
+ std::exception e;
+ BOOST_TRY
         {
             return this->do_process_event(evt,is_direct_call);
         }
- catch (std::exception& e)
+ BOOST_CATCH (std::exception& e)
         {
             // give a chance to the concrete state machine to handle
             this->exception_caught(evt,*this,e);
- }
+ }
+ BOOST_CATCH_END
         return HANDLED_FALSE;
     }
     // handling of deferred events

Modified: branches/release/boost/msm/front/states.hpp
==============================================================================
--- branches/release/boost/msm/front/states.hpp Sun Sep 22 06:04:38 2013 (r85819)
+++ branches/release/boost/msm/front/states.hpp 2013-09-22 06:12:20 EDT (Sun, 22 Sep 2013) (r85820)
@@ -15,6 +15,7 @@
 #include <boost/mpl/vector.hpp>
 #include <boost/msm/front/common_states.hpp>
 #include <boost/msm/row_tags.hpp>
+#include <boost/msm/back/metafunctions.hpp>
 
 namespace boost { namespace msm { namespace front
 {
@@ -74,9 +75,10 @@
 {
     // tags
     typedef ::boost::mpl::vector0<> flag_list;
- typedef ::boost::mpl::vector<boost::msm::InterruptedFlag,
- boost::msm::EndInterruptFlag<EndInterruptEvent> >
- internal_flag_list;
+ typedef typename boost::msm::back::build_interrupt_state_flag_list<
+ typename boost::msm::back::get_interrupt_events<EndInterruptEvent>::type
+ >::type internal_flag_list;
+
     //default: no deferred events
     typedef ::boost::mpl::vector0<> deferred_events;
 };


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