UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FInstanceAttributeTracker Class Reference

#include <InstanceAttributeTracker.h>

Classes

class  FAnyValidIterator
 
class  FDeltaRange
 
struct  FToBit
 

Public Types

enum class  EFlag : ElementType {
  Added , TransformChanged , CustomDataChanged , IndexChanged ,
  Num
}
 
using ElementType = uint32
 
using FBitManip = UE::InstanceAttributeTracker::Implementation::FBitManip< ElementType >
 

Public Member Functions

 FInstanceAttributeTracker ()
 
 FInstanceAttributeTracker (FInstanceAttributeTracker &&Other)
 
void operator= (FInstanceAttributeTracker &&Other)
 
void Reset ()
 
TConstSetBitIterator GetRemovedIterator () const
 
void MarkRemoved (FPrimitiveInstanceId Id)
 
void RemoveAtSwap (FPrimitiveInstanceId Id, int32 Index, int32 MaxInstanceIndex)
 
void RemoveAt (FPrimitiveInstanceId Id, int32 Index, int32 MaxInstanceIndex)
 
template<EFlag Flag>
void MarkIndex (int32 Index, int32 MaxInstanceIndex)
 
ElementType GetFlags (int32 Index) const
 
template<EFlag Flag>
bool TestFlag (int32 Index) const
 
void SetNum (int32 InstanceIndexMax)
 
template<uint32 Mask = AnyFlagMask>
FAnyValidIterator< MaskGetChangedIterator () const
 
void Validate () const
 
template<EFlag Flag>
FDeltaRange< Flag > GetDeltaRange (bool bForceFullUpdate, int32 InNumItems) const
 
bool HasAnyChanges () const
 
SIZE_T GetAllocatedSize () const
 

Static Public Member Functions

static void Move (FInstanceAttributeTracker &Dest, FInstanceAttributeTracker &Source)
 

Static Public Attributes

static constexpr uint32 BitsPerElement = sizeof(ElementType) * 8u
 
static constexpr int32 MasksPerElement = BitsPerElement / uint32(EFlag::Num)
 
static constexpr ElementType AnyFlagMask = (ElementType(1U) << uint32(EFlag::Num)) - ElementType(1U)
 

Detailed Description

Tracks changes for instances, but that assumes storing stuff per index except the removed status which must be kept ID-based Removed items are tracked by ID and kept separate as we need to remember if an item was ever removed in order to handle these correctly. Designed to use move semantics to clear the state and transfer to the updating worker task.

Member Typedef Documentation

◆ ElementType

◆ FBitManip

Member Enumeration Documentation

◆ EFlag

Flag describing the changed attribute. Note that not all are created equal, see comments.

Enumerator
Added 
TransformChanged 

Set when

CustomDataChanged 
IndexChanged 
Num 

Implicitly set when calling Remove or RemoveAt as this causes movement to fill holes.

Constructor & Destructor Documentation

◆ FInstanceAttributeTracker() [1/2]

FInstanceAttributeTracker::FInstanceAttributeTracker ( )

◆ FInstanceAttributeTracker() [2/2]

FInstanceAttributeTracker::FInstanceAttributeTracker ( FInstanceAttributeTracker &&  Other)

Member Function Documentation

◆ GetAllocatedSize()

SIZE_T FInstanceAttributeTracker::GetAllocatedSize ( ) const
inline

◆ GetChangedIterator()

template<uint32 Mask = AnyFlagMask>
FAnyValidIterator< Mask > FInstanceAttributeTracker::GetChangedIterator ( ) const
inline

◆ GetDeltaRange()

template<EFlag Flag>
FDeltaRange< Flag > FInstanceAttributeTracker::GetDeltaRange ( bool  bForceFullUpdate,
int32  InNumItems 
) const
inline

◆ GetFlags()

ElementType FInstanceAttributeTracker::GetFlags ( int32  Index) const
inline

Get the masked flags for a given index.

◆ GetRemovedIterator()

TConstSetBitIterator FInstanceAttributeTracker::GetRemovedIterator ( ) const

Get an iterator that iterates over the IDs (note, not index as they don't exist any more) of removed instances. The remove flag is not cleared when a new instances is added.

◆ HasAnyChanges()

bool FInstanceAttributeTracker::HasAnyChanges ( ) const
inline

◆ MarkIndex()

template<EFlag Flag>
void FInstanceAttributeTracker::MarkIndex ( int32  Index,
int32  MaxInstanceIndex 
)
inline

◆ MarkRemoved()

void FInstanceAttributeTracker::MarkRemoved ( FPrimitiveInstanceId  Id)
inline

Lazy allocate bits in the bit vector tracking removed instances and set the flag for the instance ID. Also updates the FirstRemovedIdIndex, such that we can start iteration from that bit.

◆ Move()

void FInstanceAttributeTracker::Move ( FInstanceAttributeTracker Dest,
FInstanceAttributeTracker Source 
)
static

◆ operator=()

void FInstanceAttributeTracker::operator= ( FInstanceAttributeTracker &&  Other)

◆ RemoveAt()

void FInstanceAttributeTracker::RemoveAt ( FPrimitiveInstanceId  Id,
int32  Index,
int32  MaxInstanceIndex 
)
inline

Mark removed & update the tracked bits (remove & move operation) Note: this is not something that should be used really as it forces the tracker to touch all the masks after the removed item...

◆ RemoveAtSwap()

void FInstanceAttributeTracker::RemoveAtSwap ( FPrimitiveInstanceId  Id,
int32  Index,
int32  MaxInstanceIndex 
)
inline

Mark removed & update the tracked bits (remove & swap operation)

◆ Reset()

void FInstanceAttributeTracker::Reset ( )

◆ SetNum()

void FInstanceAttributeTracker::SetNum ( int32  InstanceIndexMax)
inline

◆ TestFlag()

template<EFlag Flag>
bool FInstanceAttributeTracker::TestFlag ( int32  Index) const
inline

Test a specific flag at a given index.

◆ Validate()

void FInstanceAttributeTracker::Validate ( ) const
inline

Member Data Documentation

◆ AnyFlagMask

constexpr ElementType FInstanceAttributeTracker::AnyFlagMask = (ElementType(1U) << uint32(EFlag::Num)) - ElementType(1U)
staticconstexpr

◆ BitsPerElement

constexpr uint32 FInstanceAttributeTracker::BitsPerElement = sizeof(ElementType) * 8u
staticconstexpr

◆ MasksPerElement

constexpr int32 FInstanceAttributeTracker::MasksPerElement = BitsPerElement / uint32(EFlag::Num)
staticconstexpr

The documentation for this class was generated from the following files: