10 #ifndef BEHAVIOUR_LAYER_H
11 #define BEHAVIOUR_LAYER_H
17 namespace behaviourcontrol
67 std::vector<BBasePair> IList;
68 std::vector<BBasePair> CIList;
84 bool hasSM()
const {
return haveSM; }
85 bool hasAM()
const {
return haveAM; }
98 const ActuatorBase* findActuator(
const std::string& signalName)
const;
101 template <
class BClass>
void declareBehaviour(BClass* behaviour);
104 std::vector<Behaviour*> BList;
Implements a single behaviour.
Definition: behaviour.h:26
virtual ~BehaviourLayer()
Behaviour layer object destructor.
Definition: behaviour_layer.cpp:54
int ret_t
Used to represent an error code/function return value.
Definition: behaviour_common.h:142
Implements a single behaviour layer.
Definition: behaviour_layer.h:26
Data structure used to represent a basic inhibition pair, where behaviour A is taken to inhibit behav...
Definition: behaviour_layer.h:35
BehaviourManager *const MBase
Pointer to the parent behaviour manager.
Definition: behaviour_layer.h:48
ActuatorManager * getAMBase()
Get function for a pointer to the base class of the child actuator manager.
Definition: behaviour_layer.h:83
BBasePair(Behaviour *BBaseA, Behaviour *BBaseB)
Constructor that accepts initial values for BBaseA and BBaseB.
Definition: behaviour_layer.h:38
Signals successful execution of a function, with no error conditions encountered. ...
Definition: behaviour_common.h:69
Implements a manager of a particular group of actuators.
Definition: behaviour_actuators.h:26
void addChainInhibition(Behaviour *BBaseA, Behaviour *BBaseB)
Adds a chaining inhibition from behaviour BBaseA (inhibitor) to behaviour BBaseB (inhibitee).
Definition: behaviour_layer.cpp:122
static const index_t DEF_ILIST_CAPACITY
Default capacity of the lists that are used to store the chaining and non-chaining inhibition definit...
Definition: behaviour_layer.h:31
static const index_t DEF_BLIST_CAPACITY
Default capacity of the list that stores the child behaviours of the layer.
Definition: behaviour_layer.h:30
virtual void postExecuteCallback()
Callback that is invoked at the end of the executeAll() function so that the user can inject code...
Definition: behaviour_layer.h:90
Behaviour * B
The behaviour that is being inhibited.
Definition: behaviour_layer.h:40
static const std::string DEF_LAYER_NAME
Default behaviour layer name used to generate a unique one, in the case that no name is provided by a...
Definition: behaviour_layer.h:32
std::size_t index_t
Used to represent an array or vector index (must be an unsigned type)
Definition: behaviour_common.h:140
BehaviourLayer * getBasePtr()
Return a pointer to the underlying BehaviourLayer class object in the case of a derived behaviour lay...
Definition: behaviour_layer.h:109
virtual void update()
Update callback for the behaviour layer object. This function is called from updateAll(), which is used in step().
Definition: behaviour_layer.h:89
virtual ret_t init()
Initialisation callback for the behaviour layer. This function is called from initAll(), and is intended to be overridden for the purpose of initialising the derived behaviour layer object.
Definition: behaviour_layer.h:72
bool hasAM() const
Boolean flag specifying whether this layer has an actuator manager.
Definition: behaviour_layer.h:85
BBasePair()
Default constructor.
Definition: behaviour_layer.h:37
Behaviour * A
The inhibiting behaviour.
Definition: behaviour_layer.h:39
Implements a single actuator.
Definition: behaviour_actuators.h:76
const bool isInterface
A boolean flag specifying whether the layer is an interface layer or a normal behaviour layer...
Definition: behaviour_layer.h:51
const std::string Mname
Human-friendly string name of the parent behaviour manager.
Definition: behaviour_layer.h:49
Implements a single behaviour manager.
Definition: behaviour_manager.h:27
BehaviourLayer(BehaviourManager *MBase, const std::string &name=nullString, bool isInterface=false)
Default constructor.
Definition: behaviour_layer.cpp:34
const std::string nullString
Used to avoid the need for null string literals throughout the code.
Definition: behaviour_common.h:148
std::string getUniqueName(const BehaviourManager *MBase) const
Returns a unique behaviour layer name.
Definition: behaviour_layer.cpp:597
const std::string name
Human-friendly string name of the behaviour layer.
Definition: behaviour_layer.h:50
Implements a manager of a particular group of sensors.
Definition: behaviour_sensors.h:26
bool hasSM() const
Boolean flag specifying whether this layer has a sensor manager.
Definition: behaviour_layer.h:84
SensorManager * getSMBase()
Get function for a pointer to the base class of the child sensor manager.
Definition: behaviour_layer.h:82
void addInhibition(Behaviour *BBaseA, Behaviour *BBaseB)
Adds a non-chaining inhibition from behaviour BBaseA (inhibitor) to behaviour BBaseB (inhibitee)...
Definition: behaviour_layer.cpp:98
Common definitions include file for the internal Behaviour Control Framework source code...