Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-03-15 12:34:39


"Alexander Nasonov" wrote:

> However, FSMs are quite often used to describe class behavior but
> most of the time those classes are implemented without any fsm library.
> People just look at the diagram, then define a couple of bool members
> or 'int m_state;' and then they check restrictions imposed by fsm in
> every function drawn on the diagram (events are usually function calls).
>
> Typical example of such class is POAManager (CORBA). It has active,
> holding, discarding, inactive, start and end states and there are
> create_POA, activate, discard_requests, hold_requests, deactivate and
> destroy functions.
>
> I'd be happy to see a library in boost that can elegantly solve
> problems of such classes. Common problems are
>
> 1. Class invariants depend on state. This usually means that they lose
> simplicity and effectiveness.
> 2. Some class members are valid only in certain states. (Andreas has
> proved that state local storage is useful thing)
> 3. Because of 1 and 2, it's harder to maintan even basic exception
> safety.
>
Regardless of current review: do you have something in mind?
How would API of such FSM look like?

/Pavel


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