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

vtkGarbageCollector.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkGarbageCollector.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 =========================================================================*/
00088 #ifndef __vtkGarbageCollector_h
00089 #define __vtkGarbageCollector_h
00090 
00091 #include "vtkObject.h"
00092 
00093 class vtkGarbageCollectorInternals;
00094 
00095 class VTK_COMMON_EXPORT vtkGarbageCollector : public vtkObject
00096 {
00097 public:
00098   vtkTypeRevisionMacro(vtkGarbageCollector,vtkObject);
00099   void PrintSelf(ostream& os, vtkIndent indent);
00100 
00103   static void Check(vtkObjectBase* root);
00104 
00110   void ReportReference(vtkObjectBase*, const char*);
00111 
00113 
00115   static void SetGlobalDebugFlag(int flag);
00116   static int GetGlobalDebugFlag();
00118 protected:
00119   vtkGarbageCollector(vtkGarbageCollectorInternals*);
00120   ~vtkGarbageCollector();
00121 
00123   virtual void Register(vtkObjectBase*);
00124 
00126   virtual void UnRegister(vtkObjectBase*);
00127 
00128   // Forward call to given object.
00129   void ForwardReportReferences(vtkObjectBase*);
00130   static void ForwardRemoveReferences(vtkObjectBase*);
00131   static void ForwardGarbageCollectionStarting(vtkObjectBase*);
00132   static void ForwardGarbageCollectionFinishing(vtkObjectBase*);
00133 
00134   // Forward call to the internal implementation.
00135   void CheckReferenceLoops(vtkObjectBase* root);
00136 
00137 private:
00138   // Internal implementation details.
00139   vtkGarbageCollectorInternals* Internal;
00140 
00141   //BTX
00142   friend class vtkGarbageCollectorInternals;
00143   //ETX
00144 private:
00145   vtkGarbageCollector(const vtkGarbageCollector&);  // Not implemented.
00146   void operator=(const vtkGarbageCollector&);  // Not implemented.
00147 };
00148 
00149 #endif