Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Util
References
| Module | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/Public/Util/SparseListSet.h |
| Include | #include "Util/SparseListSet.h" |
Syntax
template<typename ElementType>
struct TSparseListSet
Remarks
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).
Constructors
| Type | Name | Description | |
|---|---|---|---|
TSparseListSet
(
int BlockSizeIn, |
Functions
| Type | Name | Description | |
|---|---|---|---|
| FListHandle | AllocateAt
(
int32 ListIndex |
Create a list at the given ListIndex | |
| void | Clear
(
int32 ListIndex |
Remove all elements from the list at ListIndex | |
| bool | Contains
(
int32 ListIndex, |
Search for the given Value in list at ListIndex | |
| void | Enumerate
(
int32 ListIndex, |
Call ApplyFunc on each element of the list at ListIndex | |
| int32 | GetCount
(
int32 ListIndex |
||
| void | Insert
(
int32 ListIndex, |
Insert Value into List at ListIndex | |
| void | Insert
(
FListHandle ListHandle, |
Insert Value into List identified by ListHandle | |
| bool | IsAllocated
(
int32 ListIndex |
||
| bool | Remove
(
int32 ListIndex, |
Remove first occurrence of Value from the list at ListIndex | |
| void | Set the values of the List at ListIndex | ||
| void | SetValues
(
FListHandle ListHandle, |
Set the values of the List identified by ListHandle |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FListHandle | Handle to an allocated list returned by AllocateAt() |