FRefCountVector

[FRefCountVector](API\Plugins\GeometricObjects\Util\FRefCountVector) is used to keep track of which indices in a linear Index list are in use/referenced.

Windows
MacOS
Linux

Warnings

  • refcounts are 16-bit ints (shorts) so the maximum count is 65536. behavior is undefined if this overflows.

  • No overflow checking is done in release builds.

References

Module

GeometricObjects

Header

/Engine/Plugins/Experimental/GeometryProcessing/Source/GeometricObjects/Public/Util/RefCountVector.h

Include

#include "Util/RefCountVector.h"

Syntax

class FRefCountVector

Remarks

FRefCountVector is used to keep track of which indices in a linear Index list are in use/referenced. A free list is tracked so that unreferenced indices can be re-used.

The enumerator iterates over valid indices (ie where refcount > 0)

refcounts are 16-bit ints (shorts) so the maximum count is 65536. behavior is undefined if this overflows.

No overflow checking is done in release builds.

Constructors

Name Description

Public function

FRefCountVector()

Public function

FRefCountVector

(
    const FRefCountVector&
)

Public function

FRefCountVector

(
    FRefCountVector&&
)

Functions

Name Description

Public function

int

 

Allocate()

Public function

bool

 

AllocateAt

(
    int Index
)

Allocate at specific Index, which must either be larger than current max Index, or on the free list.

Public function

bool

 

AllocateAtUnsafe

(
    int Index
)

Allocate at specific Index, which must be free or larger than current max Index.

Public function Const

IndexIterato...

 

BeginIndices()

Public function

void

 

Decrement

(
    int Index,
    short DecrementCount
)

Public function Const

IndexIterato...

 

EndIndices()

Public function Const

FilteredEnum...

 

FilteredIndices

(
    TFunction< bool> FilterFunc
)

Public function Const

size_t

 

GetCount()

Public function Const

size_t

 

GetMaxIndex()

Public function Const

int

 

GetRawRefCount

(
    int Index
)

Public function Const

const TDynam...

 

GetRawRefCounts()

Public function

TDynamicVect...

 

GetRawRefCountsUnsafe()

You should not use this!

Public function Const

int

 

GetRefCount

(
    int Index
)

Public function

int

 

Increment

(
    int Index,
    short IncrementCount
)

Public function Const

IndexEnumera...

 

Indices()

Returns iteration object over valid indices usage: for (int idx : indices()) { ... }

Public function Const

bool

 

IsDense()

Public function Const

bool

 

IsEmpty()

Public function Const

bool

 

IsValid

(
    int Index
)

Public function Const

bool

 

IsValidUnsafe

(
    int Index
)

Public function Const

MappedEnumer...

 

MappedIndices

(
    TFunction< ToType(int)> MapFunc
)

Returns iteration object over mapping applied to valid indices eg usage: for (FVector3d v : mapped_indices(fn_that_looks_up_mesh_vtx_from_id)) { ... }

Public function

void

 

RebuildFreeList()

Todo: remove clear

Public function

void

 

SetRefCountUnsafe

(
    int Index,
    short ToCount
)

You should not use this!

Public function

void

 

Trim

(
    int maxIndex
)

Public function

FString

 

UsageStats()

Operators

Name Description

Public function

FRefCountVec...

 

operator=

(
    const FRefCountVector&
)

Public function

FRefCountVec...

 

operator=

(
    FRefCountVector&&
)

Classes

Name

Description

Public class

BaseIterator

Iterators base iterator for indices with valid refcount (skips zero-refcount indices)

Public class

FilteredEnumerable

Iteration object that maps indices output by Index_iteration to a second type

Public class

IndexEnumerable

Enumerable object that provides begin()/end() semantics, so you can iterate over valid indices using range-based for loop

Public class

IndexIterator

Iterator over valid indices (ie non-zero refcount)

Public class

MappedEnumerable

Enumerable object that maps indices output by Index_iteration to a second type

Constants

Name

Description

INVALID_REF_COUNT

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