Ocean
|
This class implements a container for callback functions. More...
Public Types | |
typedef RT | ReturnType |
Definition of the return type of this callback object. More... | |
typedef PT0 | ParameterType0 |
Definition of the 1st parameter type of this callback object. More... | |
typedef PT1 | ParameterType1 |
Definition of the 2rd parameter type of this callback object. More... | |
typedef PT2 | ParameterType2 |
Definition of the 3rd parameter type of this callback object. More... | |
typedef PT3 | ParameterType3 |
Definition of the 4th parameter type of this callback object. More... | |
typedef PT4 | ParameterType4 |
Definition of the 5th parameter type of this callback object. More... | |
typedef PT5 | ParameterType5 |
Definition of the 6th parameter type of this callback object. More... | |
typedef PT6 | ParameterType6 |
Definition of the 7th parameter type of this callback object. More... | |
typedef PT7 | ParameterType7 |
Definition of the 8th parameter type of this callback object. More... | |
typedef PT8 | ParameterType8 |
Definition of the 9th parameter type of this callback object. More... | |
typedef PT9 | ParameterType9 |
Definition of the 10th parameter type of this callback object. More... | |
typedef PT10 | ParameterType10 |
Definition of the 11th parameter type of this callback object. More... | |
typedef PT11 | ParameterType11 |
Definition of the 12th parameter type of this callback object. More... | |
typedef PT12 | ParameterType12 |
Definition of the 13th parameter type of this callback object. More... | |
typedef PT13 | ParameterType13 |
Definition of the 14th parameter type of this callback object. More... | |
typedef PT14 | ParameterType14 |
Definition of the 15th parameter type of this callback object. More... | |
typedef PT15 | ParameterType15 |
Definition of the 16th parameter type of this callback object. More... | |
typedef PT16 | ParameterType16 |
Definition of the 17th parameter type of this callback object. More... | |
typedef PT17 | ParameterType17 |
Definition of the 18th parameter type of this callback object. More... | |
typedef PT18 | ParameterType18 |
Definition of the 19th parameter type of this callback object. More... | |
typedef PT19 | ParameterType19 |
Definition of the 20th parameter type of this callback object. More... | |
Public Member Functions | |
Callback () | |
Creates an empty callback container. More... | |
Callback (const Callback &callback) | |
Copies a callback container. More... | |
template<typename CT > | |
Callback (CT &object, typename MemberFunctionPointerMaker< CT, RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::Type function) | |
Creates a new callback container for a member function. More... | |
Callback (typename StaticFunctionPointerMaker< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::Type function) | |
Creates a new callback container for a static function. More... | |
virtual | ~Callback () |
Destructs a callback container object. More... | |
bool | isNull () const |
Returns whether this container holds no function. More... | |
RT | operator() (PT0 param0=PT0(), PT1 param1=PT1(), PT2 param2=PT2(), PT3 param3=PT3(), PT4 param4=PT4(), PT5 param5=PT5(), PT6 param6=PT6(), PT7 param7=PT7(), PT8 param8=PT8(), PT9 param9=PT9(), PT10 param10=PT10(), PT11 param11=PT11(), PT12 param12=PT12(), PT13 param13=PT13(), PT14 param14=PT14(), PT15 param15=PT15(), PT16 param16=PT16(), PT17 param17=PT17(), PT18 param18=PT18(), PT19 param19=PT19()) const |
Calls the encapsulated callback function. More... | |
Callback & | operator= (const Callback &callback) |
Assigns a callback container. More... | |
bool | operator== (const Callback &callback) const |
Returns whether two callback container addressing the same class object and the same local member function. More... | |
bool | operator!= (const Callback &callback) const |
Returns whether two callback container addressing not the same class object or not the same local member function. More... | |
operator bool () const | |
Returns whether this container holds an encapsulated function. More... | |
Static Public Member Functions | |
template<typename CT > | |
static Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 > | create (CT &object, typename MemberFunctionPointerMaker< CT, RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::Type function) |
Creates a new callback container for a member function. More... | |
static Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 > | createStatic (typename StaticFunctionPointerMaker< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::Type function) |
Creates a new callback container for a static function. More... | |
Private Member Functions | |
Callback (FunctionBase< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 > *base) | |
Creates a new function container by a given base function. More... | |
Private Attributes | |
FunctionBase< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 > * | callbackFunction |
Base function container. More... | |
This class implements a container for callback functions.
Use this callback container to encapsulate callback functions to static functions or member functions (of classes).
For member functions, this class is independent from the function's owner (class) and therefore can be stored without the definition of the class type.
This template class holds several template parameters, all specifying return and function parameter types.
RT | Specifies the return type of the callback function |
PT0 | Specifies the 1st possible function parameter type |
PT1 | Specifies the 2rd possible function parameter type |
PT2 | Specifies the 3rd possible function parameter type |
PT3 | Specifies the 4th possible function parameter type |
PT4 | Specifies the 5th possible function parameter type |
PT5 | Specifies the 6th possible function parameter type |
PT6 | Specifies the 7th possible function parameter type |
PT7 | Specifies the 8th possible function parameter type |
PT8 | Specifies the 9th possible function parameter type |
PT9 | Specifies the 10th possible function parameter type |
PT10 | Specifies the 11th possible function parameter type |
PT11 | Specifies the 12th possible function parameter type |
PT12 | Specifies the 13th possible function parameter type |
PT13 | Specifies the 14th possible function parameter type |
PT14 | Specifies the 15th possible function parameter type |
PT15 | Specifies the 16th possible function parameter type |
PT16 | Specifies the 17th possible function parameter type |
PT17 | Specifies the 18th possible function parameter type |
PT18 | Specifies the 19th possible function parameter type |
PT19 | Specifies the 20th possible function parameter type |
See the following code tutorial:
typedef PT0 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType0 |
Definition of the 1st parameter type of this callback object.
typedef PT1 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType1 |
Definition of the 2rd parameter type of this callback object.
typedef PT10 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType10 |
Definition of the 11th parameter type of this callback object.
typedef PT11 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType11 |
Definition of the 12th parameter type of this callback object.
typedef PT12 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType12 |
Definition of the 13th parameter type of this callback object.
typedef PT13 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType13 |
Definition of the 14th parameter type of this callback object.
typedef PT14 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType14 |
Definition of the 15th parameter type of this callback object.
typedef PT15 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType15 |
Definition of the 16th parameter type of this callback object.
typedef PT16 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType16 |
Definition of the 17th parameter type of this callback object.
typedef PT17 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType17 |
Definition of the 18th parameter type of this callback object.
typedef PT18 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType18 |
Definition of the 19th parameter type of this callback object.
typedef PT19 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType19 |
Definition of the 20th parameter type of this callback object.
typedef PT2 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType2 |
Definition of the 3rd parameter type of this callback object.
typedef PT3 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType3 |
Definition of the 4th parameter type of this callback object.
typedef PT4 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType4 |
Definition of the 5th parameter type of this callback object.
typedef PT5 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType5 |
Definition of the 6th parameter type of this callback object.
typedef PT6 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType6 |
Definition of the 7th parameter type of this callback object.
typedef PT7 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType7 |
Definition of the 8th parameter type of this callback object.
typedef PT8 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType8 |
Definition of the 9th parameter type of this callback object.
typedef PT9 Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ParameterType9 |
Definition of the 10th parameter type of this callback object.
typedef RT Ocean::Callback< RT, PT0, PT1, PT2, PT3, PT4, PT5, PT6, PT7, PT8, PT9, PT10, PT11, PT12, PT13, PT14, PT15, PT16, PT17, PT18, PT19 >::ReturnType |
Definition of the return type of this callback object.
|
inline |
Creates an empty callback container.
|
inline |
Copies a callback container.
callback | The callback container to copy |
|
inline |
Creates a new callback container for a member function.
object | Class object holding the member function |
function | Local function pointer of the member function |
|
inlineexplicit |
Creates a new callback container for a static function.
function | Local function pointer of the static function |
|
inlinevirtual |
Destructs a callback container object.
|
inlineexplicitprivate |
Creates a new function container by a given base function.
base | The base function to create a new container form |
|
inlinestatic |
Creates a new callback container for a member function.
object | Class object holding the member function |
function | Local function pointer of the member function |
|
inlinestatic |
Creates a new callback container for a static function.
function | Local function pointer of the static function |
|
inline |
Returns whether this container holds no function.
|
inlineexplicit |
Returns whether this container holds an encapsulated function.
|
inline |
Returns whether two callback container addressing not the same class object or not the same local member function.
callback | Right callback to check |
|
inline |
Calls the encapsulated callback function.
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 |
|
inline |
Assigns a callback container.
callback | The callback container to assign |
|
inline |
Returns whether two callback container addressing the same class object and the same local member function.
callback | Right callback to check |
|
private |
Base function container.