Orocos Real-Time Toolkit
2.8.3
|
A State contains an entry, run, handle and exit program. More...
#include <rtt/scripting/StateInterface.hpp>
Public Member Functions | |
virtual | ~StateInterface () |
virtual void | loaded (ExecutionEngine *ee) |
virtual const std::string & | getName () const =0 |
Get the name of this state. More... | |
virtual ProgramInterface * | getEntryProgram () const =0 |
Get the entry program of this State. More... | |
virtual ProgramInterface * | getRunProgram () const =0 |
Get the run program of this State. More... | |
virtual ProgramInterface * | getHandleProgram () const =0 |
Get the handle program of this State. More... | |
virtual ProgramInterface * | getExitProgram () const =0 |
Get the exit program of this State. More... | |
virtual int | getEntryPoint () const =0 |
Get the beginning definition of this State. More... | |
virtual StateInterface * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacementdss) const =0 |
A State contains an entry, run, handle and exit program.
The entry and exit programs will be called when the state is entered of left. The handle program will be called each time the state is requested and no transition is made. The run program will be called before any transition is evaluated.
Thus when we are in state A and want to switch to state B, the following happens :
* in State A : * call A->run(); * if ( transition to B allowed ) * call A->onExit(); * call B->onEntry(); * return true; * else * call A->handle(); * return false; *
Error recovery can be handled inside these programs, if even that fails, the programs return false and the state machine containing this state is considered in error.
Definition at line 81 of file StateInterface.hpp.
|
virtual |
Definition at line 51 of file StateInterface.cpp.
|
pure virtual |
Implemented in RTT::scripting::StateDescription.
Referenced by RTT::scripting::ParsedStateMachine::copy().
|
pure virtual |
Get the beginning definition of this State.
Implemented in RTT::scripting::StateDescription.
Referenced by RTT::scripting::StateMachine::getLineNumber().
|
pure virtual |
Get the entry program of this State.
Implemented in RTT::scripting::StateDescription.
Referenced by RTT::scripting::StateMachine::enterState(), and loaded().
|
pure virtual |
Get the exit program of this State.
Implemented in RTT::scripting::StateDescription.
Referenced by RTT::scripting::StateMachine::leaveState(), and loaded().
|
pure virtual |
Get the handle program of this State.
Implemented in RTT::scripting::StateDescription.
Referenced by RTT::scripting::StateMachine::handleState(), and loaded().
|
pure virtual |
Get the name of this state.
Implemented in RTT::scripting::StateDescription.
Referenced by RTT::scripting::StateMachine::changeState(), RTT::scripting::StateMachine::createEventTransition(), RTT::scripting::StateMachine::executePending(), RTT::scripting::StateMachine::getCurrentStateName(), RTT::scripting::StateMachine::getStateList(), RTT::scripting::ParsedStateMachine::inState(), RTT::scripting::StateMachine::inState(), RTT::scripting::StateMachine::inStrictState(), RTT::scripting::StateMachine::transitionSet(), and RTT::scripting::StateMachine::unloading().
|
pure virtual |
Get the run program of this State.
Implemented in RTT::scripting::StateDescription.
Referenced by loaded(), and RTT::scripting::StateMachine::runState().
|
virtual |
Definition at line 55 of file StateInterface.cpp.
References getEntryProgram(), getExitProgram(), getHandleProgram(), getRunProgram(), and RTT::base::ExecutableInterface::loaded().