]> Creatis software - gdcm.git/blobdiff - src/gdcmDebug.h
DICOMDIR skeleton modifs, for future version
[gdcm.git] / src / gdcmDebug.h
index 886e2ec4e5dca24f8f3c4c20749ff4a0c283a6b2..a689936f29dbd1432b491ac4cf8a03efd22d7921 100644 (file)
@@ -1,9 +1,30 @@
-// gdcmDebug.h
-//-----------------------------------------------------------------------------
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: gdcmDebug.h,v $
+  Language:  C++
+  Date:      $Date: 2004/07/19 11:51:26 $
+  Version:   $Revision: 1.4 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
+
 #ifndef GDCMDEBUG_H
 #define GDCMDEBUG_H
 
-#define GDCM_DEBUG -1
+#include "gdcmCommon.h"
+
+//-----------------------------------------------------------------------------
+#define dbg gdcmDebug::GetReference()
+
+//-----------------------------------------------------------------------------
 
 /**
  * \ingroup gdcmDebug
@@ -16,9 +37,9 @@
  * Shown only when the debug level is higher than the 
  * message level.
  */
-class gdcmDebug {
+class GDCM_EXPORT gdcmDebug {
 public:
-   gdcmDebug(int level = GDCM_DEBUG);
+   gdcmDebug(int level = -1);
 
    void SetDebug (int level);
    void Verbose(int, const char*, const char* ="");
@@ -28,11 +49,14 @@ public:
    void Assert(int, bool, const char*, const char*);
    void Exit(int);
 
+   static gdcmDebug &GetReference();
+
 private:
 /// warning message level to be displayed
    int DebugLevel;
-};
 
-extern gdcmDebug dbg;
+/// Instance of debugging utility.
+   static gdcmDebug debug;
+};
 
 #endif