Main Page   Class Hierarchy   Data Structures   File List   Data Fields  

Observer Class Reference

#include <Observer.h>

Inheritance diagram for Observer:

Inheritance graph
[legend]

Public Member Functions

virtual ~Observer ()
virtual void update (const Subject *const subject)=0

Protected Member Functions

 Observer ()

Detailed Description

The base definitions for the Observer (aka Publisher--Subscriber) pattern. This implementation is a small evolution of the code from the "Gang of Four" book.

An Observer just has to be able to be notified that there need to be an update. The constructor is protected to stop any instances of this class being constructed.

Although we could use a vector for this, we use a list so that when we remove an item from the middle of the sequence we do not have the overhead of moving items.

Version: 1.1 1999.10.02

Author:
Russel Winder

Definition at line 24 of file Observer.h.


Constructor & Destructor Documentation

virtual Observer::~Observer   [inline, virtual]
 

destructor (virtual).

Definition at line 28 of file Observer.h.

Observer::Observer   [inline, protected]
 

constructor (empty).

Definition at line 36 of file Observer.h.


Member Function Documentation

virtual void Observer::update const Subject *const    subject [pure virtual]
 

Update method is called everytime a Observer calls notify().

Parameters:
subject the Subject object

Implemented in GStockCalc, and StockGui.


The documentation for this class was generated from the following file:
Generated on Tue May 27 21:24:04 2003 for gstockcalc by doxygen1.3-rc3