PTLib  Version 2.10.11
PSmartNotifieeRegistrar Class Reference

Implements a function similar to the PNotifier, but uses an "id" to link the caller and callee rather than using a pointer. More...

#include <notifier_ext.h>

Public Member Functions

 PSmartNotifieeRegistrar ()
 
 ~PSmartNotifieeRegistrar ()
 
void Init (void *obj)
 
unsigned GetID () const
 

Static Public Member Functions

static unsigned RegisterNotifiee (void *obj)
 
static PBoolean UnregisterNotifiee (unsigned id)
 
static PBoolean UnregisterNotifiee (void *obj)
 
static void * GetNotifiee (unsigned id)
 

Protected Attributes

unsigned m_ID
 

Detailed Description

Implements a function similar to the PNotifier, but uses an "id" to link the caller and callee rather than using a pointer.

This has the advantage that if the pointer becomes invalid, the caller can gracefully fail the notification rather than simply crashing due to an invalid pointer access.

These classes were created to support of the XMPP classes

Constructor & Destructor Documentation

§ PSmartNotifieeRegistrar()

PSmartNotifieeRegistrar::PSmartNotifieeRegistrar ( )
inline

§ ~PSmartNotifieeRegistrar()

PSmartNotifieeRegistrar::~PSmartNotifieeRegistrar ( )
inline

References m_ID, and UnregisterNotifiee().

Member Function Documentation

§ GetID()

unsigned PSmartNotifieeRegistrar::GetID ( ) const
inline

§ GetNotifiee()

static void* PSmartNotifieeRegistrar::GetNotifiee ( unsigned  id)
static

§ Init()

void PSmartNotifieeRegistrar::Init ( void *  obj)
inline

References m_ID, and RegisterNotifiee().

§ RegisterNotifiee()

static unsigned PSmartNotifieeRegistrar::RegisterNotifiee ( void *  obj)
static

Referenced by GetID(), and Init().

§ UnregisterNotifiee() [1/2]

static PBoolean PSmartNotifieeRegistrar::UnregisterNotifiee ( unsigned  id)
static

Referenced by GetID(), and ~PSmartNotifieeRegistrar().

§ UnregisterNotifiee() [2/2]

static PBoolean PSmartNotifieeRegistrar::UnregisterNotifiee ( void *  obj)
static

Member Data Documentation

§ m_ID

unsigned PSmartNotifieeRegistrar::m_ID
protected

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