RTT::StateInterface Class Reference

A State contains an entry, run, handle and exit program. More...

#include <rtt/StateInterface.hpp>

Inheritance diagram for RTT::StateInterface:
RTT::StateDescription

List of all members.

Public Member Functions

virtual const std::string & getName () const =0
 Get the name of this state.
virtual ProgramInterfacegetEntryProgram () const =0
 Get the entry program of this State.
virtual ProgramInterfacegetRunProgram () const =0
 Get the run program of this State.
virtual ProgramInterfacegetHandleProgram () const =0
 Get the handle program of this State.
virtual ProgramInterfacegetExitProgram () const =0
 Get the exit program of this State.
virtual int getEntryPoint () const =0
 Get the beginning definition of this State.
virtual StateInterfacecopy (std::map< const DataSourceBase *, DataSourceBase * > &replacementdss) const =0

Detailed Description

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 79 of file StateInterface.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:44 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3