#include <referenced.h>
Inheritance diagram for openalpp::Referenced:
Public Member Functions | |
Referenced () | |
Referenced (const Referenced &) | |
Referenced & | operator= (const Referenced &) |
void | ref () const |
void | unref () const |
void | unref_nodelete () const |
int | referenceCount () const |
Static Public Member Functions | |
static void | setDeleteHandler (DeleteHandler *handler) |
static DeleteHandler * | getDeleteHandler () |
Protected Member Functions | |
virtual | ~Referenced () |
Protected Attributes | |
int | _refCount |
Friends | |
class | DeleteHandler |
openalpp::Referenced::Referenced | ( | ) | [inline] |
openalpp::Referenced::Referenced | ( | const Referenced & | ) | [inline] |
virtual openalpp::Referenced::~Referenced | ( | ) | [protected, virtual] |
static DeleteHandler* openalpp::Referenced::getDeleteHandler | ( | ) | [static] |
Get a DeleteHandler.
Referenced& openalpp::Referenced::operator= | ( | const Referenced & | ) | [inline] |
void openalpp::Referenced::ref | ( | ) | const [inline] |
increment the reference count by one, indicating that this object has another pointer which is referencing it.
int openalpp::Referenced::referenceCount | ( | ) | const [inline] |
return the number pointers currently referencing this object.
static void openalpp::Referenced::setDeleteHandler | ( | DeleteHandler * | handler | ) | [static] |
Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
void openalpp::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 openalpp::Referenced::unref_nodelete | ( | ) | const [inline] |
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] |
int openalpp::Referenced::_refCount [mutable, protected] |