gdcmGlobal.cxx

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmGlobal.cxx,v $
00005   Language:  C++
00006   Date:      $Date: 2007/07/04 15:38:53 $
00007   Version:   $Revision: 1.36 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #include "gdcmGlobal.h"
00020 
00021 #include "gdcmDebug.h"
00022 #include "gdcmVR.h"
00023 #include "gdcmTS.h"
00024 #include "gdcmDictGroupName.h"
00025 #include "gdcmDictSet.h"
00026 #include "gdcmDicomDirElement.h"
00027 
00028 namespace  GDCM_NAME_SPACE
00029 {
00030 //-----------------------------------------------------------------------------
00037 
00038 const std::string GDCM_UNKNOWN   = "GDCM::Unknown";
00039 const std::string GDCM_UNFOUND   = "GDCM::Unfound";
00040 const std::string GDCM_BINLOADED = "GDCM::Binary data loaded";
00041 const std::string GDCM_NOTLOADED = "GDCM::NotLoaded";
00042 const std::string GDCM_UNREAD    = "GDCM::UnRead";
00043 const std::string GDCM_NOTASCII  = "GDCM::NotAscii";
00044 const std::string GDCM_PIXELDATA = "GDCM::Pixel Data to be loaded";
00045 
00046 const char GDCM_VRUNKNOWN[2] = {' ',' '}; // avoid useless std::string stuff
00047 
00048 #ifdef _WIN32
00049 const char GDCM_FILESEPARATOR = '\\';
00050 #else
00051 const char GDCM_FILESEPARATOR = '/';
00052 #endif
00053 
00054 //-----------------------------------------------------------------------------
00055 DictSet         *Global::Dicts     = (DictSet *)0;
00056 VR              *Global::ValRes    = (VR *)0;
00057 TS              *Global::TranSyn   = (TS *)0;
00058 DictGroupName   *Global::GroupName = (DictGroupName *)0;
00059 DicomDirElement *Global::ddElem    = (DicomDirElement *)0;
00060 
00061 Dict            *Global::DefaultPubDict = (Dict *)0;
00062 
00063 //-----------------------------------------------------------------------------
00067 Global Glob;
00068 
00069 //-------------------------------------------------------------------------
00070 // Constructor / Destructor
00074 Global::Global()
00075 {
00076    if (ValRes || TranSyn || Dicts || ddElem || GroupName )
00077    {
00078       gdcmStaticWarningMacro( "VR or TS or Dicts or ... already allocated");
00079       return;
00080    }
00081    Dicts     = DictSet::New();
00082    ValRes    = VR::New();
00083    TranSyn   = TS::New();
00084    GroupName = DictGroupName::New();
00085    ddElem    = DicomDirElement::New();
00086 }
00087 
00091 Global::~Global()
00092 {
00093    Dicts->Delete();
00094    ValRes->Delete();
00095    TranSyn->Delete();
00096    GroupName->Delete();
00097    ddElem->Delete();
00098 }
00099 
00100 //-----------------------------------------------------------------------------
00101 // Public
00102 
00103 //-----------------------------------------------------------------------------
00104 // Protected
00105 
00106 //-----------------------------------------------------------------------------
00107 // Private
00108 
00109 //-----------------------------------------------------------------------------
00110 // Print
00111 
00112 //-----------------------------------------------------------------------------
00113 } // end namespace gdcm

Generated on Fri Aug 24 12:59:31 2007 for gdcm by  doxygen 1.4.6