ezEngine Release 26.3
Loading...
Searching...
No Matches
ezRTTIAllocator Struct Referenceabstract

Interface for allocators that create instances of reflected types. More...

#include <RTTI.h>

Inheritance diagram for ezRTTIAllocator:

Public Member Functions

virtual bool CanAllocate () const
 Returns whether the type that is represented by this allocator, can be dynamically allocated at runtime.
 
template<typename T >
ezInternal::NewInstance< T > Allocate (ezAllocator *pAllocator=nullptr)
 Allocates one instance.
 
template<typename T >
ezInternal::NewInstance< T > Clone (const void *pObject, ezAllocator *pAllocator=nullptr)
 Clones the given instance.
 
virtual void Deallocate (void *pObject, ezAllocator *pAllocator=nullptr)=0
 Deallocates the given instance.
 

Detailed Description

Interface for allocators that create instances of reflected types.

The RTTI allocator system provides controlled object creation for reflected types, enabling features like custom memory management, object pooling, and creation tracking. Different allocator implementations can optimize for specific use cases:

Member Function Documentation

◆ AllocateInternal()

virtual ezInternal::NewInstance< void > ezRTTIAllocator::AllocateInternal ( ezAllocator pAllocator)
privatepure virtual

◆ CanAllocate()

virtual bool ezRTTIAllocator::CanAllocate ( ) const
inlinevirtual

Returns whether the type that is represented by this allocator, can be dynamically allocated at runtime.

Reimplemented in ezRTTINoAllocator.

◆ CloneInternal()

virtual ezInternal::NewInstance< void > ezRTTIAllocator::CloneInternal ( const void *  pObject,
ezAllocator pAllocator 
)
inlineprivatevirtual

◆ Deallocate()

virtual void ezRTTIAllocator::Deallocate ( void *  pObject,
ezAllocator pAllocator = nullptr 
)
pure virtual

The documentation for this struct was generated from the following files: