![]() |
NimbRo ROS Soccer Package
|
Implements a state that a state controller can be in. More...
#include <state_controller.h>
Public Member Functions | |
State (int id, const std::string &name, const std::string &scname) | |
Default constructor. | |
virtual | ~State () |
Destructor. | |
Static Public Member Functions | |
static bool | isNull (StateConstPtr state) |
Return whether a StatePtr is null. | |
Public Attributes | |
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. | |
Protected Member Functions | |
virtual StateController * | scref () const =0 |
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; | |
Friends | |
class | StateController |
Implements a state that a state controller can be in.
This class is the base class of all states of a state controller.