Ocean
|
This class implements a vector holding several callbacks with the same type. More...
Public Types | |
typedef T::ReturnType | ReturnType |
Definition of the return type of the callback object. More... | |
typedef T::ParameterType0 | ParameterType0 |
Definition of the 1st function parameter of the callback object. More... | |
typedef T::ParameterType1 | ParameterType1 |
Definition of the 2nd function parameter of the callback object. More... | |
typedef T::ParameterType2 | ParameterType2 |
Definition of the 3rd function parameter of the callback object. More... | |
typedef T::ParameterType3 | ParameterType3 |
Definition of the 4th function parameter of the callback object. More... | |
typedef T::ParameterType4 | ParameterType4 |
Definition of the 5th function parameter of the callback object. More... | |
typedef T::ParameterType5 | ParameterType5 |
Definition of the 6th function parameter of the callback object. More... | |
typedef T::ParameterType6 | ParameterType6 |
Definition of the 7th function parameter of the callback object. More... | |
typedef T::ParameterType7 | ParameterType7 |
Definition of the 8th function parameter of the callback object. More... | |
typedef T::ParameterType8 | ParameterType8 |
Definition of the 9th function parameter of the callback object. More... | |
typedef T::ParameterType9 | ParameterType9 |
Definition of the 10th function parameter of the callback object. More... | |
typedef T::ParameterType10 | ParameterType10 |
Definition of the 11th function parameter of the callback object. More... | |
typedef T::ParameterType11 | ParameterType11 |
Definition of the 12th function parameter of the callback object. More... | |
typedef T::ParameterType12 | ParameterType12 |
Definition of the 13th function parameter of the callback object. More... | |
typedef T::ParameterType13 | ParameterType13 |
Definition of the 14th function parameter of the callback object. More... | |
typedef T::ParameterType14 | ParameterType14 |
Definition of the 15th function parameter of the callback object. More... | |
typedef T::ParameterType15 | ParameterType15 |
Definition of the 16th function parameter of the callback object. More... | |
typedef T::ParameterType16 | ParameterType16 |
Definition of the 17th function parameter of the callback object. More... | |
typedef T::ParameterType17 | ParameterType17 |
Definition of the 18th function parameter of the callback object. More... | |
typedef T::ParameterType18 | ParameterType18 |
Definition of the 19th function parameter of the callback object. More... | |
typedef T::ParameterType19 | ParameterType19 |
Definition of the 20th function parameter of the callback object. More... | |
Public Member Functions | |
Callbacks () | |
Creates a new object without any initial callback function. More... | |
Callbacks (const Callbacks< T > &callbacks) | |
Copy constructor. More... | |
Callbacks (Callbacks< T > &&callbacks) noexcept | |
Move constructor. More... | |
~Callbacks () | |
Destructs this object. More... | |
void | addCallback (const T &callback) |
Adds a new callback object. More... | |
void | removeCallback (const T &callback) |
Removes a callback object. More... | |
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. More... | |
bool | isEmpty () const |
Returns whether no callback is stored. More... | |
operator bool () const | |
Returns whether at least one callback is stored. More... | |
Callbacks< T > & | operator= (const Callbacks< T > &callbacks) |
Assign operator. More... | |
Callbacks< T > & | operator= (Callbacks< T > &&callbacks) noexcept |
Move operator. More... | |
Protected Types | |
typedef std::vector< T > | CallbackObjects |
Definition of a vector holding callback objects. More... | |
Protected Attributes | |
CallbackObjects | callbackObjects |
The callback objects. More... | |
Lock | callbackLock |
Callback lock. More... | |
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.
typedef T::ParameterType0 Ocean::Callbacks< T >::ParameterType0 |
Definition of the 1st function parameter of the callback object.
typedef T::ParameterType1 Ocean::Callbacks< T >::ParameterType1 |
Definition of the 2nd function parameter of the callback object.
typedef T::ParameterType10 Ocean::Callbacks< T >::ParameterType10 |
Definition of the 11th function parameter of the callback object.
typedef T::ParameterType11 Ocean::Callbacks< T >::ParameterType11 |
Definition of the 12th function parameter of the callback object.
typedef T::ParameterType12 Ocean::Callbacks< T >::ParameterType12 |
Definition of the 13th function parameter of the callback object.
typedef T::ParameterType13 Ocean::Callbacks< T >::ParameterType13 |
Definition of the 14th function parameter of the callback object.
typedef T::ParameterType14 Ocean::Callbacks< T >::ParameterType14 |
Definition of the 15th function parameter of the callback object.
typedef T::ParameterType15 Ocean::Callbacks< T >::ParameterType15 |
Definition of the 16th function parameter of the callback object.
typedef T::ParameterType16 Ocean::Callbacks< T >::ParameterType16 |
Definition of the 17th function parameter of the callback object.
typedef T::ParameterType17 Ocean::Callbacks< T >::ParameterType17 |
Definition of the 18th function parameter of the callback object.
typedef T::ParameterType18 Ocean::Callbacks< T >::ParameterType18 |
Definition of the 19th function parameter of the callback object.
typedef T::ParameterType19 Ocean::Callbacks< T >::ParameterType19 |
Definition of the 20th function parameter of the callback object.
typedef T::ParameterType2 Ocean::Callbacks< T >::ParameterType2 |
Definition of the 3rd function parameter of the callback object.
typedef T::ParameterType3 Ocean::Callbacks< T >::ParameterType3 |
Definition of the 4th function parameter of the callback object.
typedef T::ParameterType4 Ocean::Callbacks< T >::ParameterType4 |
Definition of the 5th function parameter of the callback object.
typedef T::ParameterType5 Ocean::Callbacks< T >::ParameterType5 |
Definition of the 6th function parameter of the callback object.
typedef T::ParameterType6 Ocean::Callbacks< T >::ParameterType6 |
Definition of the 7th function parameter of the callback object.
typedef T::ParameterType7 Ocean::Callbacks< T >::ParameterType7 |
Definition of the 8th function parameter of the callback object.
typedef T::ParameterType8 Ocean::Callbacks< T >::ParameterType8 |
Definition of the 9th function parameter of the callback object.
typedef T::ParameterType9 Ocean::Callbacks< T >::ParameterType9 |
Definition of the 10th function parameter of the callback object.
typedef T::ReturnType Ocean::Callbacks< 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.