NimbRo ROS Soccer Package
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
statecontroller::GenState< SCClass > Class Template Reference

Specialises the State class using templates to take care of the most common overloads. More...

#include <state_controller.h>

Inheritance diagram for statecontroller::GenState< SCClass >:
statecontroller::State

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.
 
- Public Member Functions inherited from statecontroller::State
 State (int id, const std::string &name, const std::string &scname)
 Default constructor.
 
virtual ~State ()
 Destructor.
 

Protected Member Functions

virtual StateControllerscref () const
 Return pointer to owning state controller.
 
- Protected Member Functions inherited from statecontroller::State
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;
 

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 Public Member Functions inherited from statecontroller::State
static bool isNull (StateConstPtr state)
 Return whether a StatePtr is null.
 
- Public Attributes inherited from statecontroller::State
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.
 

Detailed Description

template<class SCClass>
class statecontroller::GenState< SCClass >

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.


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