Boost logo

Boost :

From: David Cattarin (ditto_at_[hidden])
Date: 2002-09-06 15:20:45


Hi Andreas,

Andreas Huber wrote:

>Dave,
>
>
>
>>In my state machine framework, the majority of classes are stateless.
>>The only classes that do have state are the "iterator" that I use for
>>traversing the state machine and a special context object for holding
>>"user" state variables.
>>
>>
>
>I'd like to understand better how your approach works, therefore the
>following questions:
>- Given I'd implement a very simple statemachine (e.g. the stop watch
>implemented in the example of my proposal, see comment in FSM.cpp), where
>would I put the needed data (elapsedTime_ and startTime_)?
>

They would be properties in the Context object. Note that this Context
object is shared amonst state machines for a given "call." I should
point out that I have a higher-level class that manages state machines.
This manager handles context allocation, event distribution, etc.

Also, since I allow Actions to be used by many states (and state
machines) I normally recommend that Action objects not have data
members. That's one of the reasons why there is a Context object.

>- Is it possible to "scope" the data appropriately?
>

Can you clarify what you mean by scope?

Dave


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk