Laxkit
0.0.7.1
|
A minimal refcounted object. More...
Public Member Functions | |
virtual | ~RefCounted () |
Empty virtual destructor. | |
virtual int | inc_count () |
Increment the data's count by 1. Returns count. | |
virtual int | dec_count () |
Decrement the count of the data, deleting if count is less than or equal to 0. | |
virtual int | the_count () |
Public Attributes | |
int | suppress_debug |
Protected Attributes | |
int | _count |
The reference count of the object. |
A minimal refcounted object.
Provides inc_count() and dec_count() for reference counting. Objects are created with a count of 1.
|
virtual |
Decrement the count of the data, deleting if count is less than or equal to 0.
Returns the count. If 0 is returned, the item is gone, and should not be accessed any more.
|
protected |
The reference count of the object.
Controlled with inc_count() and dec_count(). When the count is less or equal to 0, then object has 'delete this' called. See dec_count() for more.