NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
statecontroller::State Class Referenceabstract

Implements a state that a state controller can be in. More...

#include <state_controller.h>

Inheritance diagram for statecontroller::State:
statecontroller::GenState< DemoSC > statecontroller::GenState< SittingDemoSC > statecontroller::GenState< StandingDemoSC > statecontroller::GenState< SCClass >

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 StateControllerscref () 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.
 
StateQueueQueue () 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
 

Detailed Description

Implements a state that a state controller can be in.

This class is the base class of all states of a state controller.


The documentation for this class was generated from the following files: