Logo Search packages:      
Sourcecode: icu version File versions  Download package

ICUNotifier Class Reference

#include <servnotf.h>

Inheritance diagram for ICUNotifier:

UMemory ICUService

List of all members.


Detailed Description

Abstract implementation of a notification facility. Clients add EventListeners with addListener and remove them with removeListener. Notifiers call notifyChanged when they wish to notify listeners. This queues the listener list on the notification thread, which eventually dequeues the list and calls notifyListener on each listener in the list.

Subclasses override acceptsListener and notifyListener to add type-safe notification. AcceptsListener should return true if the listener is of the appropriate type; ICUNotifier itself will ensure the listener is non-null and that the identical listener is not already registered with the Notifier. NotifyListener should cast the listener to the appropriate type and call the appropriate method on the listener.

Definition at line 72 of file servnotf.h.


Public Member Functions

virtual void addListener (const EventListener *l, UErrorCode &status)
virtual void notifyChanged (void)
virtual void removeListener (const EventListener *l, UErrorCode &status)

Static Public Member Functions

static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Protected Member Functions

virtual UBool acceptsListener (const EventListener &l) const =0
virtual void notifyListener (EventListener &l) const =0

Private Attributes

UVectorlisteners
UMTX notifyLock

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

Generated by  Doxygen 1.6.0   Back to index