X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmGlobal.cxx;h=c9ccd9d984fb182f8aeaa6ca1f78a058742a3fab;hb=21d241b3fdcf675d8d91a6daf6dfd6f448b68195;hp=d3dc6da82f04727cb14830b51df240a18f0da4c6;hpb=e0e3ff9986778666bc665801af48923d30eb8ee7;p=gdcm.git diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index d3dc6da8..c9ccd9d9 100644 --- a/src/gdcmGlobal.cxx +++ b/src/gdcmGlobal.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmGlobal.cxx,v $ Language: C++ - Date: $Date: 2005/01/10 19:23:31 $ - Version: $Revision: 1.12 $ + Date: $Date: 2005/10/11 08:24:10 $ + Version: $Revision: 1.26 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,63 +21,60 @@ #include "gdcmDebug.h" #include "gdcmVR.h" #include "gdcmTS.h" +#include "gdcmDictGroupName.h" #include "gdcmDictSet.h" #include "gdcmDicomDirElement.h" namespace gdcm { +//----------------------------------------------------------------------------- +/// \brief Those global string that are returned 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 -/** - * \ingroup Globals - * \brief Pointer to a container, holding _all_ the Dicom Dictionaries. - */ -DictSet *Global::Dicts = (DictSet *)0; - -/** - * \ingroup Globals - * \brief Pointer to a hash table containing the 'Value Representations'. - */ -VR *Global::ValRes = (VR *)0; - -/** - * \ingroup Globals - * \brief Pointer to a hash table containing the Transfer Syntax codes - * and their english description - */ -TS *Global::TranSyn = (TS *)0; +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"; +const std::string GDCM_NOTASCII = "gdcm::NotAscii"; +const std::string GDCM_PIXELDATA = "gdcm::Pixel Data to be loaded"; +//----------------------------------------------------------------------------- +DictSet *Global::Dicts = (DictSet *)0; +VR *Global::ValRes = (VR *)0; +TS *Global::TranSyn = (TS *)0; +DictGroupName *Global::GroupName = (DictGroupName *)0; +DicomDirElement *Global::ddElem = (DicomDirElement *)0; +//----------------------------------------------------------------------------- /** - * \ingroup Globals - * \brief Pointer to the hash table containing the Dicom Elements - * necessary to describe each part of a DICOMDIR - */ -DicomDirElement *Global::ddElem = (DicomDirElement *)0; - -/** - * \ingroup Globals * \brief Global container */ Global Glob; +//------------------------------------------------------------------------- +// Constructor / Destructor /** - * \ingroup Global * \brief constructor : populates the various H Tables */ Global::Global() { if (ValRes || TranSyn || Dicts || ddElem) { - gdcmVerboseMacro( "VR or TS or Dicts already allocated"); + gdcmWarningMacro( "VR or TS or Dicts already allocated"); return; } - Dicts = new DictSet(); - ValRes = new VR(); - TranSyn = new TS(); - ddElem = new DicomDirElement(); + Dicts = new DictSet(); + ValRes = new VR(); + TranSyn = new TS(); + GroupName = new DictGroupName(); + ddElem = new DicomDirElement(); } /** - * \ingroup Global * \brief canonical destructor */ Global::~Global() @@ -85,38 +82,60 @@ Global::~Global() delete Dicts; delete ValRes; delete TranSyn; + delete GroupName; delete ddElem; } + +//----------------------------------------------------------------------------- +// Public +/** + * \brief returns a pointer to Dictionaries Table + */ +DictSet *Global::GetDicts() +{ + return Dicts; +} + /** - * \ingroup Global * \brief returns a pointer to the 'Value Representation Table' */ VR *Global::GetVR() { return ValRes; } + /** - * \ingroup Global - * \brief returns a pointer to the 'Transfert Syntax Table' + * \brief returns a pointer to the 'Transfer Syntax Table' */ TS *Global::GetTS() { return TranSyn; } + /** - * \ingroup Global - * \brief returns a pointer to Dictionaries Table + * \brief returns a pointer to the Group name correspondance table */ -DictSet *Global::GetDicts() +DictGroupName *Global::GetDictGroupName() { - return Dicts; + return GroupName; } + /** - * \ingroup Global * \brief returns a pointer to the DicomDir related elements Table */ DicomDirElement *Global::GetDicomDirElements() { return ddElem; } + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print + +//----------------------------------------------------------------------------- } // end namespace gdcm