VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkDebugLeaks.h,v $ 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00031 #ifndef __vtkDebugLeaks_h 00032 #define __vtkDebugLeaks_h 00033 00034 #include "vtkObject.h" 00035 00036 #include "vtkToolkits.h" // Needed for VTK_DEBUG_LEAKS macro setting. 00037 #include "vtkDebugLeaksManager.h" // Needed for proper singleton initialization 00038 00039 class vtkDebugLeaksHashTable; 00040 class vtkSimpleCriticalSection; 00041 00042 class VTK_COMMON_EXPORT vtkDebugLeaks : public vtkObject 00043 { 00044 public: 00045 static vtkDebugLeaks *New(); 00046 vtkTypeRevisionMacro(vtkDebugLeaks,vtkObject); 00047 00049 static void ConstructClass(const char* classname); 00050 00052 static void DestructClass(const char* classname); 00053 00056 static int PrintCurrentLeaks(); 00057 00059 00061 VTK_LEGACY(static void PromptUserOn()); 00062 VTK_LEGACY(static void PromptUserOff()); 00064 00066 00068 static int GetExitError(); 00069 static void SetExitError(int); 00071 00072 protected: 00073 vtkDebugLeaks(){}; 00074 virtual ~vtkDebugLeaks(){}; 00075 00076 static int DisplayMessageBox(const char*); 00077 00078 static void ClassInitialize(); 00079 static void ClassFinalize(); 00080 00081 //BTX 00082 friend class vtkDebugLeaksManager; 00083 //ETX 00084 00085 private: 00086 static vtkDebugLeaksHashTable* MemoryTable; 00087 static vtkSimpleCriticalSection* CriticalSection; 00088 static int ExitError; 00089 00090 vtkDebugLeaks(const vtkDebugLeaks&); // Not implemented. 00091 void operator=(const vtkDebugLeaks&); // Not implemented. 00092 }; 00093 00094 #endif // __vtkDebugLeaks_h