34 #ifndef vtkObjectBase_h
35 #define vtkObjectBase_h
40 #define VTK_HAS_INITIALIZE_OBJECT_BASE
42 #include "vtkCommonCoreModule.h"
43 #include "vtkFeatures.h"
51 VTK_ABI_NAMESPACE_BEGIN
53 class vtkGarbageCollectorToObjectBaseFriendship;
55 class vtkWeakPointerBaseToObjectBaseFriendship;
58 typedef void* (*vtkMallocingFunction)(size_t);
59 typedef void* (*vtkReallocingFunction)(
void*, size_t);
69 virtual const char* GetClassNameInternal()
const {
return "vtkObjectBase"; }
72 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
74 #define GetClassNameA GetClassName
75 #define GetClassNameW GetClassName
81 const char* GetClassName()
const;
89 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
94 const char* GetClassNameA()
const;
95 const char* GetClassNameW()
const;
121 static vtkIdType GetNumberOfGenerationsFromBaseType(
const char* name);
131 virtual vtkIdType GetNumberOfGenerationsFromBase(
const char* name);
138 virtual void Delete();
147 virtual void FastDelete();
162 void InitializeObjectBase();
164 #if defined(_WIN32) || defined(VTK_USE_MEMKIND)
166 void*
operator new(
size_t tSize);
167 void operator delete(
void* p);
174 void Print(ostream& os);
183 virtual void PrintSelf(ostream& os,
vtkIndent indent);
184 virtual void PrintHeader(ostream& os,
vtkIndent indent);
185 virtual void PrintTrailer(ostream& os,
vtkIndent indent);
224 void SetReferenceCount(
int);
232 static void SetMemkindDirectory(
const char* directoryname);
240 static bool GetUsingMemkind();
250 #ifdef VTK_USE_MEMKIND
260 void Save(
bool newValue);
268 bool GetIsInMemkind()
const;
295 virtual void ObjectFinalize();
299 friend class vtkGarbageCollectorToObjectBaseFriendship;
300 friend class vtkWeakPointerBaseToObjectBaseFriendship;
303 friend class vtkTDSCMemkindRAII;
304 static void SetUsingMemkind(
bool);
306 void SetIsInMemkind(
bool);
315 void ClearReferenceCounts();
319 virtual const char* GetDebugClassName()
const;
325 VTK_ABI_NAMESPACE_END
void InitializeObjectBase()
static vtkObjectBase * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void(* vtkFreeingFunction)(void *)
void Print(const std::vector< T > &input, const std::string &name)
Print a vector with an associated name.
A class to help modify and restore the global UsingMemkind state, like SetUsingMemkind(newValue), but safer.
vtkObjectBase(const vtkObjectBase &)
int GetReferenceCount()
Return the current reference count of this object.
Detect and break reference loops.
a simple class to control print indentation
void *(* vtkMallocingFunction)(size_t)
Non-templated superclass for vtkWeakPointer.
abstract base class for most VTK objects
identify memory leaks at program termination vtkDebugLeaks is used to report memory leaks at the exit...
virtual bool UsesGarbageCollector() const
Indicate whether the class uses vtkGarbageCollector or not.
std::atomic< int32_t > ReferenceCount
VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, const vtkIndent &o)
void *(* vtkReallocingFunction)(void *, size_t)
vtkWeakPointerBase ** WeakPointers
void operator=(const vtkObjectBase &)