Observer

The pure virtual class Observer defines an interface for the observers in the observer pattern.

It has to be used together with the Observable class.

Code:

Public Methods

notify

virtual void notify(Observable *pObs, int iType, const void *pCom)=0;
pObs

Pointer to the observed object.

iType

Type of the notification (an integer).

pCom

Pointer to some data which has to be cast to the correct type.

This method is called by an Observable object.