Boost logo

Boost Users :

Subject: Re: [Boost-users] [statechart] history not saved
From: Andreas Huber (ahd6974-spamboostorgtrap_at_[hidden])
Date: 2012-11-11 07:39:21


> In fact I did not missed this part of tutorial. But since documentation is

> almost non-existent in area of history types description,

Boost.Statechart implements the state machine semantics defined by the UML
standard, which is mentioned in the documentation. I hope you understand that
describing how FSM history works is therefore beyond the scope of the
documentation.

> As for me, most logical behavior should be like this - if A uses deep

> history (I take it as 'total history for all substates'), A should have

> single default state for cases like this C -> B -> A.

IIUC, what you find most logical is contrary to what UML defines. Moreover, in
practice it does happen that you need different default states for different
transitions to history.

> But for cases

> A -> B -> A in B -> A transition user should use outermost state A in

> transition destination and do not care about how history is saved inside

> it or about its default state.

As I've mentioned before, you *can* have exactly what you describe here. In
your code, please replace the line

return transit< sc::deep_history < StateA1 > >();

with

return transit < StateA >();

and you should see exactly the same behavior.

This works because StateA specifies sc::deep_history < StateA1 > as its inner
initial state.

Regards,

Andreas


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net