DCMTK
Version 3.6.4
OFFIS DICOM Toolkit
|
Class to count number of instances (objects created from a certain class). More...
Public Member Functions | |
void | addReference () |
add a reference. More... | |
void | removeReference () |
remove a reference. More... | |
Protected Member Functions | |
DiObjectCounter () | |
constructor. More... | |
virtual | ~DiObjectCounter () |
destructor | |
Private Attributes | |
unsigned long | Counter |
internal counter | |
OFMutex | theMutex |
if compiled for multi-thread operation, the Mutex protecting access to the value of this object. More... | |
Class to count number of instances (objects created from a certain class).
used to manage more than one reference to an object in a secure way.
|
inlineprotected |
constructor.
Internal counter is initialized with 1.
|
inline |
add a reference.
Increase the internal counter by 1.
|
inline |
remove a reference.
Decrease the internal counter by 1 and delete the object only if the counter is zero.
|
private |
if compiled for multi-thread operation, the Mutex protecting access to the value of this object.