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:
- Derive a class from the IStandardNotifier class, which inherits from INotifier, for a direct implementation of
the INotifier protocol
- Derive from the INotifier class and implement your own notification protocol
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.
- ~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 |
- 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.
- 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.
- disableNotification
public:
virtual IStandardNotifier& disableNotification()
- Stops the object from sending notifications to registered observers.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- enableNotification
public:
virtual IStandardNotifier&
enableNotification( bool enable = true )
- Starts the sending of notifications to observers.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- 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 |
- 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.
- 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 |
- removeAllObservers
protected:
virtual IStandardNotifier& removeAllObservers()
- Removes all observers from the object's observer list.
- Supported Platforms
| Windows |
OS/2 |
AIX |
| Yes |
Yes |
Yes |
- 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.
- 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 |
- 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.
- 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
-
virtual ~INotifier()
virtual INotifier& disableNotification() = 0
virtual INotifier&
enableNotification( bool enable = true ) = 0
INotifier()
virtual bool isEnabledForNotification() const = 0
virtual INotifier&
notifyObservers( const INotificationEvent& event ) = 0
virtual INotifier&
notifyObserversAsync( const INotificationEvent& event )
const IThreadId& threadId() const
Inherited Public Data
- INotifier
-
Inherited Protected Functions
- INotifier
-
Inherited Protected Data