Boost logo

Boost Users :

From: Andreas Huber (ahd6974-spamgroupstrap_at_[hidden])
Date: 2006-02-21 17:36:45


David Greene wrote:
> Moreover, how do I actually extract information from the state
> machine? Since fifo_scheduler<>::processor_handle is a
> weak_ptr<> I can't use it to query the state of the machine or
> extract any machine-specific information (such as elapsed time
> in the StopWatch example, if it were asynchronous).

The fact that it's a weak_ptr is an implementation detail. You don't
need to know that as a user.
Besides creation and destruction of FSMs, the fifo_scheduler interface
only allows you to send events. So, the only means of data exchange is
through callbacks and events (as outlined in the other post). It is not
possible to access the state_machine subclass objects directly because
that would mean accessing data shared between threads. This in turn
would mean that every state_machine member function needs to be
protected by mutexes, which is a recipe for disaster, in my experience.

HTH & Regards,

-- 
Andreas Huber
When replying by private email, please remove the words spam and trap
from the address shown in the header. 

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