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 00055 static void PrintCurrentLeaks(); 00056 00058 00060 static void PromptUserOn() {} 00061 static void PromptUserOff() {} 00063 00064 protected: 00065 vtkDebugLeaks(){}; 00066 virtual ~vtkDebugLeaks(){}; 00067 00068 static int DisplayMessageBox(const char*); 00069 00070 static void ClassInitialize(); 00071 static void ClassFinalize(); 00072 00073 //BTX 00074 friend class vtkDebugLeaksManager; 00075 //ETX 00076 00077 private: 00078 static vtkDebugLeaksHashTable* MemoryTable; 00079 static vtkSimpleCriticalSection* CriticalSection; 00080 private: 00081 vtkDebugLeaks(const vtkDebugLeaks&); // Not implemented. 00082 void operator=(const vtkDebugLeaks&); // Not implemented. 00083 }; 00084 00085 #endif // __vtkDebugLeaks_h