Discussion:
[boost] Boost MSM attribute sharing problem
Denis Kotov via Boost
2017-06-25 16:08:05 UTC
Permalink
Hello everyone,

I have an issue with* Boost MSM*. Using *Boost MSM eUML* I have created a
state machine. Actually I created *HSM* (Hierarchical State Machine) or
Composite State Machine as second name. And I faced with issue: How to
share attributes between Parent State Machine and Sub-State Machines (or
Child State Machine) ??

I have not found an answer on this question ... Could anyone possibly help
me ?

*Thanks,*

*Best RegardsDenis Kotov*

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Christophe Henry via Boost
2017-06-28 16:15:50 UTC
Permalink
Post by Denis Kotov via Boost
Hello everyone,
I have an issue with* Boost MSM*.
Using *Boost MSM eUML* I have created a
state machine. Actually I created *HSM* (Hierarchical State Machine) or
Composite State Machine as second name.
And I faced with issue: How to
share attributes between Parent State Machine and Sub-State Machines
(or Child State Machine) ??
I have not found an answer on this question ...
Could anyone possibly help me ?
*Thanks,*
*Best RegardsDenis Kotov*
Hi Denis,

I think the best way is to have your attributes owned by the top-level
state machine, then passed to the composite as say, a pointer. The
top-level can call get_state, then set the attribute. For example, with
eUML, supposing you declared the attribute with
BOOST_MSM_EUML_DECLARE_ATTRIBUTE (or without for other front-ends):

get_state<Composite&>().get_attribute(some_attribute) = &top_attribute;

HTH,
Christophe

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...