Inheritance diagram for osg::Referenced:
Public Member Functions | |
Referenced () | |
Referenced (bool threadSafeRefUnref) | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
void | setThreadSafeRefUnref (bool threadSafe) |
bool | getThreadSafeRefUnref () const |
void | ref () const |
void | unref () const |
void | unref_nodelete () const |
int | referenceCount () const |
void | addObserver (Observer *observer) |
void | removeObserver (Observer *observer) |
Static Public Member Functions | |
static void | setThreadSafeReferenceCounting (bool enableThreadSafeReferenceCounting) |
static bool | getThreadSafeReferenceCounting () |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
Protected Member Functions | |
virtual | ~Referenced () |
Protected Attributes | |
OpenThreads::Mutex * | _refMutex |
int | _refCount |
void * | _observers |
Friends | |
class | DeleteHandler |
osg::Referenced::Referenced | ( | ) |
osg::Referenced::Referenced | ( | bool | threadSafeRefUnref | ) | [explicit] |
osg::Referenced::Referenced | ( | const Referenced & | ) |
virtual osg::Referenced::~Referenced | ( | ) | [protected, virtual] |
void osg::Referenced::addObserver | ( | Observer * | observer | ) |
static DeleteHandler* osg::Referenced::getDeleteHandler | ( | ) | [static] |
Get a DeleteHandler.
static bool osg::Referenced::getThreadSafeReferenceCounting | ( | ) | [static] |
Get whether reference counting is active.
bool osg::Referenced::getThreadSafeRefUnref | ( | ) | const [inline] |
Referenced& osg::Referenced::operator= | ( | const Referenced & | ) | [inline] |
void osg::Referenced::ref | ( | ) | const [inline] |
Increment the reference count by one, indicating that this object has another pointer which is referencing it.
int osg::Referenced::referenceCount | ( | ) | const [inline] |
Return the number pointers currently referencing this object.
void osg::Referenced::removeObserver | ( | Observer * | observer | ) |
static void osg::Referenced::setDeleteHandler | ( | DeleteHandler * | handler | ) | [static] |
Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
static void osg::Referenced::setThreadSafeReferenceCounting | ( | bool | enableThreadSafeReferenceCounting | ) | [static] |
Set whether reference counting should be use a mutex to create thread reference counting.
void osg::Referenced::setThreadSafeRefUnref | ( | bool | threadSafe | ) |
void osg::Referenced::unref | ( | ) | const [inline] |
Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
void osg::Referenced::unref_nodelete | ( | ) | const |
Decrement the reference count by one, indicating that a pointer to this object is referencing it. However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be resonsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
friend class DeleteHandler [friend] |
void* osg::Referenced::_observers [protected] |
int osg::Referenced::_refCount [mutable, protected] |
OpenThreads::Mutex* osg::Referenced::_refMutex [mutable, protected] |