Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72803 - trunk/boost/msm/front/euml
From: christophe.j.henry_at_[hidden]
Date: 2011-06-29 15:42:12


Author: chenry
Date: 2011-06-29 15:42:11 EDT (Wed, 29 Jun 2011)
New Revision: 72803
URL: http://svn.boost.org/trac/boost/changeset/72803

Log:
fixed bug with eUML and psudo exits
Text files modified:
   trunk/boost/msm/front/euml/common.hpp | 31 ++++++++++++++++++++++++++++---
   trunk/boost/msm/front/euml/guard_grammar.hpp | 2 +-
   trunk/boost/msm/front/euml/state_grammar.hpp | 12 ++++++------
   trunk/boost/msm/front/euml/stt_grammar.hpp | 10 ++++++----
   4 files changed, 41 insertions(+), 14 deletions(-)

Modified: trunk/boost/msm/front/euml/common.hpp
==============================================================================
--- trunk/boost/msm/front/euml/common.hpp (original)
+++ trunk/boost/msm/front/euml/common.hpp 2011-06-29 15:42:11 EDT (Wed, 29 Jun 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;

Modified: trunk/boost/msm/front/euml/guard_grammar.hpp
==============================================================================
--- trunk/boost/msm/front/euml/guard_grammar.hpp (original)
+++ trunk/boost/msm/front/euml/guard_grammar.hpp 2011-06-29 15:42:11 EDT (Wed, 29 Jun 2011)
@@ -326,7 +326,7 @@
>,
         proto::when<
             proto::terminal<state_tag>,
- proto::_
+ get_state_name<proto::_>()
>,
         proto::when<
             proto::terminal<flag_tag>,

Modified: trunk/boost/msm/front/euml/state_grammar.hpp
==============================================================================
--- trunk/boost/msm/front/euml/state_grammar.hpp (original)
+++ trunk/boost/msm/front/euml/state_grammar.hpp 2011-06-29 15:42:11 EDT (Wed, 29 Jun 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: trunk/boost/msm/front/euml/stt_grammar.hpp
==============================================================================
--- trunk/boost/msm/front/euml/stt_grammar.hpp (original)
+++ trunk/boost/msm/front/euml/stt_grammar.hpp 2011-06-29 15:42:11 EDT (Wed, 29 Jun 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