FSmallListSet

[FSmallListSet](API\Plugins\GeometricObjects\Util\FSmallListSet) stores a set of short integer-valued variable-size lists.

Windows
MacOS
Linux

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/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 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

Name Description

Protected variable

int32

 

AllocatedCount

Number of allocated lists

Protected variable

TDynamicVector<...

 

FreeBlocks

List of free blocks as indices/offsets into block_store

Protected variable

int32

 

FreeHeadIndex

Index of first free element in linked_store

Protected variable

TDynamicVector<...

 

LinkedListElements

Flat buffer used to store linked-list "spill" elements each element is [value, next_ptr]

Protected variable

TDynamicVector<...

 

ListBlocks

Flat buffer used to store per-list linear-memory blocks.

Protected variable

TDynamicVector<...

 

ListHeads

Mapping from list index to offset into block_store that contains list data

Functions

Name Description

Protected function

void

 

AddFreeLink

(
    int32 ptr
)

Push a link-node onto the free list

Public function

void

 

AllocateAt

(
    int32 ListIndex
)

Create a list at the given ListIndex

Protected function

int32

 

AllocateBlock()

Grab a block from the free list, or allocate a one

Public function Const

MappedValueI...

 

BeginMappedValues

(
    int32 ListIndex,
    const TFunction< int32)>& Ma...
)

Public function Const

ValueIterato...

 

BeginValues

(
    int32 ListIndex
)

Public function

void

 

Clear

(
    int32 ListIndex
)

Remove all elements from the list at ListIndex

Public function Const

bool

 

Contains

(
    int32 ListIndex,
    int32 Value
)

Search for the given Value in list at ListIndex

Public function Const

MappedValueI...

 

EndMappedValues

(
    int32 ListIndex,
    const TFunction< int32)>& Ma...
)

Public function Const

ValueIterato...

 

EndValues

(
    int32 ListIndex
)

Public function Const

void

 

Enumerate

(
    int32 ListIndex,
    TFunctionRef< void)> ApplyFun...
)

Call ApplyFunc on each element of the list at ListIndex

Public function Const

int32

 

Find

(
    int32 ListIndex,
    const TFunction< bool)>& Pre...,
    int32 InvalidValue
)

Search the list at ListIndex for a value where PredicateFunc(value) returns true

Public function Const

int32

 

First

(
    int32 ListIndex
)

Does not check for zero-size-list!

Public function Const

int32

 

GetCount

(
    int32 ListIndex
)

Public function

void

 

Insert

(
    int32 ListIndex,
    int32 Value
)

Insert Value into list at ListIndex

Public function Const

bool

 

IsAllocated

(
    int32 ListIndex
)

Public function Const

MappedValueE...

 

MappedValues

(
    int32 ListIndex,
    TFunction< int32)> MapFunc
)

Public function

FString

 

MemoryUsage()

Public function

void

 

Move

(
    int32 FromIndex,
    int32 ToIndex
)

Move list at FromIndex to ToIndex

Public function

bool

 

Remove

(
    int32 ListIndex,
    int32 Value
)

Remove Value from the list at ListIndex

Protected function

bool

 

RemoveFromLinkedList

(
    int32 block_ptr,
    int32 val
)

Remove val from the linked-list attached to block_ptr

Public function

bool

 

Replace

(
    int32 ListIndex,
    const TFunction< bool)>& Pre...,
    int32 NewValue
)

Search the list at ListIndex for a value where PredicateFunc(value) returns true, and replace it with NewValue

Public function

void

 

Resize

(
    int32 NewSize
)

Set new number of lists

Public function Const

size_t

 

Size()

Public function Const

ValueEnumera...

 

Values

(
    int32 ListIndex
)

Classes

Name

Description

Public class

BaseValueIterator

BaseValueIterator is a base class for ValueIterator and MappedValueIterator below.

Public class

MappedValueEnumerable

MappedValueEnumerable is an object that provides begin/end semantics for a small list, suitable for use with a range-based for loop

Public class

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

Public class

ValueEnumerable

ValueEnumerable is an object that provides begin/end semantics for a small list, suitable for use with a range-based for loop

Public class

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

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss