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

#include <TypedElementCounter.h>

Public Types

using FCounterValue = int32
 

Public Member Functions

 FTypedElementCounter ()=default
 
TYPEDELEMENTFRAMEWORK_API FTypedElementCounter (UTypedElementRegistry *InRegistry)
 
 FTypedElementCounter (const FTypedElementCounter &)=delete
 
FTypedElementCounteroperator= (const FTypedElementCounter &)=delete
 
 FTypedElementCounter (FTypedElementCounter &&)=default
 
FTypedElementCounteroperator= (FTypedElementCounter &&)=default
 
TYPEDELEMENTFRAMEWORK_API void Initialize (UTypedElementRegistry *InRegistry)
 
TYPEDELEMENTFRAMEWORK_API void AddElement (const FTypedElementHandle &InElementHandle)
 
TYPEDELEMENTFRAMEWORK_API void RemoveElement (const FTypedElementHandle &InElementHandle)
 
template<typename KeyType >
void IncrementCounter (const FName InCategory, const KeyType &InKey)
 
template<typename KeyType >
void DecrementCounter (const FName InCategory, const KeyType &InKey)
 
template<typename KeyType >
FCounterValue GetCounterValue (const FName InCategory, const KeyType &InKey) const
 
template<typename KeyType >
void ForEachCounterValue (const FName InCategory, TFunctionRef< bool(const KeyType &, FCounterValue)> InCallback) const
 
template<typename KeyType >
void ClearCounter (const FName InCategory, const KeyType &InKey)
 
TYPEDELEMENTFRAMEWORK_API void ClearCounters (const FName InCategory)
 
TYPEDELEMENTFRAMEWORK_API void ClearCounters ()
 

Static Public Member Functions

static TYPEDELEMENTFRAMEWORK_API FName GetElementTypeCategoryName ()
 

Detailed Description

Tracks various categories of counters for the typed elements (eg, the number of elements of a given type). The categories counted may be expanded by element types that implement the UTypedElementCounterInterface API.

Member Typedef Documentation

◆ FCounterValue

Constructor & Destructor Documentation

◆ FTypedElementCounter() [1/4]

FTypedElementCounter::FTypedElementCounter ( )
default

◆ FTypedElementCounter() [2/4]

FTypedElementCounter::FTypedElementCounter ( UTypedElementRegistry InRegistry)
explicit

◆ FTypedElementCounter() [3/4]

FTypedElementCounter::FTypedElementCounter ( const FTypedElementCounter )
delete

◆ FTypedElementCounter() [4/4]

FTypedElementCounter::FTypedElementCounter ( FTypedElementCounter &&  )
default

Member Function Documentation

◆ AddElement()

void FTypedElementCounter::AddElement ( const FTypedElementHandle InElementHandle)

Update the counter categories to include the given element.

◆ ClearCounter()

template<typename KeyType >
void FTypedElementCounter::ClearCounter ( const FName  InCategory,
const KeyType &  InKey 
)
inline

Clear the value of the counter for the given category and key.

◆ ClearCounters() [1/2]

void FTypedElementCounter::ClearCounters ( )

Clear all counters.

◆ ClearCounters() [2/2]

void FTypedElementCounter::ClearCounters ( const FName  InCategory)

Clear the value of the counters for the given category.

◆ DecrementCounter()

template<typename KeyType >
void FTypedElementCounter::DecrementCounter ( const FName  InCategory,
const KeyType &  InKey 
)
inline

Decrement the counter for the given category and key.

Note
For use by UTypedElementCounterInterface.

◆ ForEachCounterValue()

template<typename KeyType >
void FTypedElementCounter::ForEachCounterValue ( const FName  InCategory,
TFunctionRef< bool(const KeyType &, FCounterValue)>  InCallback 
) const
inline

Enumerate the value of the counters for the given category.

◆ GetCounterValue()

template<typename KeyType >
FCounterValue FTypedElementCounter::GetCounterValue ( const FName  InCategory,
const KeyType &  InKey 
) const
inline

Get the value of the counter for the given category and key, or zero if the category or key are unknown.

◆ GetElementTypeCategoryName()

FName FTypedElementCounter::GetElementTypeCategoryName ( )
static

Get the category name used to count element types (by type ID).

◆ IncrementCounter()

template<typename KeyType >
void FTypedElementCounter::IncrementCounter ( const FName  InCategory,
const KeyType &  InKey 
)
inline

Increment the counter for the given category and key.

Note
For use by UTypedElementCounterInterface.

◆ Initialize()

void FTypedElementCounter::Initialize ( UTypedElementRegistry InRegistry)

Explicitly initialize this instance, if it was previously default constructed.

◆ operator=() [1/2]

FTypedElementCounter & FTypedElementCounter::operator= ( const FTypedElementCounter )
delete

◆ operator=() [2/2]

FTypedElementCounter & FTypedElementCounter::operator= ( FTypedElementCounter &&  )
default

◆ RemoveElement()

void FTypedElementCounter::RemoveElement ( const FTypedElementHandle InElementHandle)

Update the counter categories to remove the given element.


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