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

Implements a single actuator. More...

#include <behaviour_actuators.h>

Inheritance diagram for behaviourcontrol::ActuatorBase:
behaviourcontrol::Actuator< bool > behaviourcontrol::Actuator< double > behaviourcontrol::Actuator< float > behaviourcontrol::Actuator< int > behaviourcontrol::Actuator< long > behaviourcontrol::Actuator< unsigned long > behaviourcontrol::Actuator< T >

Public Member Functions

 ActuatorBase (ActuatorManager *AMBase, const std::string &signalName=nullString)
 Default constructor. More...
 
virtual ~ActuatorBase ()
 ActuatorBase object destructor.
 
virtual const std::type_info * getTypeInfo () const =0
 Update callback for the ActuatorBase object. Refer to the default override defined in Actuator::update(). More...
 
virtual bool isCompatibleWith (const SensorBase *SBase) const =0
 Abstract callback that should evaluate whether the current actuator is compatible the sensor SBase (can be bound to it). Refer to the default override Actuator::isCompatibleWith().
 
std::string getUniqueName (const ActuatorManager *AMBase) const
 Returns a unique actuator name. More...
 
ActuatorBasegetBasePtr ()
 Return a pointer to the underlying ActuatorBase object in the case of a derived actuator class.
 

Public Attributes

BehaviourManager *const MBase
 Pointer to the parent behaviour manager.
 
BehaviourLayer *const LBase
 Pointer to the parent behaviour layer.
 
ActuatorManager *const AMBase
 Pointer to the parent actuator manager.
 
const std::string signalName
 The name of the actuator, used as the lookup key for the BehaviourManager::findActuator() function.
 

Static Public Attributes

static const std::string DEF_ACTUATOR_SIGNAL_NAME = "Actuator"
 Default actuator signal name used to generate a unique one, in the case that no name is provided by a derived actuator class.
 

Friends

class ActuatorManager
 

Detailed Description

Implements a single actuator.

This class is the base class of all actuators that are used in an ActuatorManager.

Constructor & Destructor Documentation

ActuatorBase::ActuatorBase ( ActuatorManager AMBase,
const std::string &  signalName = nullString 
)
explicit

Default constructor.

Note that although the default value for the signalName parameter is nullString, this will not actually become the actuator's name if the parameter is omitted. This is just used to signal to the class's internals that it should generate a default name using the getUniqueName() function. AMBase must never be null or a segmentation fault will result!

Parameters
AMBaseA pointer to the actuator manager that the actuator belongs to.
signalNameThe unique human-friendly name to give the actuator (null means auto-generate). This name is used by the sensor classes to look up and bind to the correct actuators. The name can be completely arbitrary, with the only restriction being that it can't be the null string, but recommended sample names include "ThisLayer/ActuatorName" and "Layer1/TargetX", where ThisLayer and Layer1 are sample names of layers that own the actuators being constructed, and ActuatorName and TargetX are sample actuator-specific names.
See Also
Default Sensor constructor

Member Function Documentation

virtual const std::type_info* behaviourcontrol::ActuatorBase::getTypeInfo ( ) const
pure virtual

Update callback for the ActuatorBase object. Refer to the default override defined in Actuator::update().

Abstract callback that should be overridden to return the type information of the actuator (i.e. a std::type_info object). Refer to the default override Actuator::getTypeInfo().

Implemented in behaviourcontrol::Actuator< T >, behaviourcontrol::Actuator< long >, behaviourcontrol::Actuator< unsigned long >, behaviourcontrol::Actuator< double >, behaviourcontrol::Actuator< float >, behaviourcontrol::Actuator< int >, and behaviourcontrol::Actuator< bool >.

std::string ActuatorBase::getUniqueName ( const ActuatorManager AMBase) const

Returns a unique actuator name.

Automatically construct a unique name for the actuator, for situations where none is provided by the derived class. The name that results of this function will be unique as long as the user does not explicitly use the same name somewhere else, either before or after the construction of this actuator. If there are currently seven actuators in the AMBase actuator manager, the generated name will be the concatenation of DEF_ACTUATOR_SIGNAL_NAME and "7".

Parameters
AMBaseA non-null pointer to the parent actuator manager.
Returns
The required actuator name.

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