|
Ocean
|
This class implements a vector holding several callbacks with the same type. More...
#include <Callback.h>
Public Types | |
| using | ReturnType = typename T::ReturnType |
| Definition of the return type of the callback object. | |
| using | ParameterType0 = typename T::ParameterType0 |
| Definition of the 1st function parameter of the callback object. | |
| using | ParameterType1 = typename T::ParameterType1 |
| Definition of the 2nd function parameter of the callback object. | |
| using | ParameterType2 = typename T::ParameterType2 |
| Definition of the 3rd function parameter of the callback object. | |
| using | ParameterType3 = typename T::ParameterType3 |
| Definition of the 4th function parameter of the callback object. | |
| using | ParameterType4 = typename T::ParameterType4 |
| Definition of the 5th function parameter of the callback object. | |
| using | ParameterType5 = typename T::ParameterType5 |
| Definition of the 6th function parameter of the callback object. | |
| using | ParameterType6 = typename T::ParameterType6 |
| Definition of the 7th function parameter of the callback object. | |
| using | ParameterType7 = typename T::ParameterType7 |
| Definition of the 8th function parameter of the callback object. | |
| using | ParameterType8 = typename T::ParameterType8 |
| Definition of the 9th function parameter of the callback object. | |
| using | ParameterType9 = typename T::ParameterType9 |
| Definition of the 10th function parameter of the callback object. | |
| using | ParameterType10 = typename T::ParameterType10 |
| Definition of the 11th function parameter of the callback object. | |
| using | ParameterType11 = typename T::ParameterType11 |
| Definition of the 12th function parameter of the callback object. | |
| using | ParameterType12 = typename T::ParameterType12 |
| Definition of the 13th function parameter of the callback object. | |
| using | ParameterType13 = typename T::ParameterType13 |
| Definition of the 14th function parameter of the callback object. | |
| using | ParameterType14 = typename T::ParameterType14 |
| Definition of the 15th function parameter of the callback object. | |
| using | ParameterType15 = typename T::ParameterType15 |
| Definition of the 16th function parameter of the callback object. | |
| using | ParameterType16 = typename T::ParameterType16 |
| Definition of the 17th function parameter of the callback object. | |
| using | ParameterType17 = typename T::ParameterType17 |
| Definition of the 18th function parameter of the callback object. | |
| using | ParameterType18 = typename T::ParameterType18 |
| Definition of the 19th function parameter of the callback object. | |
| using | ParameterType19 = typename T::ParameterType19 |
| Definition of the 20th function parameter of the callback object. | |
Public Member Functions | |
| Callbacks () | |
| Creates a new object without any initial callback function. | |
| Callbacks (const Callbacks< T > &callbacks) | |
| Copy constructor. | |
| Callbacks (Callbacks< T > &&callbacks) noexcept | |
| Move constructor. | |
| ~Callbacks () | |
| Destructs this object. | |
| void | addCallback (const T &callback) |
| Adds a new callback object. | |
| void | removeCallback (const T &callback) |
| Removes a callback object. | |
| ReturnType | operator() (ParameterType0 param0=ParameterType0(), ParameterType1 param1=ParameterType1(), ParameterType2 param2=ParameterType2(), ParameterType3 param3=ParameterType3(), ParameterType4 param4=ParameterType4(), ParameterType5 param5=ParameterType5(), ParameterType6 param6=ParameterType6(), ParameterType7 param7=ParameterType7(), ParameterType8 param8=ParameterType8(), ParameterType9 param9=ParameterType9(), ParameterType10 param10=ParameterType10(), ParameterType11 param11=ParameterType11(), ParameterType12 param12=ParameterType12(), ParameterType13 param13=ParameterType13(), ParameterType14 param14=ParameterType14(), ParameterType15 param15=ParameterType15(), ParameterType16 param16=ParameterType16(), ParameterType17 param17=ParameterType17(), ParameterType18 param18=ParameterType18(), ParameterType19 param19=ParameterType19()) const |
| Calls all encapsulated callback functions. | |
| bool | isEmpty () const |
| Returns whether no callback is stored. | |
| operator bool () const | |
| Returns whether at least one callback is stored. | |
| Callbacks< T > & | operator= (const Callbacks< T > &callbacks) |
| Assign operator. | |
| Callbacks< T > & | operator= (Callbacks< T > &&callbacks) noexcept |
| Move operator. | |
Protected Types | |
| using | CallbackObjects = std::vector< T > |
| Definition of a vector holding callback objects. | |
Protected Attributes | |
| CallbackObjects | callbackObjects |
| The callback objects. | |
| Lock | callbackLock |
| Callback lock. | |
This class implements a vector holding several callbacks with the same type.
The class is thread-safe but does not allow to remove or add new callbacks while a callback is currently invoked (by the same thread).
| T | Type of the callbacks to be stored |
|
protected |
Definition of a vector holding callback objects.
| using Ocean::Callbacks< T >::ParameterType0 = typename T::ParameterType0 |
Definition of the 1st function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType1 = typename T::ParameterType1 |
Definition of the 2nd function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType10 = typename T::ParameterType10 |
Definition of the 11th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType11 = typename T::ParameterType11 |
Definition of the 12th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType12 = typename T::ParameterType12 |
Definition of the 13th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType13 = typename T::ParameterType13 |
Definition of the 14th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType14 = typename T::ParameterType14 |
Definition of the 15th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType15 = typename T::ParameterType15 |
Definition of the 16th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType16 = typename T::ParameterType16 |
Definition of the 17th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType17 = typename T::ParameterType17 |
Definition of the 18th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType18 = typename T::ParameterType18 |
Definition of the 19th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType19 = typename T::ParameterType19 |
Definition of the 20th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType2 = typename T::ParameterType2 |
Definition of the 3rd function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType3 = typename T::ParameterType3 |
Definition of the 4th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType4 = typename T::ParameterType4 |
Definition of the 5th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType5 = typename T::ParameterType5 |
Definition of the 6th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType6 = typename T::ParameterType6 |
Definition of the 7th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType7 = typename T::ParameterType7 |
Definition of the 8th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType8 = typename T::ParameterType8 |
Definition of the 9th function parameter of the callback object.
| using Ocean::Callbacks< T >::ParameterType9 = typename T::ParameterType9 |
Definition of the 10th function parameter of the callback object.
| using Ocean::Callbacks< T >::ReturnType = typename T::ReturnType |
Definition of the return type of the callback object.
|
inline |
Creates a new object without any initial callback function.
|
inline |
Copy constructor.
| callbacks | The callbacks object to copy |
|
inlinenoexcept |
Move constructor.
| callbacks | The callbacks object to move |
|
inline |
Destructs this object.
| void Ocean::Callbacks< T >::addCallback | ( | const T & | callback | ) |
Adds a new callback object.
| callback | The callback to be added |
|
inline |
Returns whether no callback is stored.
|
inlineexplicit |
Returns whether at least one callback is stored.
| Callbacks< T >::ReturnType Ocean::Callbacks< T >::operator() | ( | ParameterType0 | param0 = ParameterType0(), |
| ParameterType1 | param1 = ParameterType1(), |
||
| ParameterType2 | param2 = ParameterType2(), |
||
| ParameterType3 | param3 = ParameterType3(), |
||
| ParameterType4 | param4 = ParameterType4(), |
||
| ParameterType5 | param5 = ParameterType5(), |
||
| ParameterType6 | param6 = ParameterType6(), |
||
| ParameterType7 | param7 = ParameterType7(), |
||
| ParameterType8 | param8 = ParameterType8(), |
||
| ParameterType9 | param9 = ParameterType9(), |
||
| ParameterType10 | param10 = ParameterType10(), |
||
| ParameterType11 | param11 = ParameterType11(), |
||
| ParameterType12 | param12 = ParameterType12(), |
||
| ParameterType13 | param13 = ParameterType13(), |
||
| ParameterType14 | param14 = ParameterType14(), |
||
| ParameterType15 | param15 = ParameterType15(), |
||
| ParameterType16 | param16 = ParameterType16(), |
||
| ParameterType17 | param17 = ParameterType17(), |
||
| ParameterType18 | param18 = ParameterType18(), |
||
| ParameterType19 | param19 = ParameterType19() |
||
| ) | const |
Calls all encapsulated callback functions.
| param0 | Possible first function parameter |
| param1 | Possible second function parameter |
| param2 | Possible third function parameter |
| param3 | Possible fourth function parameter |
| param4 | Possible fifth function parameter |
| param5 | Possible sixth function parameter |
| param6 | Possible seventh function parameter |
| param7 | Possible eighth function parameter |
| param8 | Possible ninth function parameter |
| param9 | Possible tenth function parameter |
| param10 | 11th function parameter |
| param11 | 12th function parameter |
| param12 | 13th function parameter |
| param13 | 14th function parameter |
| param14 | 15th function parameter |
| param15 | 16th function parameter |
| param16 | 17th function parameter |
| param17 | 18th function parameter |
| param18 | 19th function parameter |
| param19 | 20th function parameter |
|
inlinenoexcept |
Move operator.
| callbacks | The callbacks object to move |
|
inline |
Assign operator.
| callbacks | The callbacks object to assign |
| void Ocean::Callbacks< T >::removeCallback | ( | const T & | callback | ) |
Removes a callback object.
| callback | The callback to be removed |
|
mutableprotected |
Callback lock.
|
protected |
The callback objects.