CHSM
4.4.1
|
A machine contains an entire Concurrent, Hierarchical, Finite State machine. More...
#include <chsm.h>
Classes | |
class | const_iterator |
This is an iterator in "STL style" to iterate over the (direct child) states a machine has. More... | |
Public Types | |
enum | { D_none, D_enex, D_event, D_alg, D_all } |
typedef value_type const * | const_pointer |
A pointer to a const value_type . More... | |
typedef value_type const & | const_reference |
A reference to a const value_type . More... | |
typedef state | value_type |
The type of the value returned by const_iterator. More... | |
Public Member Functions | |
bool | active () const |
A machine as a whole is active only if its root cluster is. More... | |
const_iterator | begin () const |
Returns a new const_iterator positioned at the first state in a machine. More... | |
unsigned | debug () const |
Gets the current debugging state. More... | |
unsigned | debug (unsigned state) |
Sets the debugging state. More... | |
void | dump_state () const |
Dumps a printout of the current state to standard error. More... | |
const_iterator | end () const |
Returns a new const_iterator positioned one past the last state in a machine. More... | |
virtual bool | enter (event const &trigger=prime_) |
Enter a machine via a transition by entering its root cluster. More... | |
virtual bool | exit (event const &trigger=prime_) |
Exit a machine via a transition by exiting its root cluster. More... | |
virtual | ~machine () |
Destroy a machine. More... | |
Protected Member Functions | |
machine (CHSM_MACHINE_ARGS) | |
Construct a machine. More... | |
A machine contains an entire Concurrent, Hierarchical, Finite State machine.
Every machine is self-contained: there may be multiple instances of the same machine (or different machines) in different states in the same program.
typedef value_type const* CHSM::machine::const_pointer |
A pointer to a const value_type
.
typedef value_type const& CHSM::machine::const_reference |
A reference to a const value_type
.
typedef state CHSM::machine::value_type |
The type of the value returned by const_iterator.
anonymous enum |
|
virtual |
Destroy a machine.
|
protected |
Construct a machine.
When deriving a class from machine, the macros CHSM_MACHINE_ARGS
and CHSM_MACHINE_INIT
can be used to avoid having to deal with the many constructor arguments, e.g.:
References exit().
|
inline |
A machine as a whole is active only if its root cluster is.
true
only if this machine is active. References CHSM::state::active().
|
inline |
Returns a new const_iterator positioned at the first state in a machine.
Referenced by dump_state().
|
inline |
Gets the current debugging state.
Referenced by CHSM::state::enter(), and CHSM::state::exit().
|
inline |
void CHSM::machine::dump_state | ( | ) | const |
Dumps a printout of the current state to standard error.
The dump consists of each state's name, one per line, preceded by an asterisk only if it is active; a space otherwise.
References CHSM::state::active(), begin(), end(), and CHSM::state::name().
|
inline |
Returns a new const_iterator positioned one past the last state in a machine.
Referenced by dump_state().
|
virtual |
Enter a machine via a transition by entering its root cluster.
trigger | The event to start the machine. |
true
only if the machine was actually entered, i.e., it wasn't already active. References CHSM::cluster::enter().
|
virtual |
Exit a machine via a transition by exiting its root cluster.
trigger | The event to exit the machine. |
true
only if the machine was actually exited, i.e., it wasn't already inactive. References CHSM::cluster::exit().
Referenced by machine().