Common/vtkDebugLeaks.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# Common/vtkDebugLeaks.h

Go to the documentation of this file.

    00001 /*=========================================================================
    00002
    00003   Program:   Visualization Toolkit
    00004   Module:    $RCSfile: vtkDebugLeaks.h,v $
    00005   Language:  C++
    00006
    00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
    00008   All rights reserved.
    00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
    00010
    00011      This software is distributed WITHOUT ANY WARRANTY; without even
    00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
    00013      PURPOSE.  See the above copyright notice for more information.
    00014
    00015 =========================================================================*/
    00048 #ifndef __vtkDebugLeaks_h
    00049 #define __vtkDebugLeaks_h
    00050
    00051 #include "vtkObject.h"
    00052
    00053 #include "vtkToolkits.h" // Needed for VTK_DEBUG_LEAKS macro setting.
    00054 #include "vtkDebugLeaksManager.h" // Needed for proper singleton initialization
    00055
    00056 class vtkDebugLeaksHashTable;
    00057 class vtkSimpleCriticalSection;
    00058
    00059 class VTK_COMMON_EXPORT vtkDebugLeaks : public vtkObject
    00060 {
    00061 public:
    00062   static vtkDebugLeaks *New();
    00063   vtkTypeRevisionMacro(vtkDebugLeaks,vtkObject);
    00064
    00066   static void ConstructClass(const char* classname);
    00067
    00069   static void DestructClass(const char* classname);
    00070
    00072   static void PrintCurrentLeaks();
    00073
    00075
    00077   static void PromptUserOn() {}
    00078   static void PromptUserOff() {}
    00080
    00081 protected:
    00082   vtkDebugLeaks(){};
    00083   virtual ~vtkDebugLeaks(){};
    00084
    00085   static int DisplayMessageBox(const char*);
    00086
    00087   static void ClassInitialize();
    00088   static void ClassFinalize();
    00089
    00090   //BTX
    00091   friend class vtkDebugLeaksManager;
    00092   //ETX
    00093
    00094 private:
    00095   static vtkDebugLeaksHashTable* MemoryTable;
    00096   static vtkSimpleCriticalSection* CriticalSection;
    00097 private:
    00098   vtkDebugLeaks(const vtkDebugLeaks&);  // Not implemented.
    00099   void operator=(const vtkDebugLeaks&);  // Not implemented.
    00100 };
    00101
    00102 #endif // __vtkDebugLeaks_h