DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Attributes
DiObjectCounter Class Reference

Class to count number of instances (objects created from a certain class). More...

+ Inheritance diagram for DiObjectCounter:

List of all members.

Public Member Functions

void addReference ()
 add a reference.
void removeReference ()
 remove a reference.

Protected Member Functions

 DiObjectCounter ()
 constructor.
virtual ~DiObjectCounter ()
 destructor

Private Attributes

unsigned long Counter
 internal counter

Detailed Description

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.


Constructor & Destructor Documentation

DiObjectCounter::DiObjectCounter ( ) [inline, protected]

constructor.

Internal counter is initialized with 1.


Member Function Documentation

void DiObjectCounter::addReference ( ) [inline]

add a reference.

Increase the internal counter by 1.

remove a reference.

Decrease the internal counter by 1 and delete the object only if the counter is zero.


The documentation for this class was generated from the following file:


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027