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
#include
#include
using boost::msm::front::none;
using boost::msm::front::Row;
namespace msm = boost::msm;
struct event
{
int foo;
};
struct Sub_ : public msm::front::state_machine_def
{
struct Enter : public msm::front::entry_pseudo_state<0>
{};
struct A : msm::front::state<>
{};
struct B : msm::front::state<>
{
template<class FSM>
void on_entry(event const & evt, FSM &)
{}
};
using initial_state = A;
struct transition_table : boost::mpl::vector<
// Start Event Next Action Guard
// +----------+---------+--------+-----------+--------
Row < Enter , none , A , none , none >,
Row < A , event , B , none , none >,
Row < B , none , A , none , none >
// +----------+---------+--------+-----------+--------
>{};
};
using Sub = msm::back::state_machine;
struct Top_ : public msm::front::state_machine_def
{
struct X : msm::front::state<>
{};
using initial_state = X;
struct transition_table : boost::mpl::vector<
// S Event Next Action Guard
// +----+-------+-----------------------------+-------+-------
Row < X , none , Sub::entry_pt , none , none >
// +----+-------+-----------------------------+-------+-------
>{};
};
using Top = boost::msm::back::state_machine;
int main()
{
Top top;
top.start();
}
-------------------------
--
Michael Caisse
Ciere Consulting
ciere.com