![]() |
Plasma Engine
2.0
|
Helper class to manager instance data allocation, construction and destruction. More...
#include <InstanceDataAllocator.h>
Public Member Functions | |
plUInt32 | AddDesc (const plInstanceDataDesc &desc) |
Adds the given desc to internal list of data that needs to be allocated and returns the byte offset. | |
void | ClearDescs () |
Resets all internal state. | |
void | Construct (plByteBlobPtr blobPtr) const |
Constructs the instance data objects, within the pre-allocated memory block. | |
void | Destruct (plByteBlobPtr blobPtr) const |
Destructs the instance data objects. | |
plBlob | AllocateAndConstruct () const |
Allocates memory and constructs the instance data objects inside it. The returned plBlob must be stored somewhere. | |
void | DestructAndDeallocate (plBlob &ref_blob) const |
Destructs and deallocates the instance data objects and the given memory block. | |
plUInt32 | GetTotalDataSize () const |
The total size in bytes taken up by all instance data objects that were added. | |
Static Public Member Functions | |
static PL_ALWAYS_INLINE void * | GetInstanceData (const plByteBlobPtr &blobPtr, plUInt32 uiOffset) |
Retrieves a void pointer to the instance data within the given blob at the given offset, or nullptr if the offset is invalid. | |
Helper class to manager instance data allocation, construction and destruction.