|
Boost Users : |
Subject: Re: [Boost-users] [statechart] Access to asynchronous_state_machine
From: Bill Clark (bill_at_[hidden])
Date: 2009-07-13 16:09:54
Answered my own question - it's possible to pass arguments to the state
machine's constructor. I must have confused this with passing arguments to a
state's constructor.
Anyway, problem solved.
On Mon, Jul 13, 2009 at 11:52 AM, Bill Clark <bill_at_[hidden]>wrote:
> We're using an asynchronous state machine. You can't construct these
> directly; you have to create them indirectly using a scheduler. Is there any
> "official" way to get access to the state machine after it's constructed?
> Or, alternatively, is there a way to pass a parameter to its constructor?
>
> The scenario I have in mind is one where the client needs to supply the
> state machine with some information at run time, ideally immediately upon
> construction, but in any case before any reactions occur. So far I have not
> found an easy way for the client to get access to the state machine itself.
> I can work around this by assuming that the state machine is a singleton,
> and setting a publicly visible static instance pointer. But this is far from
> ideal. Is there a better way?
>
> Thanks,
> Bill
>
>
>
>
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