Ocean
Ocean::ConcurrentCallbacks< T > Class Template Reference

This class implements an extended callbacks object and is also thread-safe. More...

Inheritance diagram for Ocean::ConcurrentCallbacks< T >:

Public Types

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 Types inherited from Ocean::Callbacks< T >
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

 ConcurrentCallbacks ()
 Creates a new callbacks object. More...
 
 ~ConcurrentCallbacks ()
 Destructs a callbacks object. More...
 
void addCallback (const T &callback)
 Adds a new callback object. More...
 
void removeCallback (const T &callback)
 Removes a callback object. More...
 
void 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())
 Calls all encapsulated callback functions. More...
 
- Public Member Functions inherited from Ocean::Callbacks< T >
 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...
 

Private Attributes

Callbacks< T >::CallbackObjects intermediateRemoveCallbacks
 Intermediate callbacks to be removed. More...
 
Callbacks< T >::CallbackObjects intermediateAddCallbacks
 Intermediate callbacks to be added. More...
 
bool callbacksInvoked
 State that the callbacks are currently invoked. More...
 

Additional Inherited Members

- Protected Types inherited from Ocean::Callbacks< T >
typedef std::vector< T > CallbackObjects
 Definition of a vector holding callback objects. More...
 
- Protected Attributes inherited from Ocean::Callbacks< T >
CallbackObjects callbackObjects
 The callback objects. More...
 
Lock callbackLock
 Callback lock. More...
 

Detailed Description

template<typename T>
class Ocean::ConcurrentCallbacks< T >

This class implements an extended callbacks object and is also thread-safe.

This implementation allows to remove or add callback objects while the callbacks are invoked (by the same thread).

See also
Callbacks, Callback.
Template Parameters
TType of the callbacks to be stored

Member Typedef Documentation

◆ ParameterType0

template<typename T >
typedef T::ParameterType0 Ocean::ConcurrentCallbacks< T >::ParameterType0

Definition of the 1st function parameter of the callback object.

◆ ParameterType1

template<typename T >
typedef T::ParameterType1 Ocean::ConcurrentCallbacks< T >::ParameterType1

Definition of the 2nd function parameter of the callback object.

◆ ParameterType10

template<typename T >
typedef T::ParameterType10 Ocean::ConcurrentCallbacks< T >::ParameterType10

Definition of the 11th function parameter of the callback object.

◆ ParameterType11

template<typename T >
typedef T::ParameterType11 Ocean::ConcurrentCallbacks< T >::ParameterType11

Definition of the 12th function parameter of the callback object.

◆ ParameterType12

template<typename T >
typedef T::ParameterType12 Ocean::ConcurrentCallbacks< T >::ParameterType12

Definition of the 13th function parameter of the callback object.

◆ ParameterType13

template<typename T >
typedef T::ParameterType13 Ocean::ConcurrentCallbacks< T >::ParameterType13

Definition of the 14th function parameter of the callback object.

◆ ParameterType14

template<typename T >
typedef T::ParameterType14 Ocean::ConcurrentCallbacks< T >::ParameterType14

Definition of the 15th function parameter of the callback object.

◆ ParameterType15

template<typename T >
typedef T::ParameterType15 Ocean::ConcurrentCallbacks< T >::ParameterType15

Definition of the 16th function parameter of the callback object.

◆ ParameterType16

template<typename T >
typedef T::ParameterType16 Ocean::ConcurrentCallbacks< T >::ParameterType16

Definition of the 17th function parameter of the callback object.

◆ ParameterType17

template<typename T >
typedef T::ParameterType17 Ocean::ConcurrentCallbacks< T >::ParameterType17

Definition of the 18th function parameter of the callback object.

◆ ParameterType18

template<typename T >
typedef T::ParameterType18 Ocean::ConcurrentCallbacks< T >::ParameterType18

Definition of the 19th function parameter of the callback object.

◆ ParameterType19

template<typename T >
typedef T::ParameterType19 Ocean::ConcurrentCallbacks< T >::ParameterType19

Definition of the 20th function parameter of the callback object.

◆ ParameterType2

template<typename T >
typedef T::ParameterType2 Ocean::ConcurrentCallbacks< T >::ParameterType2

Definition of the 3rd function parameter of the callback object.

◆ ParameterType3

template<typename T >
typedef T::ParameterType3 Ocean::ConcurrentCallbacks< T >::ParameterType3

Definition of the 4th function parameter of the callback object.

◆ ParameterType4

template<typename T >
typedef T::ParameterType4 Ocean::ConcurrentCallbacks< T >::ParameterType4

Definition of the 5th function parameter of the callback object.

◆ ParameterType5

template<typename T >
typedef T::ParameterType5 Ocean::ConcurrentCallbacks< T >::ParameterType5

Definition of the 6th function parameter of the callback object.

◆ ParameterType6

template<typename T >
typedef T::ParameterType6 Ocean::ConcurrentCallbacks< T >::ParameterType6

Definition of the 7th function parameter of the callback object.

◆ ParameterType7

template<typename T >
typedef T::ParameterType7 Ocean::ConcurrentCallbacks< T >::ParameterType7

Definition of the 8th function parameter of the callback object.

◆ ParameterType8

template<typename T >
typedef T::ParameterType8 Ocean::ConcurrentCallbacks< T >::ParameterType8

Definition of the 9th function parameter of the callback object.

◆ ParameterType9

template<typename T >
typedef T::ParameterType9 Ocean::ConcurrentCallbacks< T >::ParameterType9

Definition of the 10th function parameter of the callback object.

Constructor & Destructor Documentation

◆ ConcurrentCallbacks()

template<typename T >
Ocean::ConcurrentCallbacks< T >::ConcurrentCallbacks
inline

Creates a new callbacks object.

◆ ~ConcurrentCallbacks()

template<typename T >
Ocean::ConcurrentCallbacks< T >::~ConcurrentCallbacks
inline

Destructs a callbacks object.

Member Function Documentation

◆ addCallback()

template<typename T >
void Ocean::ConcurrentCallbacks< T >::addCallback ( const T &  callback)

Adds a new callback object.

Parameters
callbackThe callback to be added

◆ operator()()

Calls all encapsulated callback functions.

Parameters
param0Possible first function parameter
param1Possible second function parameter
param2Possible third function parameter
param3Possible fourth function parameter
param4Possible fifth function parameter
param5Possible sixth function parameter
param6Possible seventh function parameter
param7Possible eighth function parameter
param8Possible ninth function parameter
param9Possible tenth function parameter
param1011th function parameter
param1112th function parameter
param1213th function parameter
param1314th function parameter
param1415th function parameter
param1516th function parameter
param1617th function parameter
param1718th function parameter
param1819th function parameter
param1920th function parameter

◆ removeCallback()

template<typename T >
void Ocean::ConcurrentCallbacks< T >::removeCallback ( const T &  callback)

Removes a callback object.

Parameters
callbackThe callback to be removed

Field Documentation

◆ callbacksInvoked

template<typename T >
bool Ocean::ConcurrentCallbacks< T >::callbacksInvoked
mutableprivate

State that the callbacks are currently invoked.

◆ intermediateAddCallbacks

template<typename T >
Callbacks<T>::CallbackObjects Ocean::ConcurrentCallbacks< T >::intermediateAddCallbacks
private

Intermediate callbacks to be added.

◆ intermediateRemoveCallbacks

template<typename T >
Callbacks<T>::CallbackObjects Ocean::ConcurrentCallbacks< T >::intermediateRemoveCallbacks
private

Intermediate callbacks to be removed.


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