Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkDebugLeaks.h

Go to the documentation of this file.
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 =========================================================================*/
00045 #ifndef __vtkDebugLeaks_h
00046 #define __vtkDebugLeaks_h
00047 
00048 #include "vtkObject.h"
00049 
00050 #include "vtkToolkits.h" // Needed for VTK_DEBUG_LEAKS macro setting.
00051 #include "vtkDebugLeaksManager.h" // Needed for proper singleton initialization
00052 
00053 class vtkDebugLeaksHashTable;
00054 class vtkSimpleCriticalSection;
00055 
00056 class VTK_COMMON_EXPORT vtkDebugLeaks : public vtkObject
00057 {
00058 public: 
00059   static vtkDebugLeaks *New();
00060   vtkTypeRevisionMacro(vtkDebugLeaks,vtkObject);
00061 
00063   static void ConstructClass(const char* classname);
00064 
00066   static void DestructClass(const char* classname);
00067 
00070   static int PrintCurrentLeaks();
00071 
00073 
00075   static void PromptUserOn() {}
00076   static void PromptUserOff() {}
00078 
00079 protected:
00080   vtkDebugLeaks(){}; 
00081   virtual ~vtkDebugLeaks(){}; 
00082 
00083   static int DisplayMessageBox(const char*);
00084 
00085   static void ClassInitialize();
00086   static void ClassFinalize();
00087 
00088   //BTX
00089   friend class vtkDebugLeaksManager;
00090   //ETX
00091 
00092 private:
00093   static vtkDebugLeaksHashTable* MemoryTable;
00094   static vtkSimpleCriticalSection* CriticalSection;
00095 
00096   vtkDebugLeaks(const vtkDebugLeaks&);  // Not implemented.
00097   void operator=(const vtkDebugLeaks&);  // Not implemented.
00098 };
00099 
00100 #endif // __vtkDebugLeaks_h