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

Monitor::Utility::Watchable Class Reference

Base class implementing watchable object behaviour. More...

#include <watchble.h>

List of all members.

Public Methods

 Watchable ()
 Constructor. More...

virtual ~Watchable ()
 Destructor. More...

const CallbackBaseaddWatch (const CallbackBase &newWatch) const
 Add a callback to be invoked when the watchable object is updated. More...

void removeWatch (const CallbackBase &oldWatch) const
 Remove a callback to be invoked when the watchable object is updated. More...

void removeWatcher (const void *watcher) const
 Remove all callbacks with a given target object. More...

virtual void updated (const void *updateData=0) const
 Invoke all callbacks in list. More...

void freeze () const
 Disable invocation of callbacks on update. More...

void thaw () const
 Enable invocation of callbacks on update. More...


Private Attributes

CallbackList * watchList
 List of callbacks to be invoked when the watchable object is updated. More...

int frozen
 Flag to indicate updates shouldn't invoke callbacks. More...


Detailed Description

Base class implementing watchable object behaviour.

Definition at line 51 of file watchble.h.


Constructor & Destructor Documentation

Watchable::Watchable  
 

Constructor.

Definition at line 47 of file watchble.cpp.

Watchable::~Watchable   [virtual]
 

Destructor.

Definition at line 57 of file watchble.cpp.

References watchList.


Member Function Documentation

const CallbackBase & Watchable::addWatch const CallbackBase   newWatch const
 

Add a callback to be invoked when the watchable object is updated.

Parameters:
newWatch  Callback to add to list.
Returns:
Callback added to list.

Definition at line 68 of file watchble.cpp.

References watchList.

void Watchable::freeze   const
 

Disable invocation of callbacks on update.

Definition at line 117 of file watchble.cpp.

References frozen.

void Watchable::removeWatch const CallbackBase   oldWatch const
 

Remove a callback to be invoked when the watchable object is updated.

Parameters:
oldWatch  Callback to remove from list.

Definition at line 81 of file watchble.cpp.

References watchList.

void Watchable::removeWatcher const void *    watcher const
 

Remove all callbacks with a given target object.

Parameters:
watcher  Object for which callbacks are to be to removed.

Definition at line 92 of file watchble.cpp.

References watchList.

void Watchable::thaw   const
 

Enable invocation of callbacks on update.

Definition at line 128 of file watchble.cpp.

References frozen.

void Watchable::updated const void *    updateData = 0 const [virtual]
 

Invoke all callbacks in list.

Parameters:
updateData  Optional data to pass to callbacks.

Definition at line 103 of file watchble.cpp.

References frozen, and watchList.


Member Data Documentation

int Monitor::Utility::Watchable::frozen [private]
 

Flag to indicate updates shouldn't invoke callbacks.

Definition at line 121 of file watchble.h.

Referenced by freeze, thaw, and updated.

CallbackList* Monitor::Utility::Watchable::watchList [private]
 

List of callbacks to be invoked when the watchable object is updated.

Definition at line 116 of file watchble.h.

Referenced by addWatch, removeWatch, removeWatcher, updated, and ~Watchable.


Generated on Wed Oct 29 21:30:12 2003 for Utility C++ by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002