![]() |
NimbRo ROS Soccer Package
|
Specialises the State
class using templates to take care of the most common overloads.
More...
#include <state_controller.h>
Public Types | |
typedef boost::is_base_of < StateController, SCClass > | Assert |
Public Member Functions | |
BOOST_STATIC_ASSERT_MSG (Assert::value,"SCClass template parameter must be a derived class of statecontroller::StateController") | |
GenState (SCClass *sc, int id, const std::string &name) | |
Default constructor that takes a pointer to the owning state controller class (SCClass must be a derived class of StateController) | |
virtual | ~GenState () |
Destructor. | |
![]() | |
State (int id, const std::string &name, const std::string &scname) | |
Default constructor. | |
virtual | ~State () |
Destructor. | |
Protected Member Functions | |
virtual StateController * | scref () const |
Return pointer to owning state controller. | |
![]() | |
virtual void | activate (cycle_t cyc) |
State activation callback. | |
virtual action_t | execute (cycle_t cyc)=0 |
State execution callback. | |
virtual void | deactivate (cycle_t cyc, bool wasExecuted) |
State deactivation callback. | |
StateQueue * | Queue () const |
Return pointer to the StateQueue of the owning state controller. | |
cycle_t | firstExecCycle () const |
The cycle ID of the first call to execute() for this state instance. | |
cycle_t | execCycleNum (cycle_t cyc) const |
The number of cycles since the first call to execute(), including the initial call cycle and the current call cycle if the function is being used (as intended) from within execute(). Example: if(execCycleNum(cyc) >= 10) return PROCEED_NEXT_STATE; | |
Protected Attributes | |
SCClass *const | sc |
Pointer to the owning state controller (required in order to be able to access the StateQueue and many other vital functions) | |
Additional Inherited Members | |
![]() | |
static bool | isNull (StateConstPtr state) |
Return whether a StatePtr is null. | |
![]() | |
const int | id |
The unique numeric ID of the state type. | |
const std::string | name |
The human-friendly name of the state type. | |
const std::string | scname |
The human-friendly name of the owning state controller. | |
Specialises the State
class using templates to take care of the most common overloads.
It is highly recommended to derive from this class instead of State
directly. The SCClass
template parameter must be a derived class of StateController
.