[statechart] Access to asynchronous_state_machine
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
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
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
participants (1)
-
Bill Clark