#include <yateclass.h>
Inheritance diagram for RefObject:
Public Member Functions | |
RefObject () | |
virtual | ~RefObject () |
virtual bool | alive () const |
bool | ref () |
bool | deref () |
int | refcount () const |
virtual void | destruct () |
Protected Member Functions | |
virtual void | zeroRefs () |
bool | resurrect () |
|
The constructor initializes the reference counter to 1! Use deref() to destruct the object when safe |
|
Destructor. |
|
Check if the object is still referenced and safe to access. Note that you should not trust this result unless the object is locked by other means.
Reimplemented from GenObject. |
|
Decrements the reference counter, destroys the object if it reaches zero // Deref this object, return quickly if the object was deleted if (deref()) return;
|
|
Refcounted objects should just have the counter decremented. That will destroy them only when the refcount reaches zero. Reimplemented from GenObject. |
|
Increments the reference counter if not already zero
|
|
Get the current value of the reference counter
|
|
Bring the object back alive by setting the reference counter to one. Note that it works only if the counter was zero previously
|
|
This method is called when the reference count reaches zero. The default behaviour is to delete the object. Reimplemented in Channel. |