![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SparseArray.h>
Inheritance diagram for TSparseArray< InElementType, Allocator >:Classes | |
| class | TConstIterator |
| class | TConstSubsetIterator |
| class | TIterator |
| class | TRangedForConstIterator |
| class | TRangedForIterator |
Public Types | |
| using | IntrusiveUnsetOptionalStateType = TSparseArray |
Static Public Member Functions | |
| static void | AppendHash (const FPlatformTypeLayoutParameters &LayoutParams, FSHA1 &Hasher) |
Static Public Attributes | |
| static constexpr bool | bHasIntrusiveUnsetOptionalState = true |
Friends | |
| template<typename , typename > | |
| class | TScriptSparseArray |
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).
| using TSparseArray< InElementType, Allocator >::IntrusiveUnsetOptionalStateType = TSparseArray |
|
inline |
Destructor.
|
inlineexplicit |
|
constexprdefault |
Default constructor.
|
inlineexplicit |
|
inline |
Move constructor.
|
inline |
Copy constructor.
|
inline |
Initializer list constructor.
|
inline |
Adds an element to the array.
|
inline |
Adds an element to the array.
|
inlinestatic |
|
inline |
DO NOT USE DIRECTLY STL-like iterators to enable range-based for loop support.
|
inline |
|
inline |
Checks that the specified address is not part of an element within the container. Used for implementations to check that reference arguments aren't going to be invalidated by possible reallocation.
| Addr | The address to check. |
|
inline |
Compacts the allocated elements into a contiguous index range. Does not change the iteration order of the elements. Returns true if any elements were relocated, false otherwise.
|
inline |
|
inline |
Tracks the container's memory use through an archive.
|
inline |
Creates a const iterator for the contents of this array
|
inline |
Creates an iterator for the contents of this array
|
inline |
Constructs a new item at the last freed index of the array.
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Constructs a new item at a given index of the array.
| Index | Index at which the new allocation will be done |
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Constructs a new item at the lowest free index of the array. This requires a search which can be accelerated with LowestFreeIndexSearchStart.
| LowestFreeIndexSearchStart | Where to start the search for a free index. |
| Args | The arguments to forward to the constructor of the new item. |
|
inline |
Removes all elements from the array, potentially leaving space allocated for an expected number of elements about to be added.
| ExpectedNumElements | - The expected number of elements about to be added. |
|
inline |
|
inline |
|
inline |
Finds the index of an arbitrary element. Callers should not depend on particular patterns in the behaviour of this function.
|
inline |
Helper function to return the amount of memory allocated by this container Only returns the size of allocations made directly by the container, not the elements themselves.
|
inline |
Finds an item by predicate.
| Pred | The predicate to match. |
|
inline |
Inserts an element to the array.
|
inline |
|
inline |
Inequality comparison operator. Checks that both arrays have the same elements and element indices; that means that unallocated elements are signifigant!
|
inline |
|
inline |
Concatenation operators
|
inline |
Copy assignment operator.
|
inline |
Initializer list assignment operator.
|
inline |
Move assignment operator.
|
inline |
Equality comparison operator. Checks that both arrays have the same elements and element indices; that means that unallocated elements are signifigant!
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Removes Count elements from the array, starting from Index.
|
inline |
Empties the array, but keep its allocated memory as slack.
|
inline |
Sorts the elements assuming < operator is defined for ElementType.
|
inline |
Sorts the elements using the provided comparison class.
|
inline |
Stable sorts the elements assuming < operator is defined for ElementType.
|
inline |
Stable sorts the elements using the provided comparison class.
|
inline |
|
friend |
|
staticconstexpr |