Navigation
API > API/Runtime > API/Runtime/GeometryCore > API/Runtime/GeometryCore/Util
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 | GeometryCore |
| Header | /Engine/Source/Runtime/GeometryCore/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
| Type | Name | Description | |
|---|---|---|---|
FRefCountVector
(
const FRefCountVector& |
|||
Functions
| Type | Name | Description | |
|---|---|---|---|
| int | Allocate () |
||
| bool | AllocateAt
(
int Index |
Allocate at specific Index, which must either be larger than current max Index, or on the free list. | |
| bool | AllocateAtUnsafe
(
int Index |
Allocate at specific Index, which must be free or larger than current max Index. | |
| IndexIterator | BeginIndices () |
||
| void | Clear () |
||
| void | Decrement
(
int Index, |
||
| IndexIterator | EndIndices () |
||
| FilteredEnumerable | FilteredIndices
(
TFunction< bool(int)> FilterFunc |
||
| size_t | GetCount () |
||
| size_t | GetMaxIndex () |
||
| int | GetRawRefCount
(
int Index |
||
| const TDynamicVector< unsigned short > & | |||
| TDynamicVector< unsigned short > & | You should not use this! | ||
| int | GetRefCount
(
int Index |
||
| int | Increment
(
int Index, |
||
| IndexEnumerable | Indices () |
Returns iteration object over valid indices usage: for (int idx : indices()) { ... } | |
| bool | IsDense () |
||
| bool | IsEmpty () |
||
| bool | IsValid
(
int Index |
||
| bool | IsValidUnsafe
(
int Index |
||
| MappedEnumerable< ToType > | 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)) { ... } | |
| void | Rebuild
(
unsigned int Num, |
Todo: remove clear Rebuilds all reference counts from external source data via callables. | |
| void | |||
| void | Serialize FRefCountVector to an archive. | ||
| void | SetRefCountUnsafe
(
int Index, |
You should not use this! | |
| void | Trim
(
int maxIndex |
||
| FString | UsageStats () |
Operators
| Type | Name | Description | |
|---|---|---|---|
| FRefCountVector & | operator=
(
const FRefCountVector& |
||
| FRefCountVector & | operator=
(
FRefCountVector&& |
Classes
| Type | Name | Description | |
|---|---|---|---|
| BaseIterator | Iterators base iterator for indices with valid refcount (skips zero-refcount indices) | ||
| FilteredEnumerable | Iteration object that maps indices output by Index_iteration to a second type | ||
| IndexEnumerable | Enumerable object that provides begin()/end() semantics, so you can iterate over valid indices using range-based for loop | ||
| IndexIterator | Iterator over valid indices (ie non-zero refcount) | ||
| MappedEnumerable | Enumerable object that maps indices output by Index_iteration to a second type |
Constants
| Name | Description |
|---|---|
| INVALID_REF_COUNT |