10 #ifndef BEHAVIOUR_COMMON_H
11 #define BEHAVIOUR_COMMON_H
19 #include <boost/static_assert.hpp>
20 #include <boost/type_traits.hpp>
21 #include <boost/utility/enable_if.hpp>
24 #if defined(_MSC_VER) || (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) || (defined(__IBMCPP__) && (__IBMCPP__ >= 500))
25 #define CURRENT_FUNC __FUNCTION__
26 #elif defined(__GNUC__) || defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) || (defined(__ICC) && (__ICC >= 600))
27 #define CURRENT_FUNC __func__
29 #define CURRENT_FUNC "<unknown>"
37 #define REPORT_ERROR(MBasePtr, msg) (MBasePtr)->reportError((msg),true,CURRENT_FUNC,__FILE__,__LINE__)
39 #define REPORT_ERROR_(MBase, msg) (MBase).reportError((msg),true,CURRENT_FUNC,__FILE__,__LINE__)
40 #define REPORT_WARNING(MBasePtr, msg) (MBasePtr)->reportError((msg),false,CURRENT_FUNC,__FILE__,__LINE__)
41 #define REPORT_WARNING_(MBase, msg) (MBase).reportError((msg),false,CURRENT_FUNC,__FILE__,__LINE__)
42 #define ASSERT_ERROR(cond, MBasePtr, msg) if(!(cond)) { REPORT_ERROR((MBasePtr),msg); return; }
43 #define ASSERT_ERROR_(cond, MBase, msg) if(!(cond)) { REPORT_ERROR_((MBase),msg); return; }
44 #define ASSERT_WARNING(cond, MBasePtr, msg) if(!(cond)) { REPORT_WARNING((MBasePtr),msg); return; }
45 #define ASSERT_WARNING_(cond, MBase, msg) if(!(cond)) { REPORT_WARNING_((MBase),msg); return; }
49 namespace behaviourcontrol
177 for(i = 0;i < V.size();i++)
Implements a single behaviour.
Definition: behaviour.h:26
Actuator< long double > ActuatorLDouble
An actuator of data type long double
Definition: behaviour_common.h:133
int ret_t
Used to represent an error code/function return value.
Definition: behaviour_common.h:142
Actuator< unsigned long long > ActuatorULLong
An actuator of data type unsigned long long
Definition: behaviour_common.h:130
Sensor< double > SensorDouble
An sensor of data type double
Definition: behaviour_common.h:106
Signals that an action was attempted despite a pre-existing fatal error condition.
Definition: behaviour_common.h:72
Sensor< unsigned int > SensorUInt
An sensor of data type unsigned int
Definition: behaviour_common.h:100
Sensor< unsigned long long > SensorULLong
An sensor of data type unsigned long long
Definition: behaviour_common.h:104
Implements a single behaviour layer.
Definition: behaviour_layer.h:26
Implements a single actuator of a given data type.
Definition: behaviour_actuators.h:131
const level_t LVL_INACTIVE
Used to signal that a behaviour wishes to be fully deactivated.
Definition: behaviour_common.h:150
Sensor< long > SensorLong
An sensor of data type long
Definition: behaviour_common.h:101
Actuator< int > ActuatorInt
An actuator of data type int
Definition: behaviour_common.h:125
Actuator< bool > ActuatorBool
An actuator of data type bool
Definition: behaviour_common.h:124
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
Actuator< unsigned int > ActuatorUInt
An actuator of data type unsigned int
Definition: behaviour_common.h:126
Actuator< double > ActuatorDouble
An actuator of data type double
Definition: behaviour_common.h:132
const bool AGGREGATABLE
Used in the Actuator constructor to explicitly specify an aggregatable actuator.
Definition: behaviour_common.h:151
Actuator< unsigned long > ActuatorULong
An actuator of data type unsigned long
Definition: behaviour_common.h:128
Signals that an attempt to bind a sensor to an actuator failed because no actuator of a suitable name...
Definition: behaviour_common.h:75
std::size_t index_t
Used to represent an array or vector index (must be an unsigned type)
Definition: behaviour_common.h:140
Signals that a duplicate call of a once-only initialisation function was attempted.
Definition: behaviour_common.h:73
Sensor< int > SensorInt
An sensor of data type int
Definition: behaviour_common.h:99
Sensor< unsigned long > SensorULong
An sensor of data type unsigned long
Definition: behaviour_common.h:102
Sensor< float > SensorFloat
An sensor of data type float
Definition: behaviour_common.h:105
Sensor< bool > SensorBool
An sensor of data type bool
Definition: behaviour_common.h:98
Actuator< float > ActuatorFloat
An actuator of data type float
Definition: behaviour_common.h:131
Sensor< long long > SensorLLong
An sensor of data type long long
Definition: behaviour_common.h:103
Actuator< long long > ActuatorLLong
An actuator of data type long long
Definition: behaviour_common.h:129
FuncReturnID
Used to specify return values and error codes of certain behaviour control framework functions...
Definition: behaviour_common.h:67
Implements a single actuator.
Definition: behaviour_actuators.h:76
Signals an unknown or unspecified error.
Definition: behaviour_common.h:70
const bool NOT_AGGREGATABLE
Used in the Actuator constructor to specify a non-aggregatable actuator.
Definition: behaviour_common.h:152
Implements a single behaviour manager.
Definition: behaviour_manager.h:27
const std::string nullString
Used to avoid the need for null string literals throughout the code.
Definition: behaviour_common.h:148
Signals that an attempt to bind a sensor to an actuator failed because of a null sensor signal name...
Definition: behaviour_common.h:74
Actuator< long > ActuatorLong
An actuator of data type long
Definition: behaviour_common.h:127
void addIfUnique(std::vector< T > &V, T &value)
Add an element to a std::vector if an equivalent element (A == B) is not already in there...
Definition: behaviour_common.h:169
Sensor< long double > SensorLDouble
An sensor of data type long double
Definition: behaviour_common.h:107
Signals that an unexpected null pointer was encountered (usually as a function parameter) ...
Definition: behaviour_common.h:71
float level_t
Used to represent an activation level (raw activation levels should always be in the range [0...
Definition: behaviour_common.h:141
Signals that a cycle was detected in the behaviour inhibition definitions of a layer.
Definition: behaviour_common.h:77
Signals that an attempt to bind a sensor to an actuator failed because of an actuator/sensor data typ...
Definition: behaviour_common.h:76
const level_t LVL_ACTIVE
Used to signal that a behaviour wishes to be fully activated.
Definition: behaviour_common.h:149
Implements a single sensor of a given data type.
Definition: behaviour_common.h:56