Boost logo

Boost Users :

Subject: Re: [Boost-users] [1.44 MSM meta state machine] accessing objects fromactions
From: Christophe Henry (christophe.j.henry_at_[hidden])
Date: 2010-11-01 06:37:16


Sorry for answering so late, hard week ;-)

2010/10/26 Hajo Kirchhoff <mailinglists_at_[hidden]>:
> 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.

Actually it's not as neat as I would like so I'll come back to this in future.
The best would be some variadic list of super state machines.

>> 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.

Apart from actions, what other "howto" would you like to see? I'm very
interested in making the doc better.

Regards,
Christophe


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