00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
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
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
00077
00078 const char* GetClassNameA() const;
00079 const char* GetClassNameW() const;
00080
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
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;
00164
00165
00166
00167
00168 virtual void RegisterInternal(vtkObjectBase*, int check);
00169 virtual void UnRegisterInternal(vtkObjectBase*, int check);
00170
00171
00172 virtual void ReportReferences(vtkGarbageCollector*);
00173 private:
00174
00175 friend VTK_COMMON_EXPORT ostream& operator<<(ostream& os, vtkObjectBase& o);
00176 friend class vtkGarbageCollectorToObjectBaseFriendship;
00177
00178 protected:
00179
00180 vtkObjectBase(const vtkObjectBase&) {}
00181 void operator=(const vtkObjectBase&) {}
00182
00183 };
00184
00185 #endif
00186