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 class vtkWeakPointerBase;
00054 class vtkWeakPointerBaseToObjectBaseFriendship;
00055
00056 class VTK_COMMON_EXPORT vtkObjectBase
00057 {
00058 virtual const char* GetClassNameInternal() const { return "vtkObjectBase"; }
00059 public:
00060
00061 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00062
00063 # define GetClassNameA GetClassName
00064 # define GetClassNameW GetClassName
00065 #endif
00066
00070 const char* GetClassName() const;
00071
00072 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00073 # undef GetClassNameW
00074 # undef GetClassNameA
00075
00076
00077 const char* GetClassNameA() const;
00078 const char* GetClassNameW() const;
00079
00080 #endif
00081
00085 static int IsTypeOf(const char *name);
00086
00090 virtual int IsA(const char *name);
00091
00095 virtual void Delete();
00096
00102 virtual void FastDelete();
00103
00105
00107 static vtkObjectBase *New()
00108 {return new vtkObjectBase;}
00110
00111 #ifdef _WIN32
00112
00113 void* operator new( size_t tSize );
00114 void operator delete( void* p );
00115 #endif
00116
00119 void Print(ostream& os);
00120
00122
00126 virtual void PrintSelf(ostream& os, vtkIndent indent);
00127 virtual void PrintHeader(ostream& os, vtkIndent indent);
00128 virtual void PrintTrailer(ostream& os, vtkIndent indent);
00130
00132 virtual void Register(vtkObjectBase* o);
00133
00137 virtual void UnRegister(vtkObjectBase* o);
00138
00140
00141 int GetReferenceCount()
00142 {return this->ReferenceCount;}
00144
00146 void SetReferenceCount(int);
00147
00154 void PrintRevisions(ostream& os);
00155
00156 protected:
00157 vtkObjectBase();
00158 virtual ~vtkObjectBase();
00159
00160 virtual void CollectRevisions(ostream& os);
00161
00162 int ReferenceCount;
00163 vtkWeakPointerBase **WeakPointers;
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
00174 private:
00175
00176 friend VTK_COMMON_EXPORT ostream& operator<<(ostream& os, vtkObjectBase& o);
00177 friend class vtkGarbageCollectorToObjectBaseFriendship;
00178 friend class vtkWeakPointerBaseToObjectBaseFriendship;
00179
00180 protected:
00181
00182 vtkObjectBase(const vtkObjectBase&) {}
00183 void operator=(const vtkObjectBase&) {}
00184
00185 };
00186
00187 #endif
00188