X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmGlobal.cxx;h=6f98bbfe9ff8f6436d37f3cf6b06238f60131940;hb=5ac625c72835828d687ebdef878691d0913ae41b;hp=0e737e4475755d622f4e759b0ed0fbef4ce26067;hpb=95e43356511d138225d8f718f632b3e7a8fcc106;p=gdcm.git diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index 0e737e44..6f98bbfe 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/02/05 01:37:08 $ - Version: $Revision: 1.19 $ + Date: $Date: 2005/11/28 15:20:33 $ + Version: $Revision: 1.29 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,29 +21,36 @@ #include "gdcmDebug.h" #include "gdcmVR.h" #include "gdcmTS.h" +#include "gdcmDictGroupName.h" #include "gdcmDictSet.h" #include "gdcmDicomDirElement.h" 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 +/// \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 + 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"; + +const std::string GDCM_VRUNKNOWN = " "; //----------------------------------------------------------------------------- -DictSet *Global::Dicts = (DictSet *)0; -VR *Global::ValRes = (VR *)0; -TS *Global::TranSyn = (TS *)0; -DicomDirElement *Global::ddElem = (DicomDirElement *)0; +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; //----------------------------------------------------------------------------- /** @@ -60,13 +67,14 @@ Global::Global() { if (ValRes || TranSyn || Dicts || ddElem) { - gdcmWarningMacro( "VR or TS or Dicts already allocated"); + gdcmStaticWarningMacro( "VR or TS or Dicts already allocated"); return; } - Dicts = new DictSet(); - ValRes = new VR(); - TranSyn = new TS(); - ddElem = new DicomDirElement(); + Dicts = DictSet::New(); + ValRes = VR::New(); + TranSyn = TS::New(); + GroupName = DictGroupName::New(); + ddElem = DicomDirElement::New(); } /** @@ -74,10 +82,11 @@ Global::Global() */ Global::~Global() { - delete Dicts; - delete ValRes; - delete TranSyn; - delete ddElem; + Dicts->Delete(); + ValRes->Delete(); + TranSyn->Delete(); + GroupName->Delete(); + ddElem->Delete(); } //----------------------------------------------------------------------------- @@ -106,6 +115,14 @@ TS *Global::GetTS() return TranSyn; } +/** + * \brief returns a pointer to the Group name correspondance table + */ +DictGroupName *Global::GetDictGroupName() +{ + return GroupName; +} + /** * \brief returns a pointer to the DicomDir related elements Table */