NDEVR
API Documentation
ObjectAllocator< t_type, t_is_primitive, t_index_type >

Allows for specific, custom logic for allocating an object. More...

Inheritance diagram for ObjectAllocator< t_type, t_is_primitive, t_index_type >:
[legend]

Static Public Member Functions

template<class t_buffer_type>
static constexpr void Allocate (t_buffer_type &buffer, t_index_type start, t_index_type size) noexcept
 Allocates a range of elements in the buffer, delegating to the appropriate primitive or non-primitive allocator.
template<class t_buffer_type>
static constexpr void AllocateElement (t_buffer_type &buffer, t_index_type index, const t_type &object) noexcept
 Allocates a single element by copy-constructing from a given object.
template<class t_buffer_type>
static constexpr void AllocateElement (t_buffer_type &buffer, t_index_type index, t_type &&object) noexcept
 Allocates a single element by move-constructing from a given object.
template<class t_buffer_type>
static constexpr void AllocateElement (t_buffer_type &buffer, t_index_type start, t_index_type size, const t_type &object) noexcept
 Allocates a range of elements by copy-constructing from a given object.
template<class t_buffer_type>
static constexpr void AllocateElement (t_buffer_type &buffer, t_index_type start, t_index_type size, t_type &object) noexcept
 Allocates a range of elements by constructing from a given mutable object reference.
template<class t_buffer_type>
static constexpr void Deallocate (t_buffer_type &buffer, t_index_type start, t_index_type size) noexcept
 Deallocates a range of elements in the buffer, delegating to the appropriate primitive or non-primitive allocator.
static constexpr bool isPrimitive () noexcept
 Checks whether this allocator handles primitive types.

Detailed Description

template<class t_type, bool t_is_primitive, class t_index_type>
class ObjectAllocator< t_type, t_is_primitive, t_index_type >

Allows for specific, custom logic for allocating an object.


By default allocates based on whether a constructor needs to be called or not (t_is_primitive)

Definition at line 334 of file MemoryManager.h.

Member Function Documentation

◆ Allocate()

template<class t_type, bool t_is_primitive, class t_index_type>
template<class t_buffer_type>
constexpr void ObjectAllocator< t_type, t_is_primitive, t_index_type >::Allocate ( t_buffer_type & buffer,
t_index_type start,
t_index_type size )
inlinestaticconstexprnoexcept

Allocates a range of elements in the buffer, delegating to the appropriate primitive or non-primitive allocator.

Parameters
[in]bufferThe buffer to allocate within.
[in]startThe starting index for allocation.
[in]sizeThe number of elements to allocate.

Definition at line 344 of file MemoryManager.h.

Referenced by ObjectAllocator< bool, true, t_index_type >::Allocate().

◆ AllocateElement() [1/4]

template<class t_type, bool t_is_primitive, class t_index_type>
template<class t_buffer_type>
constexpr void ObjectAllocator< t_type, t_is_primitive, t_index_type >::AllocateElement ( t_buffer_type & buffer,
t_index_type index,
const t_type & object )
inlinestaticconstexprnoexcept

Allocates a single element by copy-constructing from a given object.

Parameters
[in]bufferThe buffer to allocate within.
[in]indexThe index at which to place the element.
[in]objectThe value to copy.

Definition at line 390 of file MemoryManager.h.

◆ AllocateElement() [2/4]

template<class t_type, bool t_is_primitive, class t_index_type>
template<class t_buffer_type>
constexpr void ObjectAllocator< t_type, t_is_primitive, t_index_type >::AllocateElement ( t_buffer_type & buffer,
t_index_type index,
t_type && object )
inlinestaticconstexprnoexcept

Allocates a single element by move-constructing from a given object.

Parameters
[in]bufferThe buffer to allocate within.
[in]indexThe index at which to place the element.
[in]objectThe value to move.

Definition at line 401 of file MemoryManager.h.

◆ AllocateElement() [3/4]

template<class t_type, bool t_is_primitive, class t_index_type>
template<class t_buffer_type>
constexpr void ObjectAllocator< t_type, t_is_primitive, t_index_type >::AllocateElement ( t_buffer_type & buffer,
t_index_type start,
t_index_type size,
const t_type & object )
inlinestaticconstexprnoexcept

Allocates a range of elements by copy-constructing from a given object.

Parameters
[in]bufferThe buffer to allocate within.
[in]startThe starting index for allocation.
[in]sizeThe number of elements to initialize.
[in]objectThe value to copy into each element.

Definition at line 367 of file MemoryManager.h.

Referenced by ObjectAllocator< bool, true, t_index_type >::AllocateElement(), ObjectAllocator< bool, true, t_index_type >::AllocateElement(), ObjectAllocator< bool, true, t_index_type >::AllocateElement(), and ObjectAllocator< bool, true, t_index_type >::AllocateElement().

◆ AllocateElement() [4/4]

template<class t_type, bool t_is_primitive, class t_index_type>
template<class t_buffer_type>
constexpr void ObjectAllocator< t_type, t_is_primitive, t_index_type >::AllocateElement ( t_buffer_type & buffer,
t_index_type start,
t_index_type size,
t_type & object )
inlinestaticconstexprnoexcept

Allocates a range of elements by constructing from a given mutable object reference.

Parameters
[in]bufferThe buffer to allocate within.
[in]startThe starting index for allocation.
[in]sizeThe number of elements to initialize.
[in]objectThe value to copy into each element.

Definition at line 379 of file MemoryManager.h.

◆ Deallocate()

template<class t_type, bool t_is_primitive, class t_index_type>
template<class t_buffer_type>
constexpr void ObjectAllocator< t_type, t_is_primitive, t_index_type >::Deallocate ( t_buffer_type & buffer,
t_index_type start,
t_index_type size )
inlinestaticconstexprnoexcept

Deallocates a range of elements in the buffer, delegating to the appropriate primitive or non-primitive allocator.

Parameters
[in]bufferThe buffer to deallocate within.
[in]startThe starting index for deallocation.
[in]sizeThe number of elements to deallocate.

Definition at line 355 of file MemoryManager.h.

Referenced by ObjectAllocator< bool, true, t_index_type >::Deallocate().

◆ isPrimitive()

template<class t_type, bool t_is_primitive, class t_index_type>
constexpr bool ObjectAllocator< t_type, t_is_primitive, t_index_type >::isPrimitive ( )
inlinestaticconstexprnoexcept

Checks whether this allocator handles primitive types.

Returns
True if the allocator is for primitive types, false otherwise.

Definition at line 409 of file MemoryManager.h.


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