FInstanceCountingObject

Copyright Epic Games, Inc. All Rights Reserved.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/ProfilingDebugging/InstanceCounter.h

Include

#include "ProfilingDebugging/InstanceCounter.h"

Syntax

class FInstanceCountingObject

Remarks

A helper object for counting instances of struct or classes for debugging purposes, e.g. to get an absolute count of the number of "Foo"'s in existence

Suggested use

Variables

Name Description

Protected variable

bool

 

DoLog

Log increment/decrement?

Protected variable

FName

 

Name

Name we are tracking

Constructors

Name Description

Public function

FInstanceCountingObject

(
    const FInstanceCountingObject& RHS
)

Copy-constructor for assigment

Public function

FInstanceCountingObject

(
    const TCHAR* InName,
    bool InLogConstruction
)

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

Destructors

Name Description

Public function Virtual

~FInstanceCountingObject()

Destructor

Functions

Name Description

Protected function

void

 

DecrementStats()

Decrements stats for objects of this type

Protected function Static

FGlobalVars ...

 

GetGlobals()

Public function Static

int32

 

GetInstanceCount

(
    const TCHAR* Name
)

Returns the count of instances with "Name".

Protected function

void

 

IncrementStats()

Increments stats for objects of this type

Public function Static

void

 

LogCounts

(
    FOutputDevice& OutputDevice
)

Dumps stats for all counted instances to the provided output device.

Classes

Name

Description

Protected struct

FGlobalVars

Vars used by our singleton

Constants

Name

Description

Globals

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