X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=207b66f13351b1d435182b411c09947c9838565c;hb=ec7826d8a6e9f1bfb58ab5c6ec45702a5b3fa30d;hp=127737e1d95a7773f62577eccbae3f5f3ebea1c7;hpb=bfd4beaf498ee2931f79aba70c72c2f9eeeb00f0;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 127737e1..207b66f1 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,6 +3,9 @@ #include // For isspace #include "gdcmUtil.h" +// Library globals. +gdcmDebug dbg; + gdcmDebug::gdcmDebug(int level) { DebugLevel = level; } @@ -43,8 +46,32 @@ void gdcmDebug::Exit(int a) { #endif } -gdcmDebug dbg; +/////////////////////////////////////////////////////////////////////////// +gdcmVR * gdcmGlobal::VR = (gdcmVR*)0; +gdcmDictSet * gdcmGlobal::Dicts = (gdcmDictSet*)0; +gdcmGlobal gdcmGlob; + +gdcmGlobal::gdcmGlobal(void) { + if (VR || Dicts) + dbg.Verbose(0, "gdcmGlobal::gdcmGlobal: VR or Dicts allready allocated"); + VR = new gdcmVR(); + Dicts = new gdcmDictSet(); +} + +gdcmGlobal::~gdcmGlobal() { + delete VR; + delete Dicts; +} + +gdcmVR * gdcmGlobal::GetVR(void) { + return VR; +} + +gdcmDictSet * gdcmGlobal::GetDicts(void) { + return Dicts; +} +/////////////////////////////////////////////////////////////////////////// // Because is not yet available in g++2.96 istream& eatwhite(istream& is) { char c;