Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Containers/SparseArray.h |
Include |
#include "Containers/SparseArray.h" |
template<typename InElementType, typename Allocator>
class TSparseArray
A dynamically sized array where element indices aren't necessarily contiguous. Memory is allocated for all elements in the array's index range, so it doesn't save memory; but it does allow O(1) element removal that doesn't invalidate the indices of subsequent elements. It uses TArray to store the elements, and a TBitArray to store whether each element index is allocated (for fast iteration over allocated elements).
Name | Description | ||
---|---|---|---|
|
*: Add(A) ... |
Frame2 |
Sort the free element list so that subsequent allocations will occur in the lowest available position resulting in tighter packing without moving any existing items. |
|
Free list is |
now |
Name | Description | |
---|---|---|
|
~TSparseArray() |
Destructor. |
Name | Description | ||
---|---|---|---|
|
Add ( |
||
|
int32 |
Add ( |
Adds an element to the array. |
|
int32 |
Add ( |
Adds an element to the array. |
|
FSparseArray... |
AddUninitialized() |
Allocates space for an element in the array. |
|
FSparseArray... |
AddUninitializedAtLowestFreeIndex ( |
|
|
FSparseArray... |
AllocateIndex ( |
Marks an index as allocated, and returns information about the allocation. |
|
void |
AppendHash ( |
|
|
FORCEINLINET... |
begin() |
|
|
FORCEINLINET... |
begin() |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support. |
|
bool |
Compact() |
Compacts the allocated elements into a contiguous index range. |
|
bool |
CompactStable() |
Compacts the allocated elements into a contiguous index range. |
|
void |
CopyUnfrozen ( |
|
|
TConstIterat... |
CreateConstIterator() |
Creates a const iterator for the contents of this array |
|
CreateIterator() |
Creates an iterator for the contents of this array |
|
|
int32 |
Emplace ( |
Constructs a new item at the last freed index of the array. |
|
int32 |
EmplaceAt ( |
Constructs a new item at a given index of the array. |
|
int32 |
EmplaceAtLowestFreeIndex ( |
Constructs a new item at the lowest free index of the array. |
|
void |
Empty ( |
Removes all elements from the array, potentially leaving space allocated for an expected number of elements about to be added. |
|
FORCEINLINET... |
end() |
|
|
FORCEINLINET... |
end() |
|
|
void |
Insert ( |
Inserts an element to the array. |
|
FSparseArray... |
InsertUninitialized ( |
Allocates space for an element in the array at a given index. |
|
Remove ( |
||
|
Remove ( |
||
|
void |
RemoveAt ( |
Removes Count elements from the array, starting from Index. |
|
void |
RemoveAtUninitialized ( |
Removes Count elements from the array, starting from Index, without destructing them. |
|
void |
Reserve ( |
Preallocates enough memory to contain the specified number of elements. |
|
void |
Reset() |
Empties the array, but keep its allocated memory as slack. |
|
void |
Shrink() |
Shrinks the array's storage to avoid slack. |
|
void |
Sort() |
Sorts the elements assuming < operator is defined for ElementType. |
|
void |
Sort ( |
Sorts the elements using the provided comparison class. |
|
void |
StableSort() |
Stable sorts the elements assuming < operator is defined for ElementType. |
|
void |
StableSort ( |
Stable sorts the elements using the provided comparison class. |
|
void |
WriteMemoryImage ( |
Name | Description | ||
---|---|---|---|
|
TSparseArray... |
operator+= ( |
|
|
TSparseArray... |
operator+= ( |
Concatenation operators |
Name |
Description |
|
---|---|---|
|
TConstIterator |
Iterates over all allocated elements in a const sparse array. |
|
TConstSubsetIterator |
An iterator which only iterates over the elements of the array which correspond to set bits in a separate bit array. |
|
TIterator |
Iterates over all allocated elements in a sparse array. |
|
TRangedForConstIterator |
|
|
TRangedForIterator |
Name |
Description |
---|---|
AllocationBitArrayType |
|
DataType |
|
ElementType |
|
FElementOrFreeListLink |
The element type stored is only indirectly related to the element type requested, to avoid instantiating TArray redundantly for compatible types. |
TRangedForConstIterator |
|
TRangedForIterator |
Name | Description | ||
---|---|---|---|
|
int32 |
AddAtLowestFreeIndex ( |
AddAtLowestFreeIndex API is deprecated; please use EmplaceAtLowestFreeIndex instead. |