Navigation
API > API/Plugins > API/Plugins/WorldMetricsCore
World metric's collection
A class representing a collection of world metrics. This class allows instantiating and running an arbitrary set of metrics together. The collection observes one instance of per metric class and depends on the World Metric's Subsystem to run the metrics. For this reason, the collection requires initialization. Users are responsible for ensuring both their lifetime and that of the World Metric's Subsystem in their world object.
| Name | FWorldMetricCollection |
| Type | struct |
| Header File | /Engine/Plugins/WorldMetrics/Source/WorldMetricsCore/Public/WorldMetricCollection.h |
| Include Path | #include "WorldMetricCollection.h" |
Syntax
USTRUCT ()
struct FWorldMetricCollection
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FWorldMetricCollection() |
WorldMetricCollection.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FWorldMetricCollection() |
WorldMetricCollection.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsEnabled | bool | Flag indicating whether the contained metrics are enabled and running in the World Metric's Subsystem. | WorldMetricCollection.h |
|
| Metrics | TArray< TObjectPtr< UWorldMetricInterface > > | List of metrics objects. | WorldMetricCollection.h |
|
| Subsystem | TWeakObjectPtr< UWorldMetricsSubsystem > | World Metric's Subsystem provided by the outer object. | WorldMetricCollection.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool Add () |
WorldMetricCollection.h | ||
bool Add
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Adds a metric instance of the parameter class unless a metric of the same class already exists. | WorldMetricCollection.h | |
void AddReferencedObjects
(
FReferenceCollector& Collector |
Collects the references held by this collection. | WorldMetricCollection.h | |
bool Contains
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Checks if the parameter metric class has been added. | WorldMetricCollection.h | |
bool Contains () |
Checks if the type parameter metric class has been added. | WorldMetricCollection.h | |
bool Enable
(
bool bEnable |
Enables or disables the collection. | WorldMetricCollection.h | |
void ForEach
(
FuncType&& Func |
WorldMetricCollection.h | ||
void ForEach
(
FuncType&& Func |
Invokes the parameter function on each of the metrics of the specified type contained by the collection. | WorldMetricCollection.h | |
void ForEach
(
FuncType&& Func |
WorldMetricCollection.h | ||
void ForEach
(
FuncType&& Func |
Invokes the parameter function on each of the metrics contained by the collection. | WorldMetricCollection.h | |
MetricType * Get () |
Gets the metric instance from the type parameter class if it has been previously added. | WorldMetricCollection.h | |
UWorldMetricInterface * Get
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Gets the metric instance from the parameter class if it has been previously added. | WorldMetricCollection.h | |
MetricType * GetOrAdd () |
WorldMetricCollection.h | ||
UWorldMetricInterface * GetOrAdd
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Gets the metric instance of the parameter class or adds a new one if missing. | WorldMetricCollection.h | |
void Initialize
(
UObject* InOuter |
Initializes the collection. | WorldMetricCollection.h | |
bool IsEmpty() |
WorldMetricCollection.h | ||
bool IsEnabled() |
WorldMetricCollection.h | ||
int32 Num() |
WorldMetricCollection.h | ||
bool Remove () |
Removes the metric matching the type parameter class from the collection. | WorldMetricCollection.h | |
bool Remove
(
const TSubclassOf< UWorldMetricInterface >& InMetricClass |
Removes the metric matching the parameter class from the collection. | WorldMetricCollection.h | |
void Reset() |
Removes all contained metrics from the World Metric Subsystem, and removes it from the collection. | WorldMetricCollection.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const UWorldMetricInterface * operator[]
(
int32 Index |
WorldMetricCollection.h | ||
UWorldMetricInterface * operator[]
(
int32 Index |
WorldMetricCollection.h |