A mixin for maintaining a reference count associated with an object, and destroying that object when the count falls to zero. More...
#include <RefCounted.h>
Public Member Functions | |
Lifecycle | |
RefCounted () | |
Default constructor. | |
virtual | ~RefCounted () |
Virtual destructor. | |
Reference counting | |
void | IncRef () |
Increment reference count. | |
void | DecRef () |
Decrement reference count, and self-delete if count is <= 0. |
Private Attributes | |
int | _refCount |
Reference count. |
A mixin for maintaining a reference count associated with an object, and destroying that object when the count falls to zero.
Since this class implements the IncRef and DecRef interfaces used by the Radiant SmartPointer and SmartReference templates, those templates can automatically handle the reference counting for classes that inherit from RefCounted.
RefCounted::RefCounted | ( | ) |
Default constructor.
Initialize reference count to zero.