X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmGlobal.cxx;h=6411383e263f1013340426c33d55824ff3a8f6cf;hb=5b89bede4607999aeb8d5b45311e7ee82f9471ef;hp=0229c8edba9a738afa67f594e3da9bf647607a6d;hpb=f6fd616782f9811f1390c64c9a3e7beb50ca4a04;p=gdcm.git diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index 0229c8ed..6411383e 100644 --- a/src/gdcmGlobal.cxx +++ b/src/gdcmGlobal.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmGlobal.cxx,v $ Language: C++ - Date: $Date: 2004/10/08 04:52:55 $ - Version: $Revision: 1.4 $ + Date: $Date: 2005/02/02 15:07:41 $ + Version: $Revision: 1.18 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -17,96 +17,111 @@ =========================================================================*/ #include "gdcmGlobal.h" -#include "gdcmDebug.h" - -/** - * \ingroup Globals - * \brief Pointer to a container, holding _all_ the Dicom Dictionaries. - */ -gdcmDictSet *gdcmGlobal::Dicts = (gdcmDictSet *)0; -/** - * \ingroup Globals - * \brief Pointer to a hash table containing the 'Value Representations'. - */ -gdcmVR *gdcmGlobal::VR = (gdcmVR *)0; +#include "gdcmDebug.h" +#include "gdcmVR.h" +#include "gdcmTS.h" +#include "gdcmDictSet.h" +#include "gdcmDicomDirElement.h" -/** - * \ingroup Globals - * \brief Pointer to a hash table containing the Transfer Syntax codes - * and their english description - */ -gdcmTS *gdcmGlobal::TS = (gdcmTS *)0; +namespace gdcm +{ +//----------------------------------------------------------------------------- +// Those global string that are return by reference everywhere in gdcm code +// used to be in gdcmCommon.h but due to a 'bug' in gcc/MacOSX +// you cannot have static initialization in a multithreaded environment +// since there is a lazy construction everything got skrew up somehow +// Therefore the actual initialization is done in a cxx file (avoid +// duplicated symbol), and an extern is used in gdcmCommon.h +const std::string GDCM_UNKNOWN = "gdcm::Unknown"; +const std::string GDCM_UNFOUND = "gdcm::Unfound"; +const std::string GDCM_BINLOADED = "gdcm::Binary data loaded"; +const std::string GDCM_NOTLOADED = "gdcm::NotLoaded"; +const std::string GDCM_UNREAD = "gdcm::UnRead"; -/** - * \ingroup Globals - * \brief Pointer to the hash table containing the Dicom Elements - * necessary to describe each part of a DICOMDIR - */ -gdcmDicomDirElement *gdcmGlobal::ddElem = (gdcmDicomDirElement *)0; +//----------------------------------------------------------------------------- +DictSet *Global::Dicts = (DictSet *)0; +VR *Global::ValRes = (VR *)0; +TS *Global::TranSyn = (TS *)0; +DicomDirElement *Global::ddElem = (DicomDirElement *)0; +//----------------------------------------------------------------------------- /** - * \ingroup Globals * \brief Global container */ -gdcmGlobal gdcmGlob; +Global Glob; +//------------------------------------------------------------------------- +// Constructor / Destructor /** - * \ingroup gdcmGlobal * \brief constructor : populates the various H Tables */ -gdcmGlobal::gdcmGlobal() +Global::Global() { - if (VR || TS || Dicts || ddElem) + if (ValRes || TranSyn || Dicts || ddElem) { - dbg.Verbose(0, "gdcmGlobal::gdcmGlobal : VR or TS or Dicts already allocated"); + gdcmVerboseMacro( "VR or TS or Dicts already allocated"); + return; } - Dicts = new gdcmDictSet(); - VR = new gdcmVR(); - TS = new gdcmTS(); - ddElem = new gdcmDicomDirElement(); + Dicts = new DictSet(); + ValRes = new VR(); + TranSyn = new TS(); + ddElem = new DicomDirElement(); } /** - * \ingroup gdcmGlobal * \brief canonical destructor */ -gdcmGlobal::~gdcmGlobal() +Global::~Global() { delete Dicts; - delete VR; - delete TS; + delete ValRes; + delete TranSyn; delete ddElem; } + +//----------------------------------------------------------------------------- +// Public /** - * \ingroup gdcmGlobal - * \brief returns a pointer to the 'Value Representation Table' + * \brief returns a pointer to Dictionaries Table */ -gdcmVR *gdcmGlobal::GetVR() +DictSet *Global::GetDicts() { - return VR; + return Dicts; } + /** - * \ingroup gdcmGlobal - * \brief returns a pointer to the 'Transfert Syntax Table' + * \brief returns a pointer to the 'Value Representation Table' */ -gdcmTS *gdcmGlobal::GetTS() +VR *Global::GetVR() { - return TS; + return ValRes; } + /** - * \ingroup gdcmGlobal - * \brief returns a pointer to Dictionaries Table + * \brief returns a pointer to the 'Transfer Syntax Table' */ -gdcmDictSet *gdcmGlobal::GetDicts() +TS *Global::GetTS() { - return Dicts; + return TranSyn; } + /** - * \ingroup gdcmGlobal * \brief returns a pointer to the DicomDir related elements Table */ -gdcmDicomDirElement *gdcmGlobal::GetDicomDirElements() +DicomDirElement *Global::GetDicomDirElements() { return ddElem; } + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print + +//----------------------------------------------------------------------------- +} // end namespace gdcm