![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <SparseListSet.h>
Classes | |
| struct | FListHandle |
Public Member Functions | |
| TSparseListSet () | |
| TSparseListSet (int BlockSizeIn, int BlocksPerChunkIn) | |
| bool | IsAllocated (int32 ListIndex) const |
| FListHandle | AllocateAt (int32 ListIndex) |
| void | Insert (int32 ListIndex, ElementType Value) |
| void | Insert (FListHandle ListHandle, ElementType Value) |
| void | SetValues (int32 ListIndex, const TArray< ElementType > &Values) |
| void | SetValues (FListHandle ListHandle, const TArray< ElementType > &Values) |
| bool | Remove (int32 ListIndex, ElementType Value) |
| void | Clear (int32 ListIndex) |
| int32 | GetCount (int32 ListIndex) const |
| bool | Contains (int32 ListIndex, ElementType Value) const |
| template<typename FuncType > | |
| void | Enumerate (int32 ListIndex, FuncType Func) const |
| template<typename FuncType > | |
| bool | EnumerateEarlyOut (int32 ListIndex, FuncType ApplyFunc) const |
TSparseListSet stores a sparse set of indexed variable-size lists. This is useful in cases where many relatively small lists that have a 1-1 correspondence with a bounded index space are needed, eg for per-vertex lists for a mesh, per-cell lists for an octree, etc.
The interface is compatible with FSmallListSet, which may be more effective for very small lists (optimized for ~8 elements), but does not scale very well to larger lists (10s-to-100s).
Internally, TSparseListSet uses a strategy where the small lists are stored in sequences of fixed-size blocks, similar to FDynamicVector, but the block size is configurable. The blocks are allocated from larger "chunks" of blocks (also of configurable size). These parameters can be set on construction to values appropriate for particular use cases.
TSparseListSet can support parallel insertion into the lists. Note however that lists cannot be added (via AllocateAt) while parallel insertion occurs via Insert(Index). To allow for this type of usage, AllocateAt() returns a FListHandle which can then be used with Insert() or SetValues() even while other AllocateAt() calls occur (within a lock).
|
inline |
|
inline |
| BlockSizeIn | defines size of small blocks that each list is made up of |
| BlocksPerChunkIn | defines size of large chunks that small blocks are allocated from |
|
inline |
Create a list at the given ListIndex
|
inline |
Remove all elements from the list at ListIndex
| bool UE::Geometry::TSparseListSet< ElementType >::Contains | ( | int32 | ListIndex, |
| ElementType | Value | ||
| ) | const |
Search for the given Value in list at ListIndex
|
inline |
Call ApplyFunc on each element of the list at ListIndex
|
inline |
Call ApplyFunc on each element of the list at ListIndex, until ApplyFunc returns false
|
inline |
|
inline |
Insert Value into List identified by ListHandle
|
inline |
Insert Value into List at ListIndex
|
inline |
|
inline |
remove first occurrence of Value from the list at ListIndex
|
inline |
Set the values of the List identified by ListHandle
|
inline |
Set the values of the List at ListIndex