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

#include <InstanceCounter.h>

Classes

struct  FGlobalVars
 

Public Member Functions

CORE_API FInstanceCountingObject (const TCHAR *InName, bool InLogConstruction=false)
 
CORE_API FInstanceCountingObject (const FInstanceCountingObject &RHS)
 
virtual CORE_API ~FInstanceCountingObject ()
 

Static Public Member Functions

static CORE_API int32 GetInstanceCount (const TCHAR *Name)
 
static CORE_API void LogCounts (FOutputDevice &OutputDevice)
 

Protected Member Functions

CORE_API void IncrementStats ()
 
CORE_API void DecrementStats ()
 

Static Protected Member Functions

static CORE_API FGlobalVarsGetGlobals ()
 

Protected Attributes

FName Name
 
bool DoLog
 

Static Protected Attributes

static CORE_API FGlobalVarsGlobals = nullptr
 

Constructor & Destructor Documentation

◆ FInstanceCountingObject() [1/2]

FInstanceCountingObject::FInstanceCountingObject ( const TCHAR InName,
bool  InLogConstruction = false 
)

Constructor, though geneerally these objects should be created using the COUNT_INSTANCES_ macro.

◆ FInstanceCountingObject() [2/2]

FInstanceCountingObject::FInstanceCountingObject ( const FInstanceCountingObject RHS)

Copy-constructor for assigment

◆ ~FInstanceCountingObject()

FInstanceCountingObject::~FInstanceCountingObject ( )
virtual

Destructor

Member Function Documentation

◆ DecrementStats()

void FInstanceCountingObject::DecrementStats ( )
protected

Decrements stats for objects of this type

◆ GetGlobals()

FInstanceCountingObject::FGlobalVars & FInstanceCountingObject::GetGlobals ( )
staticprotected

◆ GetInstanceCount()

int32 FInstanceCountingObject::GetInstanceCount ( const TCHAR Name)
static

Returns the count of instances with "Name".

Parameters
Name
Returns
: int32

◆ IncrementStats()

void FInstanceCountingObject::IncrementStats ( )
protected

Increments stats for objects of this type

◆ LogCounts()

void FInstanceCountingObject::LogCounts ( FOutputDevice OutputDevice)
static

Dumps stats for all counted instances to the provided output device. This is bound to the "LogCountedInstances" console command

Parameters
OutputDevice
Returns
: void

Member Data Documentation

◆ DoLog

bool FInstanceCountingObject::DoLog
protected

◆ Globals

FInstanceCountingObject::FGlobalVars * FInstanceCountingObject::Globals = nullptr
staticprotected

Vars are stored as a pointer and initialized on demand due to avoid dependencies on global crot order

◆ Name

FName FInstanceCountingObject::Name
protected

Name we are tracking


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