IStandardNotifier

The IStandardNotifier class provides a direct implementation of the notification protocol in the INotifier class.

You can implement a notification protocol in the following way:

Because IWindow inherits from and implements the INotifier protocol, IWindow provides a visual notification implementation. IStandardNotifier inherits from INotifier and can be used for any generic notifier, without the visual interface available in IWindow objects. You might want to derive your classes from IStandardNotifier if you are providing a nonvisual notifier.


IStandardNotifier - Member Functions and Data by Group

Constructors & Destructor

You can construct, destruct, assign, and copy objects of this class.


[view class]
~IStandardNotifier
public:
virtual ~IStandardNotifier()
Destructing an IStandardNotifier will cause a deleteId notification to be sent to any registered observers. Therefore, it is important that any observers that no longer exist have unregistered themselves from this notifier. Otherwise an error will occur when this notifier tries to notify a non-existent observer.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IStandardNotifier
Constructs IStandardNotifier objects.


Overload 1
public:
IStandardNotifier()
You can construct objects of this class using the default constructor that takes no arguments.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
public:
IStandardNotifier(const IStandardNotifier& copy)
You can construct an IStandardNotifier object using a copy of an existing IStandardNotifier object.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Assignment

This member supports assignment.


[view class]
operator =
public:
IStandardNotifier& operator =( const IStandardNotifier& aStandardNotifier )
Assigns the contents of one notifier object to another.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Notification Members

Use these members to affect the ability of a part to notify observers of events of interest.


[view class]
disableNotification
public:
virtual IStandardNotifier& disableNotification()
Stops the object from sending notifications to registered observers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
enableNotification
public:
virtual IStandardNotifier& enableNotification( bool enable = true )
Starts the sending of notifications to observers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
isEnabledForNotification
public:
virtual bool isEnabledForNotification() const
Returns true if an object is sending notifications to its observers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
notifierAddress
public:
virtual INotifierAddress notifierAddress() const
Returns the notifier address which identifies this notifier.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Observer Addition and Removal

Use these members to manage the collection of observers maintained by the notifier.


[view class]
addObserver
protected:
virtual IStandardNotifier& addObserver( IObserver& observer, const IInterest& interest )
Adds an observer to the object's list of observers.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removeAllObservers
protected:
virtual IStandardNotifier& removeAllObservers()
Removes all observers from the object's observer list.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
removeObserver
Removes an observer from the object's observer list.


Overload 1
protected:
virtual IStandardNotifier& removeObserver( IObserver& observer, const IInterest& interest )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
protected:
virtual IStandardNotifier& removeObserver( IObserver& observer )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Observer Notification

These members notify observers of a change in a notifier.


[view class]
notifyObservers
Notifies all observers interested in the notification event.


Note: A public and a protected version of notifyObservers are provided for convenience. The protected version does not require the caller to construct an INotificationEvent to call it. In this case, the construction of the INotificationEvent object occurs in the code of the protected notifyObservers function.


Overload 1
public:
virtual IStandardNotifier& notifyObservers( const INotificationEvent& anEvent )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Overload 2
protected:
virtual IStandardNotifier& notifyObservers( const INotificationId& nId )

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
notifyObserversAsync
public:
virtual IStandardNotifier& notifyObserversAsync( const INotificationEvent& anEvent )
Asynchronously notifies all observers interested in the notification event. Each registered observer must live in a thread which supports asynchronous notifications.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Obsolete

These members will soon be obsolete.


[view class]
observerList
protected:
virtual IObserverList& observerList( const IInterest* anInterest = 0 ) const
Returns the list of IObservers. The list is created it if it does not exist.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IStandardNotifier - Inherited Member Functions and Data

Inherited Public Functions

INotifier

Inherited Public Data

INotifier

Inherited Protected Functions

INotifier

Inherited Protected Data