GDCM_NAME_SPACE::RefCounter Class Reference

Integration of reference counting with a destruction of the object only when the reference is to zero. More...

#include <gdcmRefCounter.h>

Inheritance diagram for GDCM_NAME_SPACE::RefCounter:

Inheritance graph
[legend]
Collaboration diagram for GDCM_NAME_SPACE::RefCounter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void Delete ()
 Delete the object.
void Register ()
 Register the object.
void Unregister ()
 Unregister the object.
const unsigned long & GetRefCount () const
 Get the reference counting.
virtual void Print (std::ostream &=std::cout, std::string const &="")
 Printer.
void SetPrintLevel (int level)
 Sets the print level for the Dicom Header Elements.
int GetPrintLevel ()
 Gets the print level for the Dicom Entries.

Protected Member Functions

 RefCounter ()
 Constructor.
virtual ~RefCounter ()
 Destructor.

Protected Attributes

int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Private Member Functions

 gdcmTypeMacro (RefCounter)

Private Attributes

unsigned long RefCount
 Reference count.

Detailed Description

Integration of reference counting with a destruction of the object only when the reference is to zero.

Definition at line 33 of file gdcmRefCounter.h.


Constructor & Destructor Documentation

GDCM_NAME_SPACE::RefCounter::RefCounter  )  [inline, protected]
 

Constructor.

Definition at line 66 of file gdcmRefCounter.h.

00066 { RefCount = 1; }

virtual GDCM_NAME_SPACE::RefCounter::~RefCounter  )  [inline, protected, virtual]
 

Destructor.

Definition at line 68 of file gdcmRefCounter.h.

00068 {}


Member Function Documentation

void GDCM_NAME_SPACE::RefCounter::Delete  )  [inline]
 

Delete the object.

Remarks:
The object is deleted only if its reference counting is to zero

Definition at line 41 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SerieHelper::AddFileName(), GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::CopyMandatoryEntry(), GDCM_NAME_SPACE::Dict::DoTheLoadingJob(), GDCM_NAME_SPACE::FillDefaultDataDict(), GDCM_NAME_SPACE::DicomDirObject::FillObject(), vtkGdcmReader::GetFileInformation(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry(), vtkGdcmReader::LoadFileInformation(), GDCM_NAME_SPACE::DicomDir::NewMeta(), GDCM_NAME_SPACE::DicomDirStudy::NewVisit(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::DicomDir::SetElement(), GDCM_NAME_SPACE::FileHelper::SetMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToExplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToImplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG2000(), GDCM_NAME_SPACE::FileHelper::SetWriteToLibido(), GDCM_NAME_SPACE::DicomDir::~DicomDir(), GDCM_NAME_SPACE::DictSet::~DictSet(), and GDCM_NAME_SPACE::Global::~Global().

00041 { Unregister(); }

GDCM_NAME_SPACE::RefCounter::gdcmTypeMacro RefCounter   )  [private]
 

int GDCM_NAME_SPACE::Base::GetPrintLevel  )  [inline, inherited]
 

Gets the print level for the Dicom Entries.

Definition at line 50 of file gdcmBase.h.

00050 { return PrintLevel; }

const unsigned long& GDCM_NAME_SPACE::RefCounter::GetRefCount  )  const [inline]
 

Get the reference counting.

Returns:
Reference count

Definition at line 59 of file gdcmRefCounter.h.

00060    {
00061       return RefCount;
00062    }

virtual void GDCM_NAME_SPACE::Base::Print std::ostream &  = std::cout,
std::string const &  = ""
[inline, virtual, inherited]
 

Printer.

Reimplemented in GDCM_NAME_SPACE::CommandManager, GDCM_NAME_SPACE::DataEntry, GDCM_NAME_SPACE::DicomDir, GDCM_NAME_SPACE::DicomDirElement, GDCM_NAME_SPACE::DicomDirImage, GDCM_NAME_SPACE::DicomDirMeta, GDCM_NAME_SPACE::DicomDirPatient, GDCM_NAME_SPACE::DicomDirPrivate, GDCM_NAME_SPACE::DicomDirSerie, GDCM_NAME_SPACE::DicomDirStudy, GDCM_NAME_SPACE::DicomDirVisit, GDCM_NAME_SPACE::DicomEntry, GDCM_NAME_SPACE::Dict, GDCM_NAME_SPACE::DictEntry, GDCM_NAME_SPACE::DictGroupName, GDCM_NAME_SPACE::DictSet, GDCM_NAME_SPACE::DirList, GDCM_NAME_SPACE::DocEntry, GDCM_NAME_SPACE::ElementSet, GDCM_NAME_SPACE::FileHelper, GDCM_NAME_SPACE::JPEGFragment, GDCM_NAME_SPACE::PixelReadConvert, GDCM_NAME_SPACE::RLEFrame, GDCM_NAME_SPACE::SeqEntry, GDCM_NAME_SPACE::SerieHelper, GDCM_NAME_SPACE::SQItem, GDCM_NAME_SPACE::TS, and GDCM_NAME_SPACE::VR.

Definition at line 42 of file gdcmBase.h.

00043                                                {};

void GDCM_NAME_SPACE::RefCounter::Register  )  [inline]
 

Register the object.

Remarks:
It increments the reference counting

Definition at line 46 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SQItem::AddEntry(), GDCM_NAME_SPACE::SeqEntry::AddSQItem(), GDCM_NAME_SPACE::SeqEntry::Copy(), GDCM_NAME_SPACE::DicomDir::Copy(), GDCM_NAME_SPACE::FileHelper::FileHelper(), GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::CommandManager::InSetCommand(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::SeqEntry::SetDelimitationItem().

00046 { RefCount++; }

void GDCM_NAME_SPACE::Base::SetPrintLevel int  level  )  [inline, inherited]
 

Sets the print level for the Dicom Header Elements.

Note:
0 for Light Print; 1 for 'medium' Print, 2 for Heavy Print

Definition at line 47 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::FileHelper::Print(), and GDCM_NAME_SPACE::DicomDir::Print().

00047 { PrintLevel = level; }

void GDCM_NAME_SPACE::RefCounter::Unregister  )  [inline]
 

Unregister the object.

Remarks:
It decrements the reference counting

Definition at line 50 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), GDCM_NAME_SPACE::ElementSet::RemoveEntry(), and GDCM_NAME_SPACE::FileHelper::~FileHelper().

00051    {
00052 //std::cout <<"================Unreg " << typeid(*this).name() << std::endl;
00053       RefCount--;
00054       if(RefCount<=0)
00055         delete this;
00056    }


Member Data Documentation

int GDCM_NAME_SPACE::Base::PrintLevel [protected, inherited]
 

Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Definition at line 55 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::SeqEntry::Print(), GDCM_NAME_SPACE::FileHelper::Print(), GDCM_NAME_SPACE::ElementSet::Print(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DictEntry::Print(), GDCM_NAME_SPACE::DicomDirStudy::Print(), GDCM_NAME_SPACE::DicomDirSerie::Print(), GDCM_NAME_SPACE::DicomDirPatient::Print(), GDCM_NAME_SPACE::DicomDirMeta::Print(), GDCM_NAME_SPACE::DicomDir::Print(), and GDCM_NAME_SPACE::DataEntry::Print().

unsigned long GDCM_NAME_SPACE::RefCounter::RefCount [private]
 

Reference count.

Definition at line 72 of file gdcmRefCounter.h.


The documentation for this class was generated from the following file:
Generated on Fri Aug 24 12:57:21 2007 for gdcm by  doxygen 1.4.6