46#ifndef vtkObjectBase_h
47#define vtkObjectBase_h
52#define VTK_HAS_INITIALIZE_OBJECT_BASE
54#include "vtkCommonCoreModule.h"
55#include "vtkFeatures.h"
64class vtkGarbageCollectorToObjectBaseFriendship;
66class vtkWeakPointerBaseToObjectBaseFriendship;
69typedef void* (*vtkMallocingFunction)(size_t);
70typedef void* (*vtkReallocingFunction)(
void*, size_t);
80 virtual const char* GetClassNameInternal()
const {
return "vtkObjectBase"; }
83#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
85#define GetClassNameA GetClassName
86#define GetClassNameW GetClassName
100#ifdef VTK_WORKAROUND_WINDOWS_MANGLE
105 const char* GetClassNameA()
const;
106 const char* GetClassNameW()
const;
175#if defined(_WIN32) || defined(VTK_USE_MEMKIND)
177 void*
operator new(
size_t tSize);
178 void operator delete(
void* p);
261#ifdef VTK_USE_MEMKIND
271 void Save(
bool newValue);
315 static void SetUsingMemkind(
bool);
317 void SetIsInMemkind(
bool);
326 void ClearReferenceCounts();
330 virtual const char* GetDebugClassName()
const;
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)
static vtkFreeingFunction GetCurrentFreeFunction()
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 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).
friend class vtkDebugLeaks
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.
static vtkObjectBase * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
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()
friend class vtkWeakPointerBaseToObjectBaseFriendship
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
friend class vtkInformationKey
Some classes need to clear the reference counts manually due to the way they work.
friend class vtkGarbageCollector
Some classes need to clear the reference counts manually due to the way they work.
vtkWeakPointerBase ** WeakPointers
friend VTKCOMMONCORE_EXPORT ostream & operator<<(ostream &os, vtkObjectBase &o)
virtual bool UsesGarbageCollector() const
Indicate whether the class uses vtkGarbageCollector or not.
virtual void Delete()
Delete a VTK object.
friend class vtkGarbageCollectorToObjectBaseFriendship
virtual void ReportReferences(vtkGarbageCollector *)
friend class vtkTDSCMemkindRAII
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.
const char * GetClassName() const
Return the class name as a string.
vtkObjectBase(const vtkObjectBase &)
Non-templated superclass for vtkWeakPointer.
void *(* vtkMallocingFunction)(size_t)
void *(* vtkReallocingFunction)(void *, size_t)
void(* vtkFreeingFunction)(void *)