Navigation
API > API/Runtime > API/Runtime/GeometryCore
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.
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.
| Name | FRefCountVector |
| Type | class |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/Util/RefCountVector.h |
| Include Path | #include "Util/RefCountVector.h" |
Syntax
class FRefCountVector
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Util/RefCountVector.h | |||
| Util/RefCountVector.h | |||
FRefCountVector
(
const FRefCountVector& |
Util/RefCountVector.h |
Classes
| Name | Remarks |
|---|---|
| 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 |
| MappedEnumerable | Enumerable object that maps indices output by Index_iteration to a second type |
Interfaces
| Name | Remarks |
|---|---|
| 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) |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| INVALID_REF_COUNT | unsigned short | Util/RefCountVector.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| FreeIndices | TDynamicVector< int > | Util/RefCountVector.h | ||
| RefCounts | TDynamicVector< unsigned short > | Util/RefCountVector.h | ||
| UsedCount | int | Util/RefCountVector.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
int Allocate() |
Util/RefCountVector.h | ||
bool AllocateAt
(
int Index |
Allocate at specific Index, which must either be larger than current max Index, or on the free list. | Util/RefCountVector.h | |
bool AllocateAtUnsafe
(
int Index |
Allocate at specific Index, which must be free or larger than current max Index. | Util/RefCountVector.h | |
void Append
(
const FRefCountVector& Other |
Append all ref counts from another RefCountVector, offsetting FreeIndices to refer to their corresponded new array positions Note this does not try to 'fill in' original free indices, by design all existing IDs remain untouched, and all new IDs are simply offsets of the Other's IDs | Util/RefCountVector.h | |
IndexIterator BeginIndices() |
Util/RefCountVector.h | ||
void Clear() |
Util/RefCountVector.h | ||
void Decrement
(
int Index, |
Util/RefCountVector.h | ||
IndexIterator EndIndices() |
Util/RefCountVector.h | ||
FilteredEnumerable FilteredIndices
(
TFunction< bool(int)> FilterFunc |
Util/RefCountVector.h | ||
SIZE_T GetByteCount() |
Util/RefCountVector.h | ||
size_t GetCount() |
Util/RefCountVector.h | ||
size_t GetMaxIndex() |
Util/RefCountVector.h | ||
int GetRawRefCount
(
int Index |
Util/RefCountVector.h | ||
const TDynamicVector< unsigned short > & GetRawRefCounts() |
Util/RefCountVector.h | ||
TDynamicVector< unsigned short > & GetRawRefCountsUnsafe () |
You should not use this! | Util/RefCountVector.h | |
int GetRefCount
(
int Index |
Util/RefCountVector.h | ||
int Increment
(
int Index, |
Util/RefCountVector.h | ||
IndexEnumerable Indices() |
Returns iteration object over valid indices usage: for (int idx : indices()) { ... } | Util/RefCountVector.h | |
bool IsDense() |
Util/RefCountVector.h | ||
bool IsEmpty() |
Util/RefCountVector.h | ||
bool IsValid
(
int Index |
Util/RefCountVector.h | ||
bool IsValidUnsafe
(
int Index |
Util/RefCountVector.h | ||
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)) { ... } | Util/RefCountVector.h | |
void Rebuild
(
unsigned int Num, |
Todo: remove clear Rebuilds all reference counts from external source data via callables. | Util/RefCountVector.h | |
void RebuildFreeList() |
Util/RefCountVector.h | ||
void Serialize
(
FArchive& Ar, |
Serialize FRefCountVector to an archive. | Util/RefCountVector.h | |
void SetRefCountUnsafe
(
int Index, |
You should not use this! | Util/RefCountVector.h | |
void Trim
(
int maxIndex |
Util/RefCountVector.h | ||
FString UsageStats() |
Util/RefCountVector.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FRefCountVector & operator=
(
const FRefCountVector& |
Util/RefCountVector.h | ||
FRefCountVector & operator=
(
FRefCountVector&& |
Util/RefCountVector.h |