The IObserver class is the abstract base class for all objects that are to be notified of changes in the state of other objects in the system. Connection objects are derived from this class to connect notifiers with a designated target object. Typically you use an IObserverConnection or an IObserverConnectionTo to wire your class for notifications.
You can create your own connection objects by deriving from this class and implementing the function dispatchNotificationEvent to process specific events.
Only derived classes can create objects of this class. To enforce this, the only constructor has protected access.
![]() |
protected:
IObserver()
The default constructor.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Members to access properties of object.
![]() |
public:
const IThreadId& threadId() const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to evaluate events and determine if it is appropriate for an observer object to process them. These members also attach the observer to and detach the observer from the INotifier object.
![]() |
public:
virtual IObserver& handleNotificationsFor(IInterest&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual IObserver& handleNotificationsFor( INotifier&, const INotificationId& id )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual IObserver& handleNotificationsFor( INotifier& notifier, const IEventData& userData = IEventData ( ) )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
Detaches the observer from the INotifier object. If the observer is handling notifications, this method should be called before the observer is destructed.
public:
virtual IObserver& stopHandlingNotificationsFor( const IInterest& )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual IObserver& stopHandlingNotificationsFor( INotifier&, const INotificationId& id )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual IObserver& stopHandlingNotificationsFor( INotifier& notifier )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
protected:
virtual IObserver& dispatchNotificationEvent( const INotificationEvent& event ) = 0
A notifier calls this dispatch method after the observer has registered to receive events.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
These will soon be obsoleted.
![]() |
public:
virtual IObserver& handleNotificationsFor( INotifier& notifier, const IEventData& userData = IEventData ( ) )
Windows | OS/2 | AIX |
Yes | Yes | Yes |
INotificationProcessor* requestProcessor()