Boost logo

Boost :

Subject: Re: [boost] [msm]omitting region id at the entry pseudo state
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2012-03-04 16:25:27


Hi Takatoshi,

> Hello,
>
> Now, I'm using Boost.Msm (Version1.49.0).
> I have a question about a transition behavior when I omit a region id
> at the entry pseudo state.
>
> The document said that when we use the explicit entry, if the state
> machine satisfied the conditions below, we can omit the region id.
> http://www.boost.org/doc/libs/1_49_0/libs/msm/doc/HTML/ch03s02.html#d0e852
> " Thanks to the mpl_graph library you can also omit to provide the
> region index and let MSM find out for you. The are however two points
> to note:
> - MSM can only find out the region index if the explicit entry state
> is somehow connected to an initial state through a transition, no
> matter the direction.
> - There is a compile-time cost for this feature. "
>
> Because of the discussion below, I believe that this rule can also be
> applied to entry pseudo states.
> http://boost.2283326.n4.nabble.com/msm-how-to-distinguish-region-ids-tt3612968.html#a3622072

It does, I just forgot to mention it in the doc.

> However, when I omitted the region id, the state machine transitioned
> to the SubState1.
> struct Entry1:msmf::entry_pseudo_state<> {};
>
> If I provided the region id, the state machine transitioned to the
> SubState2.
> struct Entry1:msmf::entry_pseudo_state<0> {};
>
> See entry_pt_omit_rid.cpp (Attached file)
>
> As far as I can understand, Entry1 and SubState1, initial_state, are
> connected. (See fig.png)
>
> Is there any reason that I can't omit the region id in this case?

Looks like a bug. It's a bit late to fix it tonight, but if I change your
initial state declaration to:

typedef mpl::vector<SubState1> initial_state;

Then it works. Must be some silly mistake and not too hard to fix, but you
can use the workaround in the meantime.

Cheers,
Christophe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk