Boost logo

Boost Users :

Subject: Re: [Boost-users] Accessing MSM attribute under specific conditions causes non-compile
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2012-09-03 13:45:35


Hi Chiem,

>If you create an action, and inside that action you do a get_attribute on the state machine, and that state machine (MSM) is a

>sub-statemachine of another (parent) MSM, and that sub-machine state happens to be the initial state of the parent machine

>(that's a lot of ifs!), the code will not compile. It aborts with the mysterious error:

<snip>

>BOOST_MSM_EUML_ACTION(someAction)
>{
> template <class Event,class FSM,class STATE>
> void operator()(Event const& event,FSM& fsm, STATE&)
> {
> fsm.get_attribute(borrowedBuffer_attribute)=1;

> }
>};

Try:

BOOST_MSM_EUML_ACTION(someAction)
{
   template <class Event,class FSM,class STATE>
   void operator()(Event const& event,FSM& , STATE& state)
   {
      state.get_attribute(borrowedBuffer_attribute)=1;

   }
 };

MSM_A_player is a state machine, but used inside MSM_B_player, it is a substate, right? Therefore, in its entry, it is represented by the STATE parameter, not FSM.

HTH,

Christophe



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net