PTLib
Version 2.18.8
|
Go to the source code of this file.
Classes | |
class | PNotifierFunctionTemplate< ParamType > |
This is an abstract class for which a descendent is declared for every function that may be called. More... | |
class | PNotifierTemplate< ParamType > |
The PNotifier and PNotifierFunction classes build a completely type safe mechanism for calling arbitrary member functions on classes. More... | |
Macros | |
#define | PDECLARE_NOTIFIER_COMMON1(notifierType, notifiee, func, ParamType, BaseClass) |
#define | PDECLARE_NOTIFIER_COMMON2(notifierType, notifierArg, notifiee, func, ParamType, ParamArg, BaseClass) |
#define | PDECLARE_NOTIFIER_COMMON(notifierType, notifierArg, notifiee, func, ParamType, ParamArg, BaseClass) |
#define | PDECLARE_NOTIFIER_EXT(notifierType, notifierArg, notifiee, func, ParamType, ParamArg) PDECLARE_NOTIFIER_COMMON(notifierType, notifierArg, notifiee, func, ParamType, ParamArg, PNotifierFunctionTemplate<ParamType>) |
Declare a notifier object class. More... | |
#define | PDECLARE_NOTIFIER2(notifierType,notifiee, func, ParamType) PDECLARE_NOTIFIER_EXT(notifierType, , notifiee, func, ParamType, ) |
Declare PNotifier derived class with P_INT_PTR parameter. Uses PDECLARE_NOTIFIER_EXT macro. More... | |
#define | PDECLARE_NOTIFIER(notifierType, notifiee, func) PDECLARE_NOTIFIER2(notifierType, notifiee, func, P_INT_PTR) |
Declare PNotifier derived class with P_INT_PTR parameter. Uses PDECLARE_NOTIFIER_EXT macro. More... | |
#define | PCREATE_NOTIFIER2_EXT(obj, notifiee, func, type) notifiee::func##_PNotifier::Create(obj) |
Create a PNotifier object instance. More... | |
#define | PCREATE_NOTIFIER_EXT(obj, notifiee, func) notifiee::func##_PNotifier::Create(obj) |
Create PNotifier object instance with P_INT_PTR parameter. Uses PCREATE_NOTIFIER2_EXT macro. More... | |
#define | PCREATE_NOTIFIER2(func, type) P_DISABLE_MSVC_WARNINGS(4355, func##_PNotifier::Create(this)) |
Create a PNotifier object instance. More... | |
#define | PCREATE_NOTIFIER(func) P_DISABLE_MSVC_WARNINGS(4355, func##_PNotifier::Create(this)) |
Create PNotifier object instance with P_INT_PTR parameter. Uses PCREATE_NOTIFIER2 macro. More... | |
Typedefs | |
typedef PNotifierFunctionTemplate < P_INT_PTR > | PNotifierFunction |
typedef PNotifierTemplate < P_INT_PTR > | PNotifier |
#define PCREATE_NOTIFIER | ( | func | ) | P_DISABLE_MSVC_WARNINGS(4355, func##_PNotifier::Create(this)) |
Create PNotifier object instance with P_INT_PTR parameter. Uses PCREATE_NOTIFIER2 macro.
#define PCREATE_NOTIFIER2 | ( | func, | |
type | |||
) | P_DISABLE_MSVC_WARNINGS(4355, func##_PNotifier::Create(this)) |
Create a PNotifier object instance.
This macro creates an instance of the particular PNotifier
class using the func
parameter as the member function to call.
The this
object is used as the instance to call the function against. The PCREATE_NOTIFIER_EXT
macro may be used if the instance to be called is not the current object instance.
#define PCREATE_NOTIFIER2_EXT | ( | obj, | |
notifiee, | |||
func, | |||
type | |||
) | notifiee::func##_PNotifier::Create(obj) |
Create a PNotifier object instance.
This macro creates an instance of the particular PNotifier
class using the func
parameter as the member function to call.
The obj
parameter is the instance to call the function against. If the instance to be called is the current instance, ie if obj
is this
then the PCREATE_NOTIFIER
macro should be used.
#define PCREATE_NOTIFIER_EXT | ( | obj, | |
notifiee, | |||
func | |||
) | notifiee::func##_PNotifier::Create(obj) |
Create PNotifier object instance with P_INT_PTR parameter. Uses PCREATE_NOTIFIER2_EXT macro.
#define PDECLARE_NOTIFIER | ( | notifierType, | |
notifiee, | |||
func | |||
) | PDECLARE_NOTIFIER2(notifierType, notifiee, func, P_INT_PTR) |
Declare PNotifier derived class with P_INT_PTR parameter. Uses PDECLARE_NOTIFIER_EXT macro.
#define PDECLARE_NOTIFIER2 | ( | notifierType, | |
notifiee, | |||
func, | |||
ParamType | |||
) | PDECLARE_NOTIFIER_EXT(notifierType, , notifiee, func, ParamType, ) |
Declare PNotifier derived class with P_INT_PTR parameter. Uses PDECLARE_NOTIFIER_EXT macro.
#define PDECLARE_NOTIFIER_COMMON | ( | notifierType, | |
notifierArg, | |||
notifiee, | |||
func, | |||
ParamType, | |||
ParamArg, | |||
BaseClass | |||
) |
#define PDECLARE_NOTIFIER_COMMON1 | ( | notifierType, | |
notifiee, | |||
func, | |||
ParamType, | |||
BaseClass | |||
) |
#define PDECLARE_NOTIFIER_COMMON2 | ( | notifierType, | |
notifierArg, | |||
notifiee, | |||
func, | |||
ParamType, | |||
ParamArg, | |||
BaseClass | |||
) |
#define PDECLARE_NOTIFIER_EXT | ( | notifierType, | |
notifierArg, | |||
notifiee, | |||
func, | |||
ParamType, | |||
ParamArg | |||
) | PDECLARE_NOTIFIER_COMMON(notifierType, notifierArg, notifiee, func, ParamType, ParamArg, PNotifierFunctionTemplate<ParamType>) |
Declare a notifier object class.
This macro declares the descendent class of PNotifierFunction
that will be used in instances of PNotifier
created by the PCREATE_NOTIFIER
or PCREATE_NOTIFIER2
macros.
The macro is expected to be used inside a class declaration. The class it declares will therefore be a nested class within the class being declared. The name of the new nested class is derived from the member function name which should guarentee the class names are unique.
The notifier
parameter is the class of the function that will be calling the notification function. The notifiee
parameter is the class to which the called member function belongs. Finally the func
parameter is the name of the member function to be declared.
This macro will also declare the member function itself. This will be:
void func(notifier & n, P_INT_PTR extra) // for PNOTIFIER
void func(notifier & n, void * extra) // for PNOTIFIER2
The implementation of the function is left for the user.
typedef PNotifierTemplate<P_INT_PTR> PNotifier |