[MSM] Surprising Entry Point behaviour
Hi Christophe -
I'm seeing some surprising behaviour when I have a sub-machine that can
only be entered via an entry point. I have attached a diagram for quick
reference. Code is below to demonstrate the "issue".
Moving into the Sub state should only generate transitions into A with a
'none' event. The only way to get to B is via a transition from A with
the 'event' event.
MSM is trying to generate code into B for a transition with a 'none'
event. This could be valid if the transition from Top::X wasn't via the
entry point and just directly to Sub. I don't think there is a path to B
with a 'none' event.
Thoughts?
Take care -
michael
----------------
#include
Hi Michael,
MSM is trying to generate code into B for a transition with a 'none' event. This could be valid if the transition from Top::X wasn't via the entry point and just directly to Sub. I don't think there is a path to B with a 'none' event.
Your guess is correct. The problem is that I'm forced to use a mpl::for_each when using an anonymous event within a submachine. You will find the call to mpl::for_each in the compiler stack trace. Though not all events have a transition with none, MSM is forced to generate a possibility for it. Normally it is not a problem, unless you add your own on_entry replacing the default one. Having both versions will make the compiler happy and the template version will not be called. I think I'll want to revisit this implementation in a future C++14 rewrite. Regards, Christophe
participants (2)
-
christophe.j.henry@gmail.com
-
Michael Caisse