Re: [Boost-users] Boost-users Digest, Vol 2613, Issue 3
On Mon, Jan 24, 2011 at 18:00,
Date: Mon, 24 Jan 2011 17:48:14 +0200 From: Igor R
To: boost-users@lists.boost.org Subject: Re: [Boost-users] [statechart] (custom) state queries for asynchronous state machine Message-ID: 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
participants (1)
-
Loek Cleophas