Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75859 - trunk/boost/msm/back
From: christophe.j.henry_at_[hidden]
Date: 2011-12-07 17:01:04


Author: chenry
Date: 2011-12-07 17:01:03 EST (Wed, 07 Dec 2011)
New Revision: 75859
URL: http://svn.boost.org/trac/boost/changeset/75859

Log:
bugfix (start() does not set the current state(s) back to initial states)
Text files modified:
   trunk/boost/msm/back/state_machine.hpp | 6 ++++++
   1 files changed, 6 insertions(+), 0 deletions(-)

Modified: trunk/boost/msm/back/state_machine.hpp
==============================================================================
--- trunk/boost/msm/back/state_machine.hpp (original)
+++ trunk/boost/msm/back/state_machine.hpp 2011-12-07 17:01:03 EST (Wed, 07 Dec 2011)
@@ -1191,6 +1191,9 @@
     // start the state machine (calls entry of the initial state)
     void start()
     {
+ // reinitialize our list of currently active states with the ones defined in Derived::initial_state
+ ::boost::mpl::for_each< seq_initial_states, ::boost::msm::wrap<mpl::placeholders::_1> >
+ (init_states(m_states));
         // call on_entry on this SM
         (static_cast<Derived*>(this))->on_entry(fsm_initial_event(),*this);
         ::boost::mpl::for_each<initial_states, boost::msm::wrap<mpl::placeholders::_1> >
@@ -1204,6 +1207,9 @@
     template <class Event>
     void start(Event const& incomingEvent)
     {
+ // reinitialize our list of currently active states with the ones defined in Derived::initial_state
+ ::boost::mpl::for_each< seq_initial_states, ::boost::msm::wrap<mpl::placeholders::_1> >
+ (init_states(m_states));
         // call on_entry on this SM
         (static_cast<Derived*>(this))->on_entry(incomingEvent,*this);
         ::boost::mpl::for_each<initial_states, boost::msm::wrap<mpl::placeholders::_1> >


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