![]() |
Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
|
Base class for reference counted object. More...
#include <ref_counted.h>
Public Member Functions | |
RefCounted () | |
Initialization with default allocation policy. | |
RefCounted (const AllocationPolicy &policy) | |
Initialization with arbitrary allocation policy. | |
long | getref () const |
Get reference counter. | |
void | incref () const |
Increment reference counter. | |
void | decref () const |
Decrement reference counter. | |
Base class for reference counted object.
Allows to increment and decrement reference counter. When the counter reaches zero, the object is automatically destroyed.
T | defines the derived class. |
AllocationPolicy | defies destroy policy. |
When reference counter becomes zero, AllocationPolicy::destroy() is invoked by RefCounted to destroy itself.
Inherits AllocationPolicy to make its methods available in the derived class.
Thread-safe.
Definition at line 38 of file ref_counted.h.
|
inline |
Initialization with default allocation policy.
Definition at line 42 of file ref_counted.h.
|
inlineexplicit |
Initialization with arbitrary allocation policy.
Definition at line 48 of file ref_counted.h.
|
inline |
Definition at line 53 of file ref_counted.h.
|
inline |
Decrement reference counter.
Definition at line 78 of file ref_counted.h.
|
inline |
Get reference counter.
Definition at line 62 of file ref_counted.h.
|
inline |
Increment reference counter.
Definition at line 67 of file ref_counted.h.