|
Boost Users : |
Subject: Re: [Boost-users] [MSM] posting internal events
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2011-06-18 05:06:26
> 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 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