3#include <Foundation/Containers/ArrayBase.h>
4#include <Foundation/Memory/AllocatorWrapper.h>
5#include <Foundation/Types/PointerWithFlags.h>
40 const T* GetElementsPtr()
const;
46 void Reserve(plUInt32 uiCapacity);
72 CAPACITY_ALIGNMENT = 16
75 void SetCapacity(plUInt32 uiCapacity);
79template <
typename T,
typename AllocatorWrapper = plDefaultAllocatorWrapper>
83 PL_DECLARE_MEM_RELOCATABLE_TYPE();
111template <
typename T,
typename AllocatorWrapper>
115template <
typename T,
typename AllocatorWrapper>
119template <
typename T,
typename AllocatorWrapper>
125#include <Foundation/Containers/Implementation/DynamicArray_inl.h>
Base class for all memory allocators.
Definition Allocator.h:23
Base class for all array containers. Implements all the basic functionality that only requires a poin...
Definition ArrayBase.h:19
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Implementation of a dynamically growing array.
Definition DynamicArray.h:14
~plDynamicArrayBase()
Destructor.
Definition DynamicArray_inl.h:39
plAllocator * GetAllocator() const
Returns the allocator that is used by this instance.
Definition DynamicArray.h:53
void Swap(plDynamicArrayBase< T > &other)
swaps the contents of this array with another one
Definition DynamicArray_inl.h:100
plUInt64 GetHeapMemoryUsage() const
Returns the amount of bytes that are currently allocated on the heap.
Definition DynamicArray_inl.h:234
plDynamicArrayBase(plAllocator *pAllocator)
Creates an empty array. Does not allocate any data yet.
Definition DynamicArray_inl.h:3
void Compact()
Tries to compact the array to avoid wasting memory. The resulting capacity is at least 'GetCount' (no...
Definition DynamicArray_inl.h:202
void Reserve(plUInt32 uiCapacity)
Expands the array so it can at least store the given capacity.
Definition DynamicArray_inl.h:179
void operator=(const plDynamicArrayBase< T > &rhs)
Copies the data from some other contiguous array into this one.
Definition DynamicArray_inl.h:54
Definition DynamicArray.h:81
A wrapper around a raw pointer that allows to use the lower N bits for flags.
Definition PointerWithFlags.h:12
const PtrType * GetPtr() const
Returns the masked off pointer value.
Definition PointerWithFlags.h:41
If there is an % operator which takes a plTypeIsMemRelocatable and returns a CompileTimeTrueType T is...
Definition TypeTraits.h:67