Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
Gray::cHeapObject Class Reference

#include <cHeapObject.h>

Inheritance diagram for Gray::cHeapObject:
Gray::IHeapObject Gray3D::cModelXFrame Gray::CStringData Gray::cListNodeBase Gray::cSingletonRegister GrayLib::cScriptableInterfaceDynamic GrayLib::cVarTuple GrayLib::cXObject GrayMapData::cMapBase

Public Member Functions

 cHeapObject ()
 
virtual ~cHeapObject ()
 
bool IsValidInsideN (INT_PTR index) const
 
bool IsValidInsidePtr (void const *pTest) const
 
virtual size_t GetHeapStatsThis (OUT ITERATE_t &iAllocCount) const
 
virtual bool isValidCheck () const noexcept
 

Protected Member Functions

const void * get_HeapPtr () const noexcept override
 Get the top level (outermost, freeable) class pointer. I can delete get_HeapPtr(). More...
 

Detailed Description

The base of some class/struct object that is ALWAYS heap allocated. This item MUST always be dynamically allocated with new/delete! Never stack (auto) or data segment (static) based. get_HeapPtr() must be declared by the highest level ! since derived classes wrap their base classes. multiple inheritance can disguise the base allocated pointer

Constructor & Destructor Documentation

◆ cHeapObject()

Gray::cHeapObject::cHeapObject ( )
inline
Note
virtuals don't work in constructors or destructors !

◆ ~cHeapObject()

virtual Gray::cHeapObject::~cHeapObject ( )
inlinevirtual
Note
virtuals do not work in destructors ! get_HeapPtr? so isValidCheck() not possible here !

Member Function Documentation

◆ get_HeapPtr()

◆ GetHeapStatsThis()

virtual size_t Gray::cHeapObject::GetHeapStatsThis ( OUT ITERATE_t iAllocCount) const
inlinevirtual

Not the same as GetHeapStats(). size of *this as opposed to size of children.

◆ isValidCheck()

virtual bool Gray::cHeapObject::isValidCheck ( ) const
inlinevirtualnoexcept
Note
can't call this in a destructor since get_HeapPtr() is virtual.

Reimplemented in GrayLib::cXObject, and GrayLib::cVarTuple.

◆ IsValidInsideN()

bool Gray::cHeapObject::IsValidInsideN ( INT_PTR  index) const
inline

Is index a valid offset inside this object?

◆ IsValidInsidePtr()

bool Gray::cHeapObject::IsValidInsidePtr ( void const *  pTest) const
inline

Is pTest a valid pointer inside the this object ?


The documentation for this class was generated from the following file: