Overview | Modules | Class Hierarchy | Classes | Members

# tlp::Observable Class Reference

`#include <Observable.h>`

Inherited by tlp::ColorScale, tlp::Graph, and tlp::PropertyInterface.

Inheritance diagram for tlp::Observable:

[legend]
List of all members.

## Detailed Description

All instances of that class can be observed by by an instance of the Observer class.

## Public Member Functions

- virtual ~Observable ()
- void addObserver (Observer *)
- unsigned int countObservers ()
- void removeObserver (Observer *)
- void removeObservers ()
- void notifyObservers ()
- void notifyDestroy ()

## Static Public Member Functions

- static void holdObservers ()
- static void unholdObservers ()

## Protected Member Functions

- void removeOnlyObserver (Observer *)

## Protected Attributes

- stdext::slist< Observer * > observersList

## Static Protected Attributes

- static int holdCounter
- static ObserverMap holdObserverMap
- static ObservableMap holdObservableMap

## Friends

- class Observer

## Constructor & Destructor Documentation

virtual tlp::Observable::~Observable | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

void tlp::Observable::addObserver | ( | Observer * |  | ) |

| Register a new observer

unsigned int tlp::Observable::countObservers | ( |  | ) | `[inline]`

| Returns the number of observers

static void tlp::Observable::holdObservers | ( |  | ) | `[static]`

| Queue notifications

void tlp::Observable::notifyDestroy | ( |  | ) |

| Notify all the observers that the object will be destroyed. Need to be called into the destructor of the observable. Reimplemented in tlp::Graph.

void tlp::Observable::notifyObservers | ( |  | ) |

| Notify all the observers

void tlp::Observable::removeObserver | ( | Observer * |  | ) | `[inline]`

| Remove an observer

void tlp::Observable::removeObservers | ( |  | ) |

| Remove all observers

void tlp::Observable::removeOnlyObserver | ( | Observer * |  | ) | `[inline, protected]`

static void tlp::Observable::unholdObservers | ( |  | ) | `[static]`

| UnQueue notifications

## Friends And Related Function Documentation

friend class Observer `[friend]`

## Member Data Documentation

int tlp::Observable::holdCounter `[static, protected]`

ObservableMap tlp::Observable::holdObservableMap `[static, protected]`

ObserverMap tlp::Observable::holdObserverMap `[static, protected]`

stdext::slist<Observer*> tlp::Observable::observersList `[protected]`

Tulip Software by LaBRI Visualization Team 2001 - 2010