Boost logo

Boost Users :

Subject: [Boost-users] Boost statechart design question
From: sidharth shanbhag (sidharthshanbhag_at_[hidden])
Date: 2013-02-03 01:02:24


Hi,

I am designing an application using Boost statechart and needed some advice.

I have multiple objects of the same type/functionality, however they are
not related by an inheritance heirachy. The class types have a defined
initialization sequence which move from 1 state to another. A few of these
state initialization steps are the same eg. Resource X should be
initialized as the second step in the sequence. But X can be initialized
only once in the process.

I am looking at doing the following:
- Creating a statechart for every object, to manage its initialization.
- Each state machine will maintain the pointer of the class object it has
initialized.
- A map of object Name -> State Machine will be created to ensure every
object is initialized correctly.
- Represent resource X as a separate state, which after its initialization
will transition to the next state.

Is there a potentially better way to do this considering:
- There can be multiple objects of different class types
- New objects can be added during runtime.

Thanks,
Sid



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