Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52600 - sandbox/msm/boost/msm
From: christophe.j.henry_at_[hidden]
Date: 2009-04-26 08:26:01


Author: chenry
Date: 2009-04-26 08:26:00 EDT (Sun, 26 Apr 2009)
New Revision: 52600
URL: http://svn.boost.org/trac/boost/changeset/52600

Log:
bugfix
Text files modified:
   sandbox/msm/boost/msm/state_machine.hpp | 14 +++++++-------
   1 files changed, 7 insertions(+), 7 deletions(-)

Modified: sandbox/msm/boost/msm/state_machine.hpp
==============================================================================
--- sandbox/msm/boost/msm/state_machine.hpp (original)
+++ sandbox/msm/boost/msm/state_machine.hpp 2009-04-26 08:26:00 EDT (Sun, 26 Apr 2009)
@@ -979,10 +979,10 @@
         // State is a sub fsm with exit pseudo states and gets a pointer to this fsm, so it can build a callback
         template <class StateType>
         typename ::boost::enable_if<
- typename has_exit_pseudo_states<StateType>::type,BaseState* >::type
+ typename has_exit_pseudo_states<StateType>::type,pBaseState >::type
         new_state_helper(boost::msm::dummy<0> = 0) const
         {
- return new StateType(containing_sm);
+ return pBaseState(new StateType(containing_sm));
         }
         // State is a sub fsm without exit pseudo states and does not get a callback to this fsm
                 // or state is a normal state and needs nothing except creation
@@ -992,22 +992,22 @@
                                                     <typename has_exit_pseudo_states<StateType>::type>::type,
                                       typename boost::mpl::not_
                                                     <typename is_pseudo_exit<StateType>::type>::type
- >::type,BaseState*>::type
+ >::type,pBaseState>::type
         new_state_helper( ::boost::msm::dummy<1> = 0) const
         {
- return new StateType;
+ return pBaseState(new StateType);
         }
         // state is exit pseudo state and gets callback to target fsm
         template <class StateType>
- typename ::boost::enable_if<typename is_pseudo_exit<StateType>::type,BaseState* >::type
+ typename ::boost::enable_if<typename is_pseudo_exit<StateType>::type,pBaseState >::type
         new_state_helper( ::boost::msm::dummy<2> = 0) const
         {
- BaseState* to_return = new StateType();
+ pBaseState to_return (new StateType());
             execute_return (ContainingSM::*pf) (typename StateType::event const& evt)=
                 &ContainingSM::process_event;
             ::boost::function<execute_return (typename StateType::event const&)> fct =
                 ::boost::bind(pf,containing_sm,_1);
- static_cast<StateType*>(to_return)->set_forward_fct(fct);
+ static_cast<StateType*>(to_return.get())->set_forward_fct(fct);
             return to_return;
         }
         // for every defined state in the sm


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