Boost logo

Boost Users :

Subject: Re: [Boost-users] [MSM] posting internal events
From: Cyril Ballagny (cyril.ballagny_at_[hidden])
Date: 2011-06-20 04:14:17


Many thanks, this is the answer I needed!

Cyril.

On 18/06/2011 11:06, Christophe Henry wrote:
>> I am a new user of the Boost MSM library and I was wondering how to post
>> internal events. It seems that only events can be sent from the back
>> end, am I wrong?
>
> Yes they can only be sent from the back-end but it it shouldn't be a
> problem. You can define a functor doing this
> (http://svn.boost.org/svn/boost/trunk/libs/msm/doc/HTML/ch03s03.html#d0e1298),
> for example:
>
> struct store_cd_info
> {
> template <class Fsm,class Evt,class SourceState,class TargetState>
> void operator()(Evt const&, Fsm& fsm, SourceState&,TargetState& )
> {
> fsm.process_event(play());
> }
> };
>
> The "Fsm" template parameter is the back-end.
> With eUML you also have a process_ function.
>
> Only the basic front-end really is too simple. Inside this front-end,
> you could static_cast to the back-end type but this would really not
> be a good solution, so I advise you to switch to the more powerful
> front-ends, or to at least mix and use a "Row" instead of the xxx_row
> versions for the transitions when you need to post another event (you
> can mix row types).
>
> HTH,
> Christophe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
>

-- 
**************************************
Dr. Cyril Ballagny
R&D Department
Softeam, ModelioSoft, France
http://www.softeam.com/
http://www.modeliosoft.com/
Tel. +33 130121675 (office)
**************************************

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