dox/Common/vtkObjectBase.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkObjectBase.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 =========================================================================*/
00048 #ifndef __vtkObjectBase_h
00049 #define __vtkObjectBase_h
00050 
00051 #include "vtkIndent.h"
00052 #include "vtkSystemIncludes.h"
00053 
00054 class vtkGarbageCollector;
00055 class vtkGarbageCollectorToObjectBaseFriendship;
00056 
00057 class VTK_COMMON_EXPORT vtkObjectBase
00058 {
00059   virtual const char* GetClassNameInternal() const { return "vtkObjectBase"; }
00060 public:
00061 
00062 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00063   // Avoid windows name mangling.
00064 # define GetClassNameA GetClassName
00065 # define GetClassNameW GetClassName
00066 #endif
00067 
00071   const char* GetClassName() const;
00072 
00073 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00074 # undef GetClassNameW
00075 # undef GetClassNameA
00076   //BTX
00077   // Define possible mangled names.
00078   const char* GetClassNameA() const;
00079   const char* GetClassNameW() const;
00080   //ETX
00081 #endif
00082 
00086   static int IsTypeOf(const char *name);
00087 
00091   virtual int IsA(const char *name);
00092 
00096   virtual void Delete();
00097 
00103   virtual void FastDelete();
00104 
00106 
00108   static vtkObjectBase *New() 
00109     {return new vtkObjectBase;}
00111   
00112 #ifdef _WIN32
00113   // avoid dll boundary problems
00114   void* operator new( size_t tSize );
00115   void operator delete( void* p );
00116 #endif 
00117   
00120   void Print(ostream& os);
00121 
00123 
00127   virtual void PrintSelf(ostream& os, vtkIndent indent);
00128   virtual void PrintHeader(ostream& os, vtkIndent indent);
00129   virtual void PrintTrailer(ostream& os, vtkIndent indent);
00131 
00133   virtual void Register(vtkObjectBase* o);
00134 
00138   virtual void UnRegister(vtkObjectBase* o);
00139 
00141 
00142   int  GetReferenceCount() 
00143     {return this->ReferenceCount;}
00145 
00147   void SetReferenceCount(int);
00148   
00155   void PrintRevisions(ostream& os);
00156   
00157 protected:
00158   vtkObjectBase(); 
00159   virtual ~vtkObjectBase(); 
00160 
00161   virtual void CollectRevisions(ostream& os);
00162   
00163   int ReferenceCount;      // Number of uses of this object by other objects
00164 
00165   // Internal Register/UnRegister implementation that accounts for
00166   // possible garbage collection participation.  The second argument
00167   // indicates whether to participate in garbage collection.
00168   virtual void RegisterInternal(vtkObjectBase*, int check);
00169   virtual void UnRegisterInternal(vtkObjectBase*, int check);
00170 
00171   // See vtkGarbageCollector.h:
00172   virtual void ReportReferences(vtkGarbageCollector*);
00173 private:
00174   //BTX
00175   friend VTK_COMMON_EXPORT ostream& operator<<(ostream& os, vtkObjectBase& o);
00176   friend class vtkGarbageCollectorToObjectBaseFriendship;
00177   //ETX
00178 protected:
00179 //BTX
00180   vtkObjectBase(const vtkObjectBase&) {}
00181   void operator=(const vtkObjectBase&) {}
00182 //ETX
00183 };
00184 
00185 #endif
00186 

Generated on Mon Nov 13 23:54:27 2006 for VTK by  doxygen 1.5.1