ezEngine Release 26.3
Loading...
Searching...
No Matches
ezRTTIDefaultAllocator< CLASS, AllocatorWrapper > Struct Template Reference

Standard RTTI allocator that creates instances using ezEngine's allocator system. More...

#include <RTTI.h>

Inheritance diagram for ezRTTIDefaultAllocator< CLASS, AllocatorWrapper >:

Public Member Functions

virtual ezInternal::NewInstance< void > AllocateInternal (ezAllocator *pAllocator) override
 Returns a new instance that was allocated with the given allocator.
 
virtual ezInternal::NewInstance< void > CloneInternal (const void *pObject, ezAllocator *pAllocator) override
 Clones the given instance with the given allocator.
 
virtual void Deallocate (void *pObject, ezAllocator *pAllocator) override
 Deletes the given instance with the given allocator.
 
- Public Member Functions inherited from ezRTTIAllocator
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.
 

Detailed Description

template<typename CLASS, typename AllocatorWrapper = ezDefaultAllocatorWrapper>
struct ezRTTIDefaultAllocator< CLASS, AllocatorWrapper >

Standard RTTI allocator that creates instances using ezEngine's allocator system.

This is the default allocator used by most reflected types. It provides standard heap allocation with proper integration into ezEngine's memory management system. The allocator wrapper allows customization of the underlying allocator (default, aligned, frame, etc.).

Template parameters:

  • CLASS: The type to allocate (must be copy-constructible for cloning)
  • AllocatorWrapper: Determines which allocator to use (default: ezDefaultAllocatorWrapper)

Member Function Documentation

◆ AllocateInternal()

template<typename CLASS , typename AllocatorWrapper = ezDefaultAllocatorWrapper>
virtual ezInternal::NewInstance< void > ezRTTIDefaultAllocator< CLASS, AllocatorWrapper >::AllocateInternal ( ezAllocator pAllocator)
inlineoverridevirtual

Returns a new instance that was allocated with the given allocator.

Implements ezRTTIAllocator.

◆ CloneInternal()

template<typename CLASS , typename AllocatorWrapper = ezDefaultAllocatorWrapper>
virtual ezInternal::NewInstance< void > ezRTTIDefaultAllocator< CLASS, AllocatorWrapper >::CloneInternal ( const void *  pObject,
ezAllocator pAllocator 
)
inlineoverridevirtual

Clones the given instance with the given allocator.

Reimplemented from ezRTTIAllocator.

◆ Deallocate()

template<typename CLASS , typename AllocatorWrapper = ezDefaultAllocatorWrapper>
virtual void ezRTTIDefaultAllocator< CLASS, AllocatorWrapper >::Deallocate ( void *  pObject,
ezAllocator pAllocator 
)
inlineoverridevirtual

Deletes the given instance with the given allocator.

Implements ezRTTIAllocator.


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