]> Creatis software - gdcm.git/blobdiff - src/gdcmGlobal.cxx
Some normalizations :
[gdcm.git] / src / gdcmGlobal.cxx
index d875390a31a8c121edd37b003aaba4f5981e43e3..5d8c4e7195124f8fa38fe2d917b2d8935338cbf6 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmGlobal.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/10/12 04:35:46 $
-  Version:   $Revision: 1.5 $
+  Date:      $Date: 2005/01/23 10:12:34 $
+  Version:   $Revision: 1.16 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 =========================================================================*/
 
 #include "gdcmGlobal.h"
+
 #include "gdcmDebug.h"
+#include "gdcmVR.h"
+#include "gdcmTS.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
+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 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;
 
 /**
- * \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;
 
 /**
- * \ingroup Global
  * \brief   constructor : populates the various H Tables
  */
 Global::Global()
 {
    if (ValRes || TranSyn || Dicts || ddElem)
    {
-      dbg.Verbose(0, "Global::Global : VR or TS or Dicts already allocated");
+      gdcmVerboseMacro( "VR or TS or Dicts already allocated");
+      return;
    }
    Dicts   = new DictSet();
    ValRes  = new VR();
@@ -71,7 +82,6 @@ Global::Global()
 }
 
 /**
- * \ingroup Global
  * \brief   canonical destructor 
  */
 Global::~Global()
@@ -82,7 +92,6 @@ Global::~Global()
    delete ddElem;
 }
 /**
- * \ingroup Global
  * \brief   returns a pointer to the 'Value Representation Table' 
  */
 VR *Global::GetVR()
@@ -90,15 +99,13 @@ 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 
  */
 DictSet *Global::GetDicts()
@@ -106,7 +113,6 @@ DictSet *Global::GetDicts()
    return Dicts;
 }
 /**
- * \ingroup Global
  * \brief   returns a pointer to the DicomDir related elements Table 
  */
 DicomDirElement *Global::GetDicomDirElements()