[MSM] "favor_compile_time" policy disables "kleene" events. (Bug?)
Hi everyone, Hi Christophe, While trying to speedup compilation of my MSM/eUML-based state machine, I seem to have found a bug. I added the "favor_compile_time" policy to the type-definition of my state-machine as the documentation suggests. I did not use the macro "BOOST_MSM_BACK_GENERATE_PROCESS_EVENT" because I do not have any sub-statemachines. This did speed up compilation, however obviously by changing my transition-table: All "kleene"-events in my transition-table are ignored, when defining the state-machine with the "favor_compile_time" policy. Can anyone confirm this or am I using it wrong? (Was this policy supposed to work with eUML in the first place?) Thanks, Deniz PS: I am using GCC 4.7.2 with Boost 1.53.
Hi everyone, Hi Christophe,
While trying to speedup compilation of my MSM/eUML-based state machine, I seem to have found a bug.
I added the "favor_compile_time" policy to the type-definition of my state-machine as the documentation suggests. I did not use the macro "BOOST_MSM_BACK_GENERATE_PROCESS_EVENT" because I do not have any sub-statemachines.
This did speed up compilation, however obviously by changing my transition-table: All "kleene"-events in my transition-table are ignored, when defining the state-machine with the "favor_compile_time" policy.
Can anyone confirm this or am I using it wrong? (Was this policy supposed to work with eUML in the first place?)
Thanks, Deniz
PS: I am using GCC 4.7.2 with Boost 1.53.
Hi Deniz, my mistake, I forgot to add this limitation in the doc. The favor_compile_time_policy loses not only event hierarchies but also kleene events. I don't think there is a way to achieve this with the current implementation. Sorry about this, Christophe
Hi Christophe,
my mistake, I forgot to add this limitation in the doc. The favor_compile_time_policy loses not only event hierarchies but also kleene events. I don't think there is a way to achieve this with the current implementation.
That's too bad. So I probably have to compile less frequently, to cope with the longer compile-times. :-) Thanks for clarification, Deniz
Hi Christophe,
my mistake, I forgot to add this limitation in the doc. The favor_compile_time_policy loses not only event hierarchies but also kleene events. I don't think there is a way to achieve this with the current implementation.
That's too bad. So I probably have to compile less frequently, to cope with the longer compile-times. :-)
Thanks for clarification, Deniz
Hi Deniz, it turns out my answer was incorrect, or at least incomplete. If you have no submachine, then there might be a way around. If you write: p.process_event(pause); where pause is an eUML event, true, it cannot work. However, this works: any_number_event evpause(pause); p.process_event(evpause); I don't know if it helps you, it might not fit your use case. It doesn't work for submachines at the moment, but as I'm at it, I'll have a look ;-) OTOH, if compile-time is a problem, mybe the full eUML is not the right solution for you, you might want to try writing only the table with eUML, it compiles already faster, or use the functor front-end, which compiles much faster. HTH, Christophe
it turns out my answer was incorrect, or at least incomplete. If you have no submachine, then there might be a way around. If you write: p.process_event(pause); where pause is an eUML event, true, it cannot work. However, this works: any_number_event evpause(pause); p.process_event(evpause);
I forgot to add the definition of any:number_event as it was in another
thread:
BOOST_TYPE_ERASURE_MEMBER((has_getNumber), getNumber, 0);
//type erasure event
typedef ::boost::mpl::vector<
has_getNumber
any_number_event_concept; struct any_number_event : boost::type_erasure::any
, msm::front::euml::euml_event { template <class U> any_number_event(U const& u): boost::type_erasure::any (u){} any_number_event(): boost::type_erasure::any (){} };
Used like this: namespace boost { namespace msm{ template<> struct is_kleene_event< any_number_event > { typedef boost::mpl::true_ type; }; }} any_number_event number_event; stt: Playing + number_event / pause_playback == Paused
How exactly does use eUML for the MSM transition table and not anything else? -- View this message in context: http://boost.2283326.n4.nabble.com/MSM-favor-compile-time-policy-disables-kl... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (3)
-
Christophe Henry
-
Deniz Bahadir
-
illonexxx