gatb.core-API-1.4.2
IObserver Class Referenceabstract

Interface of the Observer Design Pattern. More...

#include <IObserver.hpp>

Public Member Functions

virtual ~IObserver ()
 
virtual void update (EventInfo *evt, ISubject *subject)=0
 

Detailed Description

Interface of the Observer Design Pattern.

The Observer Design Pattern is an object oriented way for managing a notification system in a software. This is an extremely useful pattern because it allows the communication between software components without having strong dependencies between them.

For instance, a tool sends notifications about its progression. This is useful for potential clients that want to know whether they have to wait a long time before the algorithm finishes. The important point is that a tool is not polluted by clients concerns, it just notifies some information, without even know who in particular will receive the information.

This interface merely defines an 'update' method that can be called by some subjects for telling that some notification is occurring. Some information can be provided to the IObserver instance through an EventInfo instance.

Note that the subject that initiated the notification is also provided to the observer. This may be useful for discriminating some unwanted behavior, for instance the IObserver being itself the subject.

See also
ISubject
EventInfo
IterationStatusEvent

Constructor & Destructor Documentation

virtual ~IObserver ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void update ( EventInfo evt,
ISubject subject 
)
pure virtual

Method called by Subject for some notification.

Parameters
[in]evt: specific information related to the notification.
[in]subject: the subject (ie. the caller of the 'update' method).

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