X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmGlobal.cxx;h=4a21aca32e87b949f204e6851c56b7c55b7cf197;hb=31745b8deed4e159cda4f587d1dfd8024ae6b49b;hp=5d8c4e7195124f8fa38fe2d917b2d8935338cbf6;hpb=0ad9dae4659b21bfd5c834c1af724eab4dcdf4f6;p=gdcm.git diff --git a/src/gdcmGlobal.cxx b/src/gdcmGlobal.cxx index 5d8c4e71..4a21aca3 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/23 10:12:34 $ - Version: $Revision: 1.16 $ + Date: $Date: 2005/10/25 14:52:35 $ + Version: $Revision: 1.28 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,50 +21,45 @@ #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"; -/** - * \brief Pointer to a container, holding _all_ the Dicom Dictionaries. - */ -DictSet *Global::Dicts = (DictSet *)0; - -/** - * \brief Pointer to a hash table containing the 'Value Representations'. - */ -VR *Global::ValRes = (VR *)0; +const std::string GDCM_VRUNKNOWN = " "; -/** - * \brief Pointer to a hash table containing the Transfer Syntax codes - * and their english description - */ -TS *Global::TranSyn = (TS *)0; - -/** - * \brief Pointer to the hash table containing the Dicom Elements - * necessary to describe each part of a DICOMDIR - */ -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; +//----------------------------------------------------------------------------- /** * \brief Global container */ Global Glob; +//------------------------------------------------------------------------- +// Constructor / Destructor /** * \brief constructor : populates the various H Tables */ @@ -72,13 +67,14 @@ 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 = DictSet::New(); + ValRes = VR::New(); + TranSyn = TS::New(); + GroupName = DictGroupName::New(); + ddElem = DicomDirElement::New(); } /** @@ -86,11 +82,23 @@ Global::Global() */ Global::~Global() { - delete Dicts; - delete ValRes; - delete TranSyn; - delete ddElem; + Dicts->Delete(); + ValRes->Delete(); + TranSyn->Delete(); + GroupName->Delete(); + ddElem->Delete(); +} + +//----------------------------------------------------------------------------- +// Public +/** + * \brief returns a pointer to Dictionaries Table + */ +DictSet *Global::GetDicts() +{ + return Dicts; } + /** * \brief returns a pointer to the 'Value Representation Table' */ @@ -98,6 +106,7 @@ VR *Global::GetVR() { return ValRes; } + /** * \brief returns a pointer to the 'Transfer Syntax Table' */ @@ -105,13 +114,15 @@ TS *Global::GetTS() { return TranSyn; } + /** - * \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; } + /** * \brief returns a pointer to the DicomDir related elements Table */ @@ -119,4 +130,15 @@ DicomDirElement *Global::GetDicomDirElements() { return ddElem; } + +//----------------------------------------------------------------------------- +// Protected + +//----------------------------------------------------------------------------- +// Private + +//----------------------------------------------------------------------------- +// Print + +//----------------------------------------------------------------------------- } // end namespace gdcm