Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Util
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Util/SmallListSet.h |
| Include | #include "Util/SmallListSet.h" |
Syntax
class FSmallListSet
Remarks
FSmallListSet stores a set of short integer-valued variable-size lists. The lists are encoded into a few large TDynamicVector buffers, with internal pooling, so adding/removing lists usually does not involve any new or delete ops.
The lists are stored in two parts. The first N elements are stored in a linear subset of a TDynamicVector. If the list spills past these N elements, the extra elements are stored in a linked list (which is also stored in a flat array).
Each list stores its count, so list-size operations are constant time. All the internal "pointers" are 32-bit.
Variables
| Type | Name | Description | |
|---|---|---|---|
| int32 | AllocatedCount | Number of allocated lists | |
| TDynamicVector< int32 > | FreeBlocks | List of free blocks as indices/offsets into ListBlocks | |
| int32 | FreeHeadIndex | Index of first free element in linked_store | |
| TDynamicVector< int32 > | LinkedListElements | Flat buffer used to store linked-list "spill" elements each element is [value, next_ptr] | |
| TDynamicVector< int32 > | ListBlocks | Flat buffer used to store per-list linear-memory blocks. | |
| TDynamicVector< int32 > | ListHeads | Mapping from list index to offset into ListBlocks that contains list data |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddFreeLink
(
int32 ptr |
Push a link-node onto the free list | |
| void | AllocateAt
(
int32 ListIndex |
Create a list at the given ListIndex | |
| int32 | Grab a block from the free list, or allocate a new one | ||
| MappedValueIterator | BeginMappedValues
(
int32 ListIndex, |
||
| ValueIterator | BeginValues
(
int32 ListIndex |
||
| void | Remove all elements from the list at ListIndex | ||
| bool | Search for the given Value in list at ListIndex | ||
| MappedValueIterator | EndMappedValues
(
int32 ListIndex, |
||
| ValueIterator | |||
| void | Enumerate
(
int32 ListIndex, |
Call ApplyFunc on each element of the list at ListIndex | |
| bool | EnumerateEarlyOut
(
int32 ListIndex, |
Call ApplyFunc on each element of the list at ListIndex, until ApplyFunc returns false | |
| int32 | Search the list at ListIndex for a value where PredicateFunc(value) returns true | ||
| int32 | Does not check for zero-size-list! | ||
| int32 | |||
| void | Insert Value into list at ListIndex | ||
| bool | IsAllocated
(
int32 ListIndex |
||
| MappedValueEnumerable | MappedValues
(
int32 ListIndex, |
||
| FString | MemoryUsage () |
||
| void | Move list at FromIndex to ToIndex | ||
| bool | Remove Value from the list at ListIndex | ||
| bool | RemoveFromLinkedList
(
int32 block_ptr, |
Remove val from the linked-list attached to block_ptr | |
| bool | Search the list at ListIndex for a value where PredicateFunc(value) returns true, and replace it with NewValue | ||
| void | Reset () |
Reset to initial state | |
| void | Set new number of lists | ||
| void | Serialize FSmallListSet to an archive. | ||
| size_t | Size () |
||
| ValueEnumerable |
Classes
| Type | Name | Description | |
|---|---|---|---|
| BaseValueIterator | BaseValueIterator is a base class for ValueIterator and MappedValueIterator below. | ||
| MappedValueEnumerable | MappedValueEnumerable is an object that provides begin/end semantics for a small list, suitable for use with a range-based for loop | ||
| MappedValueIterator | MappedValueIterator iterates over the values of a small list An optional mapping function can be provided which will then be applied to the values returned by the * operator | ||
| ValueEnumerable | ValueEnumerable is an object that provides begin/end semantics for a small list, suitable for use with a range-based for loop | ||
| ValueIterator | ValueIterator iterates over the values of a small list |
Constants
| Name | Description |
|---|---|
| BLOCK_LIST_OFFSET | Offset from start of linear-memory portion of list that contains pointer to head of variable-length linked list |
| BLOCKSIZE | Size of initial linear-memory portion of lists |
| NullValue | This value is used to indicate Null in internal pointers |