notifier.h File Reference Main Page Namespace List Class Hierarchy Compound List File List Compound Members File Members notifier.h File Reference#include <ptlib.h> #include <ptlib/smartptr.h> Go to the source code of this file. Compounds class PNotifier class PNotifierFunction Defines #define PDECLARE_NOTIFIER(notifier, notifiee, func) #define PCREATE_NOTIFIER2(obj, func) PNotifier(new func##_PNotifier(obj)) #define PCREATE_NOTIFIER(func) PCREATE_NOTIFIER2(this, func) Define Documentation #define PCREATE_NOTIFIER ( func ) PCREATE_NOTIFIER2(this, func) Create a notifier 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_NOTIFIER2# macro may be used if the instance to be called is not the current object instance. #define PCREATE_NOTIFIER2 ( obj, func ) PNotifier(new func##_PNotifier(obj)) Create a notifier 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 obj# is to this# the the PCREATE_NOTIFIER# macro should be used. #define PDECLARE_NOTIFIER ( notifier, notifiee, func ) Value:class func##_PNotifier : public PNotifierFunction { \ public: \ func##_PNotifier(notifiee * obj) : PNotifierFunction(obj) { } \ virtual void Call(PObject & note, INT extra) const \ { ((notifiee*)object)->func((notifier &)note, extra); } \ }; \ friend class func##_PNotifier; \ virtual void func(notifier & note, INT extra)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: \begin{verbatim} void func(notifier & n, INT extra) \end{verbatim} The implementation of the function is left for the user. Generated on Wed Sep 29 22:44:12 2004 for PWLib by width=110 height=53>1.2.18