The INotifier class defines the notification protocol for objects that support observation. Because this class is an abstract base class, you cannot construct objects of this class. It is the responsibility of the derived class to do the actual notifications, even for INotificationId's defined by INotifier. All UI window classes inherit the notification process from INotifier.
You can implement a notification protocol in the following ways:
Because IWindow inherits from and implements the INotifier protocol, IWindow provides a visual implementation. IStandardNotifier inherits from INotifier and can be used for any generic notifier, visual or not. You might want to derive your classes from IStandardNotifier if you are providing a nonvisual notifier.
INotifier objects publish IInterest or INotificationIds for each notification that the derived class provides. You should document the details of these notifications, including if any notifier data is sent with the notification event.
INotifier objects notify their observers of all events after the observer requests notification by calling IObserver::handleNotificationsFor.
Constructors & DestructorYou cannot construct objects of this class because it is an abstract base class.
![]() |
public:
virtual ~INotifier()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
INotifier()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Notification MembersUse these members to affect the ability of INotifier to notify observers of events.
![]() |
public:
virtual INotifier& disableNotification() = 0
Stops the notifier from sending notifications to its observers.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
virtual INotifier& enableNotification( bool enable = true ) = 0
Starts the notifier sending notifications to its observers. This function can be overridden by derived classes to perform customized notification that your application might need. For instance, one of your function methods may require that a database be accessible before processing a retrieve function.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
virtual bool isEnabledForNotification() const = 0
Returns true if a notifier can send notifications to its observers.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
virtual INotifierAddress notifierAddress() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Observer Addition and RemovalIObserver objects use these members to add and remove themselves from the notifier's collection.
![]() |
protected:
virtual INotifier& addObserver( IObserver& observer, const IInterest& interest )
Adds an observer to the notifier's list of observers
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
protected:
virtual INotifier& removeAllObservers() = 0
Removes all observers from the notifier's list of observers.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
Removes an observer from the notifier's list of observers.
protected:
virtual INotifier& removeObserver( IObserver& observer, const IInterest& interest )
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
protected:
virtual INotifier& removeObserver(IObserver& observer) = 0
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Observer NotificationThese members notify observers of a change in a notifier.
![]() |
Notifies all observers interested in a particular notification event.
Each observer receives a notification event containing
the identity of the notifier, the notification address.
Note:
public:
virtual INotifier& notifyObservers( const INotificationEvent& event ) = 0
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
protected:
virtual INotifier& notifyObservers( const INotificationId& id ) = 0
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
public:
virtual INotifier& notifyObserversAsync( const INotificationEvent& event )
The parameters are the following: anEvent - a reference to the INotificationEvent sent to the observers
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
ObsoleteThese members will soon be obsoleted.
![]() |
protected:
virtual IObserverList& observerList( const IInterest* anInterest = 0 ) const = 0
Returns the list of observers. If the observer list does not exist, the derived notifier class must create it before calling this member function.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Thread Information![]() |
public:
const IThreadId& threadId() const
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Miscellaneous Members![]() |
public:
static INotificationId const deleteId
Notification identifier provided to observers when an object derived from
INotifier is deleted. It is the responsibility of the object derived from INotifier
to send this notification. The two derived classes which currently send this
notification are IWindow and IStandardNotifier.
Note:
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
static INotificationId const allChangesId