Main Page   Namespace List   Class Hierarchy   Compound List   File List   Header Files   Namespace Members   Compound Members   File Members  

arg::subject Class Reference

Support class "subject" for the GOF observer pattern - the observer interface is supplied as a template parameter. More...

#include <arg_observer.h>

List of all members.


Public Members

 subject ()
subject& add_observer (observer* addee)
subject& remove_observer (observer* removee)
const subject& notify (const notify_strategy& notify) const
Enumerate elements of list passing them to the notify functor.


Detailed Description

template<class observer> class arg::subject

Support class "subject" for the GOF observer pattern - the observer interface is supplied as a template parameter.

The user code is responsible for ensuring that all observer pointers are valid when notify is invoked.

All methods support the strong exception safety guarantee.

Author(s):
Alan Griffiths

Member Function Documentation

template<class observer>
arg::subject<observer>::subject<observer> ()

template<class observer>
subject<observer> & arg::subject<observer>::add_observer (observer * addee) [inline]

Parameters:
addee   pointer to observer, must remain valid while broadcasts are possible.

template<class observer>
subject<observer> & arg::subject<observer>::remove_observer (observer * removee) [inline]

Parameters:
removee   pointer to observer.

template<class observer>
const subject<observer> & arg::subject<observer>::notify (const notify_strategy & notify) const [inline]

Enumerate elements of list passing them to the notify functor.


The documentation for this class was generated from the following file:
Copyright 1999-2000 Alan Griffiths