43 #ifndef vtkObjectBase_h
44 #define vtkObjectBase_h
49 #define VTK_HAS_INITIALIZE_OBJECT_BASE
51 #include "vtkCommonCoreModule.h"
52 #include "vtkFeatures.h"
60 VTK_ABI_NAMESPACE_BEGIN
62 class vtkGarbageCollectorToObjectBaseFriendship;
64 class vtkWeakPointerBaseToObjectBaseFriendship;
67 typedef void* (*vtkMallocingFunction)(size_t);
68 typedef void* (*vtkReallocingFunction)(
void*, size_t);
78 virtual const char* GetClassNameInternal()
const {
return "vtkObjectBase"; }
81 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
83 #define GetClassNameA GetClassName
84 #define GetClassNameW GetClassName
98 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
103 const char* GetClassNameA()
const;
104 const char* GetClassNameW()
const;
173 #if defined(_WIN32) || defined(VTK_USE_MEMKIND)
175 void*
operator new(
size_t tSize);
176 void operator delete(
void* p);
259 #ifdef VTK_USE_MEMKIND
269 void Save(
bool newValue);
308 friend class vtkGarbageCollectorToObjectBaseFriendship;
309 friend class vtkWeakPointerBaseToObjectBaseFriendship;
312 friend class vtkTDSCMemkindRAII;
313 static void SetUsingMemkind(
bool);
315 void SetIsInMemkind(
bool);
324 void ClearReferenceCounts();
328 virtual const char* GetDebugClassName()
const;
334 VTK_ABI_NAMESPACE_END
identify memory leaks at program termination vtkDebugLeaks is used to report memory leaks at the exit...
Detect and break reference loops.
a simple class to control print indentation
A class to help modify and restore the global UsingMemkind state, like SetUsingMemkind(newValue),...
vtkMemkindRAII(vtkMemkindRAII const &)=default
vtkMemkindRAII(bool newValue)
abstract base class for most VTK objects
static vtkFreeingFunction GetCurrentFreeFunction()
const char * GetClassName() const
Return the class name as a string.
virtual void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static void SetMemkindDirectory(const char *directoryname)
The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
virtual void ObjectFinalize()
static vtkObjectBase * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
static vtkIdType GetNumberOfGenerationsFromBaseType(const char *name)
Given a the name of a base class of this class type, return the distance of inheritance between this ...
virtual void PrintTrailer(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void operator=(const vtkObjectBase &)
static vtkMallocingFunction GetCurrentMallocFunction()
virtual void UnRegister(vtkObjectBase *o)
Decrease the reference count (release by another object).
static vtkReallocingFunction GetCurrentReallocFunction()
static vtkFreeingFunction GetAlternateFreeFunction()
static bool GetUsingMemkind()
A global state flag that controls whether vtkObjects are constructed in the usual way (the default) o...
virtual void UnRegisterInternal(vtkObjectBase *, vtkTypeBool check)
virtual vtkTypeBool IsA(const char *name)
Return 1 if this class is the same type of (or a subclass of) the named class.
virtual std::string GetObjectDescription() const
The object description printed in messages and PrintSelf output.
virtual void RegisterInternal(vtkObjectBase *, vtkTypeBool check)
virtual void PrintHeader(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
void SetReferenceCount(int)
Sets the reference count.
int GetReferenceCount()
Return the current reference count of this object.
std::atomic< int32_t > ReferenceCount
void InitializeObjectBase()
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
vtkWeakPointerBase ** WeakPointers
virtual bool UsesGarbageCollector() const
Indicate whether the class uses vtkGarbageCollector or not.
virtual void Delete()
Delete a VTK object.
virtual void ReportReferences(vtkGarbageCollector *)
virtual vtkIdType GetNumberOfGenerationsFromBase(const char *name)
Given the name of a base class of this class type, return the distance of inheritance between this cl...
static vtkTypeBool IsTypeOf(const char *name)
Return 1 if this class type is the same type of (or a subclass of) the named class.
virtual void FastDelete()
Delete a reference to this object.
void Print(ostream &os)
Print an object to an ostream.
bool GetIsInMemkind() const
A local state flag that remembers whether this object lives in the normal or extended memory space.
vtkObjectBase(const vtkObjectBase &)
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
Non-templated superclass for vtkWeakPointer.
void *(* vtkReallocingFunction)(void *, size_t)
void *(* vtkMallocingFunction)(size_t)
void(* vtkFreeingFunction)(void *)