Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.msm] BOOST_MSM_EUML_DECLARE_STATE_MACHINE with state base class
From: Stefan Näwe (stefan.naewe_at_[hidden])
Date: 2014-05-26 02:29:08


Am 25.05.2014 21:19, schrieb Christophe Henry:
>> [...]
>> But now I want to add the state base class to the
>> above invocation of BOOST_MSM_EUML_DECLARE_STATE_MACHINE to be
>> able to say :
>>
>> fsm.get_state_by_id(fsm.current_state()[0])->work()
>>
>> at any given time.
>>
>> BOOST_MSM_EUML_DECLARE_STATE_MACHINE((
>> trans_table,
>> init_ << Running,
>> no_action, // fsm_entry
>> no_action, // fsm_exit
>> attributes_ << one_attr << another_attr,
>> configure_ << no_configure_,
>> Log_No_Transition,
>> Log_Exception,
>> Worker),
>> MyFSM_fe)
>>
>> But this gives me a compile error:
>>
>> C2275: 'Worker' : illegal use of this type as an expression.
>>
>> Is there any way to achieve what I need ? Can I somehow
>> _NOT_ use the macro and create the same state machine (i.e. with
>> attributes!) ?
>>
>> Thanks for any help!
>>
>> Stefan
>
>
> Hi,
> I just tried it out. Worker is a type and we need an instance in
> BOOST_MSM_EUML_DECLARE_STATE_MACHINE, so it should be:
> ...
> Log_Exception,
> Worker()),
> MyFSM_fe)
>
>
> Unfortunately it would not compile because of the pure virtual. At the
> moment I'm afraid we have to live with the limitation of having a simple
> virtual work().

OK.

Meanwhile I thought about using an internal transition to achieve
what I need.

Thanks,
  Stefan

-- 
----------------------------------------------------------------
/dev/random says: Your email has been returned due to insufficient voltage.
python -c "print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')" 
GPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF

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