|void||addRef () const|
|void||releaseRef () const|
|size_t||getReferenceCount () const|
|static void||dumpDbgAllRefCount ()|
Referable is an abstract class that provides object lifetime management feature using reference count. On the first time the object is created, it's reference count is 1. This means someone is referring to the object. And then another one may want to refer to the object, then it increments the reference count by calling addRef. If a referrer no longer need to refer it, it should call releaseRef, releaseRef decrements the reference count. If the reference count becomes 0, then the object is released (deleted).
The Referable class uses thread-safe increment/decrement mechanism.
The constructor resets the reference count to 0.
This method increments the reference count.
For internal uses only.
This method obtains the current reference count of the instance. For thread-safety, you should not depend on this method.
This method decrements the reference count and if the reference count becomes 0, it also delete the instance.