#include <refCount.h>
Inheritance diagram for RefCount::
Public Methods | |
virtual | ~RefCount () |
Destructor. It does nothing. | |
void | addRef () |
Reference count incrementation. More... | |
void | releaseRef () |
Reference count decrementation. More... | |
virtual void | destroy () |
Suicide. More... | |
Protected Methods | |
RefCount () | |
Default _PROTECTED_ constructor. | |
Private Attributes | |
int | _count |
number of references to this object. |
Each class, which needs reference counting, must be a descendant of this class (or must implement it by itself). It was mainly created to be used by ListItem class in list and hashtable implementations.
Note: there is a big difference between this implementation and usual ones. When reference count of the object decreases to zero, it is not destroyed. Special destroy() method must be called.
Definition at line 51 of file refCount.h.
|
Reference count incrementation. This method increments number of references.
Definition at line 75 of file refCount.h. Referenced by ListItem::add().
|
|
Suicide. In case the number of references is zero, this method destroys the instance it was called for. The object should be created dynamically ;-) Definition at line 88 of file refCount.h. |
|
Reference count decrementation. This method decrements number of references.
Definition at line 82 of file refCount.h. Referenced by ListItem::remove().
|