00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00045 #ifndef __vtkObjectBase_h
00046 #define __vtkObjectBase_h
00047
00048 #include "vtkIndent.h"
00049 #include "vtkSystemIncludes.h"
00050
00051 class vtkGarbageCollector;
00052 class vtkGarbageCollectorToObjectBaseFriendship;
00053
00054 class VTK_COMMON_EXPORT vtkObjectBase
00055 {
00056 virtual const char* GetClassNameInternal() const { return "vtkObjectBase"; }
00057 public:
00058
00059 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00060
00061 # define GetClassNameA GetClassName
00062 # define GetClassNameW GetClassName
00063 #endif
00064
00068 const char* GetClassName() const;
00069
00070 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00071 # undef GetClassNameW
00072 # undef GetClassNameA
00073
00074
00075 const char* GetClassNameA() const;
00076 const char* GetClassNameW() const;
00077
00078 #endif
00079
00083 static int IsTypeOf(const char *name);
00084
00088 virtual int IsA(const char *name);
00089
00093 virtual void Delete();
00094
00100 virtual void FastDelete();
00101
00103
00105 static vtkObjectBase *New()
00106 {return new vtkObjectBase;}
00108
00109 #ifdef _WIN32
00110
00111 void* operator new( size_t tSize );
00112 void operator delete( void* p );
00113 #endif
00114
00117 void Print(ostream& os);
00118
00120
00124 virtual void PrintSelf(ostream& os, vtkIndent indent);
00125 virtual void PrintHeader(ostream& os, vtkIndent indent);
00126 virtual void PrintTrailer(ostream& os, vtkIndent indent);
00128
00130 virtual void Register(vtkObjectBase* o);
00131
00135 virtual void UnRegister(vtkObjectBase* o);
00136
00138
00139 int GetReferenceCount()
00140 {return this->ReferenceCount;}
00142
00144 void SetReferenceCount(int);
00145
00152 void PrintRevisions(ostream& os);
00153
00154 protected:
00155 vtkObjectBase();
00156 virtual ~vtkObjectBase();
00157
00158 virtual void CollectRevisions(ostream& os);
00159
00160 int ReferenceCount;
00161
00162
00163
00164
00165 virtual void RegisterInternal(vtkObjectBase*, int check);
00166 virtual void UnRegisterInternal(vtkObjectBase*, int check);
00167
00168
00169 virtual void ReportReferences(vtkGarbageCollector*);
00170 private:
00171
00172 friend VTK_COMMON_EXPORT ostream& operator<<(ostream& os, vtkObjectBase& o);
00173 friend class vtkGarbageCollectorToObjectBaseFriendship;
00174
00175 protected:
00176
00177 vtkObjectBase(const vtkObjectBase&) {}
00178 void operator=(const vtkObjectBase&) {}
00179
00180 };
00181
00182 #endif
00183