VTK
vtkDebugLeaks.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDebugLeaks.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
31 #ifndef __vtkDebugLeaks_h
32 #define __vtkDebugLeaks_h
33 
34 #include "vtkObject.h"
35 
36 #include "vtkToolkits.h" // Needed for VTK_DEBUG_LEAKS macro setting.
37 #include "vtkDebugLeaksManager.h" // Needed for proper singleton initialization
38 
39 class vtkDebugLeaksHashTable;
41 
43 {
44 public:
45  static vtkDebugLeaks *New();
46  vtkTypeMacro(vtkDebugLeaks,vtkObject);
47 
49  static void ConstructClass(const char* classname);
50 
52  static void DestructClass(const char* classname);
53 
56  static int PrintCurrentLeaks();
57 
59 
61  VTK_LEGACY(static void PromptUserOn());
62  VTK_LEGACY(static void PromptUserOff());
64 
66 
68  static int GetExitError();
69  static void SetExitError(int);
71 
72 protected:
74  virtual ~vtkDebugLeaks(){};
75 
76  static int DisplayMessageBox(const char*);
77 
78  static void ClassInitialize();
79  static void ClassFinalize();
80 
81  //BTX
82  friend class vtkDebugLeaksManager;
83  //ETX
84 
85 private:
86  static vtkDebugLeaksHashTable* MemoryTable;
87  static vtkSimpleCriticalSection* CriticalSection;
88  static int ExitError;
89 
90  vtkDebugLeaks(const vtkDebugLeaks&); // Not implemented.
91  void operator=(const vtkDebugLeaks&); // Not implemented.
92 };
93 
94 #endif // __vtkDebugLeaks_h
abstract base class for most VTK objects
Definition: vtkObject.h:60
#define VTK_COMMON_EXPORT
identify memory leaks at program termination
Definition: vtkDebugLeaks.h:42
static vtkObject * New()
virtual ~vtkDebugLeaks()
Definition: vtkDebugLeaks.h:74
Manages the vtkDebugLeaks singleton.