Boost logo

Boost Users :

Subject: Re: [Boost-users] [1.44 MSM meta state machine] accessing objects fromactions
From: Hajo Kirchhoff (mailinglists_at_[hidden])
Date: 2010-10-26 07:37:42


Thanks Christophe,
>
>> How can I access the member variables of the parent of a substate
>> machine? Or is there a better way of accessing the objects the state
>> machine should work with from actions?
>
> With 1.44 (for example inside the on_entry method of Send_):
> Send_::Working& w = fsm.get_state<Send_::Working&>();
> w.data = &fsm.data; // w.data is a pointer
ah, passing the pointer in the on_entry method. That's a neat trick.

> Seems that I need to improve my doc here. It's too late for the 1.45
> but I'll do it for the 1.46.
That would be great. "How do I actually _do_ something with the state
machine" was a question that was always on my mind. Static/global
variables are absolutely out of the question.

> list is still pretty long so I hope this solution will be ok for the
> time being.
Yes, certainly. It also addresses the question of how a substate machine
can remain reusable.

Many thanks

Hajo


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