osg::ObserverSet Class Reference

`#include <Observer>`

Inheritance diagram for osg::ObserverSet:

## Public Types

typedef std::set< Observer * > | Observers

## Public Member Functions

| ObserverSet (const Referenced *observedObject)
Referenced * | getObserverdObject ()
const Referenced * | getObserverdObject () const
Referenced * | addRefLock ()
OpenThreads::Mutex * | getObserverSetMutex () const
void | addObserver (Observer *observer)
void | removeObserver (Observer *observer)
void | signalObjectDeleted (void *ptr)
Observers & | getObservers ()
const Observers & | getObservers () const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
virtual void | setThreadSafeRefUnref (bool)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Protected Member Functions

| ObserverSet (const ObserverSet &rhs)
ObserverSet & | operator= (const ObserverSet &)
virtual | ~ObserverSet ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const

## Protected Attributes

OpenThreads::Mutex | _mutex
Referenced * | _observedObject
Observers | _observers
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Additional Inherited Members

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()

## Detailed Description

Class used by osg::Referenced to track the observers associated with it.

## Member Typedef Documentation

## Observers

typedef std::set<Observer*> osg::ObserverSet::Observers

## Constructor & Destructor Documentation

## ObserverSet() [1/2]

osg::ObserverSet::ObserverSet | ( | const Referenced * | observedObject | ) |

References osg::Referenced::Referenced().

Referenced by ObserverSet(), and operator=().

## ObserverSet() [2/2]

osg::ObserverSet::ObserverSet | ( | const ObserverSet & | rhs | ) |

inline protected

References ObserverSet(), and osg::Referenced::Referenced().

## ~ObserverSet()

virtual osg::ObserverSet::~ObserverSet | ( |  | ) |

protected virtual

## Member Function Documentation

## addObserver()

void osg::ObserverSet::addObserver | ( | Observer * | observer | ) |

## addRefLock()

Referenced * osg::ObserverSet::addRefLock | ( |  | ) |

"Lock" a Referenced object i.e., protect it from being deleted by incrementing its reference count.

returns null if object doesn't exist anymore.

References osg::Referenced::Referenced().

## getObserverdObject() [1/2]

Referenced * osg::ObserverSet::getObserverdObject | ( |  | ) |

inline

References _observedObject, and osg::Referenced::Referenced().

## getObserverdObject() [2/2]

const Referenced * osg::ObserverSet::getObserverdObject | ( |  | ) | const

inline

References _observedObject, and osg::Referenced::Referenced().

## getObservers() [1/2]

Observers & osg::ObserverSet::getObservers | ( |  | ) |

inline

References _observers.

## getObservers() [2/2]

const Observers & osg::ObserverSet::getObservers | ( |  | ) | const

inline

References _observers.

## getObserverSetMutex()

OpenThreads::Mutex * osg::ObserverSet::getObserverSetMutex | ( |  | ) | const

inline

References _mutex.

## operator=()

ObserverSet & osg::ObserverSet::operator= | ( | const ObserverSet & |  | ) |

inline protected

References ObserverSet().

## removeObserver()

void osg::ObserverSet::removeObserver | ( | Observer * | observer | ) |

## signalObjectDeleted()

void osg::ObserverSet::signalObjectDeleted | ( | void * | ptr | ) |

## Member Data Documentation

## _mutex

OpenThreads::Mutex osg::ObserverSet::_mutex

mutable protected

Referenced by getObserverSetMutex().

## _observedObject

Referenced* osg::ObserverSet::_observedObject

protected

Referenced by getObserverdObject(), and getObserverdObject().

## _observers

Observers osg::ObserverSet::_observers

protected

Referenced by getObservers(), and getObservers().

The documentation for this class was generated from the following file:

- Observer