34 #ifndef vtkObjectBase_h
35 #define vtkObjectBase_h
40 #define VTK_HAS_INITIALIZE_OBJECT_BASE
42 #include "vtkCommonCoreModule.h"
44 #include "vtkFeatures.h"
55 VTK_ABI_NAMESPACE_BEGIN
57 class vtkGarbageCollectorToObjectBaseFriendship;
59 class vtkWeakPointerBaseToObjectBaseFriendship;
64 typedef void* (*vtkMallocingFunction)(size_t);
65 typedef void* (*vtkReallocingFunction)(
void*, size_t);
75 virtual const char* GetClassNameInternal()
const {
return "vtkObjectBase"; }
78 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
80 #define GetClassNameA GetClassName
81 #define GetClassNameW GetClassName
88 const char* GetClassName()
const;
96 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
101 const char* GetClassNameA()
const;
102 const char* GetClassNameW()
const;
128 static vtkIdType GetNumberOfGenerationsFromBaseType(
const char* name);
138 virtual vtkIdType GetNumberOfGenerationsFromBase(
const char* name);
145 virtual void Delete();
154 virtual void FastDelete();
169 void InitializeObjectBase();
171 #if defined(_WIN32) || defined(VTK_USE_MEMKIND)
173 void*
operator new(
size_t tSize);
174 void operator delete(
void* p);
181 void Print(ostream& os);
190 virtual void PrintSelf(ostream& os,
vtkIndent indent);
191 virtual void PrintHeader(ostream& os,
vtkIndent indent);
192 virtual void PrintTrailer(ostream& os,
vtkIndent indent);
226 int GetReferenceCount() {
return this->ReferenceCount; }
232 void SetReferenceCount(
int);
240 static
void SetMemkindDirectory(const
char* directoryname);
248 static
bool GetUsingMemkind();
258 #ifdef VTK_USE_MEMKIND
263 vtkMemkindRAII(
bool newValue);
265 vtkMemkindRAII(vtkMemkindRAII
const&) =
default;
268 void Save(
bool newValue);
276 bool GetIsInMemkind()
const;
303 virtual void ObjectFinalize();
307 friend class vtkGarbageCollectorToObjectBaseFriendship;
308 friend class vtkWeakPointerBaseToObjectBaseFriendship;
311 friend class vtkTDSCMemkindRAII;
312 static void SetUsingMemkind(
bool);
314 void SetIsInMemkind(
bool);
317 template <
typename T>
319 struct WeakControlBlock
330 std::shared_ptr<WeakControlBlock> GetWeakControlBlock();
331 std::mutex WeakBlockMutex;
332 std::weak_ptr<WeakControlBlock> WeakBlock;
342 void ClearReferenceCounts();
346 virtual const char* GetDebugClassName()
const;
352 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 &)
Detect and break reference loops.
a simple class to control print indentation
#define VTK_MARSHALGETTER(property)
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...
#define VTK_MARSHALEXCLUDE(reason)
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 &)
a weak reference to a vtkObjectBase.
#define VTK_MARSHAL_EXCLUDE_REASON_IS_INTERNAL