rad 6.2.0
|
#include <StateMachine.h>
Public Member Functions | |
StateMachine () | |
virtual | ~StateMachine () |
const std::string & | getId () const |
std::list< Transition * > & | getInitialTrans () |
std::list< State * > & | getSubstates () |
std::list< State * > & | getParallel () |
void | setId (const std::string &id) |
void | setInitialState (State *initialState, Action *a) |
void | setFinalState (State *finalState) |
void | setSubstates (std::list< State * > &substates) |
void | setParallel (std::list< State * > ¶llel) |
void | addSubstate (State *s) |
void | addParallel (State *s) |
void | reset () |
bool | isEmpty () |
This class represents an in-memory SCXML State Machine document. Its methods allow to add states (of any type) and create initial transitions.
The client is responsible to allocate the memory for the states to be added. The memory is released by the StateMachine destructor or by calling the reset() method.
An SCXML parser can be used to read an SCXML document from file, allocate the states and transition and add them to a StateMachine object. An SCXML interpreter can be used to execute the State Machine object.
scxml4cpp::StateMachine::StateMachine | ( | ) |
Default constructor.
|
virtual |
This destructor releases the memory allocated for:
void scxml4cpp::StateMachine::addParallel | ( | State * | s | ) |
void scxml4cpp::StateMachine::addSubstate | ( | State * | s | ) |
const std::string & scxml4cpp::StateMachine::getId | ( | ) | const |
std::list< Transition * > & scxml4cpp::StateMachine::getInitialTrans | ( | ) |
std::list< State * > & scxml4cpp::StateMachine::getParallel | ( | ) |
std::list< State * > & scxml4cpp::StateMachine::getSubstates | ( | ) |
bool scxml4cpp::StateMachine::isEmpty | ( | ) |
void scxml4cpp::StateMachine::reset | ( | ) |
This method releases the memory allocated for:
void scxml4cpp::StateMachine::setFinalState | ( | State * | finalState | ) |
void scxml4cpp::StateMachine::setId | ( | const std::string & | id | ) |
This method creates an initial transition which is evaluated when starting the execution of the StateMachine. This method allocates the memory required to create a Transition.
void scxml4cpp::StateMachine::setParallel | ( | std::list< State * > & | parallel | ) |
void scxml4cpp::StateMachine::setSubstates | ( | std::list< State * > & | substates | ) |