rad 6.2.0
|
#include <State.h>
Public Types | |
enum | StateType { Atomic = 0 , Compound , Parallel , History } |
Public Member Functions | |
State (const std::string &id, const StateType type) | |
virtual | ~State () |
std::string | getId () const |
StateType | getType () const |
State * | getParent () |
StateHistory * | getHistory () |
ExecutableContent * | getEntryActions () |
ExecutableContent * | getExitActions () |
std::list< Transition * > & | getInitialTrans () |
State * | getInitialState () |
std::list< State * > & | getSubstates () |
std::list< Transition * > & | getTransitions () |
std::list< Activity * > & | getActivities () |
void | setId (const std::string &id) |
void | setType (const StateType type) |
void | setParent (State *parent) |
void | setIsInitial (const bool isInitial) |
void | setIsFinal (const bool isFinal) |
void | setHistory (StateHistory *h) |
void | setInitialState (State *initialState, Action *a) |
void | setFinalState (State *finalState) |
void | setSubstates (std::list< State * > &substates) |
void | setTransitions (std::list< Transition * > &transitions) |
void | setActivities (std::list< Activity * > &activities) |
bool | isInitial () |
bool | isFinal () |
bool | isCompound () |
bool | isParallel () |
bool | isAtomic () |
bool | isHistory () |
void | startActivities (Context *c) |
void | cancelActivities (Context *c) |
void | addEntryAction (Action *a) |
void | addExitAction (Action *a) |
void | addSubstate (State *s) |
void | addTransition (std::list< State * > &targets, const Event &event, Action *condition, Action *action) |
void | addTransition (State *target, const Event &event, Action *condition, Action *action) |
void | addActivity (Activity *activity) |
void | delTransitions () |
void | delInitialTrans () |
void | delSubstates () |
This class is the base class for the different types of SCXML states:
scxml4cpp::State::State | ( | const std::string & | id, |
const StateType | type ) |
Constructor for the State object. It allocates memory for:
|
virtual |
Destructor for the State object. It releases the memory for:
void scxml4cpp::State::addActivity | ( | Activity * | activity | ) |
Add a do-activity to the list of activities to be started when entering this state and stopped when exiting this state.
activity | Activity to be added. |
void scxml4cpp::State::addEntryAction | ( | Action * | a | ) |
Add an entry action to what has to be executed (ExecutableContent) when entering this state.
a | Entry action to be added. |
void scxml4cpp::State::addExitAction | ( | Action * | a | ) |
Add an exit action to what has to be executed (ExecutableContent) when exiting this state.
a | Exit action to be added. |
void scxml4cpp::State::addTransition | ( | State * | target, |
const Event & | event, | ||
Action * | condition, | ||
Action * | action ) |
Add a transition that has this state as source. This method allocates memory which is released by the destructor/delTransitions() methods.
targets | Target state of the transition. If the pointer is NULL the transition is considered as internal transition (i.e. a transition that does not trigger any change of state). |
event | Event triggering the transition. The event can be a NULL event, in this case the transition it taken immediately after entering the state assuming the condition (guard) is satisfied. |
condition | Optional guard to be satisfied for the transition to be taken. By passing NULL, no condition is evaluated. |
action | Optional action to be executed when the transition is taken. By passing NULL, no action is evaluated. |
void scxml4cpp::State::addTransition | ( | std::list< State * > & | targets, |
const Event & | event, | ||
Action * | condition, | ||
Action * | action ) |
Add a transition that has this state as source. This method allocates memory which is released by the destructor/delTransitions() methods.
targets | One or more target state of the transition. If the list is empty the transition is considered as internal transition (i.e. a transition that does not trigger any change of state). |
event | Event triggering the transition. The event can be a NULL event, in this case the transition it taken immediately after entering the state assuming the condition (guard) is satisfied. |
condition | Optional guard to be satisfied for the transition to be taken. By passing NULL, no condition is evaluated. |
action | Optional action to be executed when the transition is taken. By passing NULL, no action is evaluated. |
void scxml4cpp::State::cancelActivities | ( | Context * | c | ) |
Terminates the do-activities associated to this state.
c | Context passed to the do-activities when stopped. |
void scxml4cpp::State::delInitialTrans | ( | ) |
Deletes all added Initial Transitions.
void scxml4cpp::State::delSubstates | ( | ) |
Deletes all added sub-states.
void scxml4cpp::State::delTransitions | ( | ) |
Deletes all added Transitions.
std::list< Activity * > & scxml4cpp::State::getActivities | ( | ) |
ExecutableContent * scxml4cpp::State::getEntryActions | ( | ) |
ExecutableContent * scxml4cpp::State::getExitActions | ( | ) |
StateHistory * scxml4cpp::State::getHistory | ( | ) |
std::string scxml4cpp::State::getId | ( | ) | const |
State * scxml4cpp::State::getInitialState | ( | ) |
std::list< Transition * > & scxml4cpp::State::getInitialTrans | ( | ) |
State * scxml4cpp::State::getParent | ( | ) |
std::list< State * > & scxml4cpp::State::getSubstates | ( | ) |
std::list< Transition * > & scxml4cpp::State::getTransitions | ( | ) |
State::StateType scxml4cpp::State::getType | ( | ) | const |
bool scxml4cpp::State::isAtomic | ( | ) |
bool scxml4cpp::State::isCompound | ( | ) |
bool scxml4cpp::State::isFinal | ( | ) |
bool scxml4cpp::State::isHistory | ( | ) |
bool scxml4cpp::State::isInitial | ( | ) |
bool scxml4cpp::State::isParallel | ( | ) |
void scxml4cpp::State::setActivities | ( | std::list< Activity * > & | activities | ) |
Set all do-activities for this state.
activities | Activities started/stopped when entering/exiting this state. |
void scxml4cpp::State::setFinalState | ( | State * | finalState | ) |
Set the final state.
finalState | Sub-state to enter when this Compound state is entered. |
void scxml4cpp::State::setHistory | ( | StateHistory * | h | ) |
Set history information. TODO check whether this pointer needs to be released by the destructor.
h | History information. |
void scxml4cpp::State::setId | ( | const std::string & | id | ) |
Set the state identifier.
id | State identifier. |
Creates an initial transition that is taken when entering this (Compound) state. This method allocates the memory for the initial transition which is released by the destructor/delInitialTrans() methods.
initialState | Sub-state to enter when this Compound state is entered. |
a | Action to be executed when transitioning to the initial state. |
void scxml4cpp::State::setIsFinal | ( | const bool | isFinal | ) |
Set whether the state is final or not.
isFinal | Flag indicating whether this state is final or not. |
void scxml4cpp::State::setIsInitial | ( | const bool | isInitial | ) |
Set whether the state is initial or not.
isInitial | Flag indicating whether this state is initial or not. |
void scxml4cpp::State::setParent | ( | State * | parent | ) |
Set the parent state.
parent | Parent state of this state. |
void scxml4cpp::State::setSubstates | ( | std::list< State * > & | substates | ) |
Set all sub-states of this state.
substates | Sub-states to be added. |
void scxml4cpp::State::setTransitions | ( | std::list< Transition * > & | transitions | ) |
Set all transitions that have this state as source state.
transitions | Outgoing transitions from this state. |
void scxml4cpp::State::setType | ( | const StateType | type | ) |
void scxml4cpp::State::startActivities | ( | Context * | c | ) |
Starts the do-activities associated to this state.
c | Context passed to the do-activities when started. |