Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost-users Digest, Vol 2613, Issue 3
From: Loek Cleophas (boost_at_[hidden])
Date: 2011-01-25 01:37:15


On Mon, Jan 24, 2011 at 18:00, <boost-users-request_at_[hidden]> wrote:

> Date: Mon, 24 Jan 2011 17:48:14 +0200
> From: Igor R <boost.lists_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [statechart] (custom) state queries for
> asynchronous state machine
> Message-ID:
> <AANLkTim_eYbue02=dOA=0ouAi7wWDTaV9KWW0TXZ+Aum_at_[hidden]<0ouAi7wWDTaV9KWW0TXZ%2BAum_at_[hidden]>
> >
> Content-Type: text/plain; charset=UTF-8
>
> > However, for the asynchronous case, access to the state machine is via a
> > scheduler only - and I don't see how to get the information from there
> nor
> > is there any documentation on that in the tutorial. Any hints on how to
> do
> > this?
>
> With async. state machine such a direct access wouldn't be thread
> safe. So the only way you can retrieve its state is by means of
> events. I.e. you can enqueue an event, which contains some facility
> for the response - like a ptr to a message queue or a slot for
> boost.signals2 and so on. When processing this event, the machine
> performs the query you want and returns you the answer through the
> facility you provided.
>

Hi Igor,

of course, that makes sense. I don't know why I didn't think of using a
callback - but will try that now.

Thanks for your prompt response, it's much appreciated!

Loek



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