boost.MSM: No member function 'process_any_event' declared
Hi Christophe,
In case a class is derived from the msm::back::state_machine class and used
with the favor_compile_time policy I get the following error:
*No member function 'process_any_event' declared*
Please consider the following code snippets to get more details:
*// MasterStateMachine.hpp*
struct Master_: mgp_state_machine_def
Hi Rafael,
Hi Christophe,
In case a class is derived from the msm::back::state_machine class and used with the favor_compile_time policy I get the following error:
*No member function 'process_any_event' declared*
Please consider the following code snippets to get more details:
*// MasterStateMachine.hpp*
struct Master_: mgp_state_machine_def
{ // ... } *class MasterStateMachine : public msm::back::state_machine
{ public: MasterStateMachine () { // some stufff };
}
*// MasterStateMachine.cpp* #include "MasterStateMachine.hpp" BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(MasterStateMachine)
Why does the compiler complains although the class MasterStateMachine inherits the "process_any_event" method from the *msm::back::state_machine
* back-end? The point of matter is the *BOOST_MSM_BACK_GENERATE_PROCESS_EVENT(MasterStateMachine)* macro. In case it is uncomment, everythin works fine, but unfortunately without the support of the favor_compile_time policy.
Either I misunderstood you or you got it wrong (more likely, the doc is not clear enough as this policy is little known). The point of this macro is simply to allow SUBMACHINES to be built in their own TU and you should not use it for the top-level fsm. IIUC, MasterStateMachine is your top-level fsm, right? Then you don't need the macro and you still get the favor_compile_time policy. Of course, you don't get any process_any_event, but you don't need it as it's only an implementation detail for submachines. You call process_event as usual. The policy will bring a little gain for compiling the top-level fsm, but the main gain is the possibility to build submachines in their own TU, which usually means faster compile (granted, I compile with -j12 or -j4 ;-) ). HTH, Christophe
Hi Christophe! I always thought, that the MACRO is also necessary for the top-level machine! Great news for me due to the fact that my singleton semantic for the top-level machine will work! Thx and bye:) Rafael -- View this message in context: http://boost.2283326.n4.nabble.com/boost-MSM-Compiler-error-No-member-functi... Sent from the Boost - Users mailing list archive at Nabble.com.
participants (2)
-
Christophe Henry
-
RaRi