Navigation
API > API/Runtime > API/Runtime/Core
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
class UFoo { public: etc etc protected: COUNT_INSTANCES(FTypeIWantToCount) };
| Name | FInstanceCountingObject |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/ProfilingDebugging/InstanceCounter.h |
| Include Path | #include "ProfilingDebugging/InstanceCounter.h" |
Syntax
class FInstanceCountingObject
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FInstanceCountingObject
(
const FInstanceCountingObject& RHS |
Copy-constructor for assigment | ProfilingDebugging/InstanceCounter.h | |
FInstanceCountingObject
(
const TCHAR* InName, |
Constructor, though geneerally these objects should be created using the COUNT_INSTANCES_ macro. | ProfilingDebugging/InstanceCounter.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~FInstanceCountingObject() |
Destructor | ProfilingDebugging/InstanceCounter.h |
Structs
| Name | Remarks |
|---|---|
| FGlobalVars | Vars used by our singleton |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| Globals | FGlobalVars * | Vars are stored as a pointer and initialized on demand due to avoid dependencies on global crot order | ProfilingDebugging/InstanceCounter.h |
Functions
Public
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void DecrementStats() |
Decrements stats for objects of this type | ProfilingDebugging/InstanceCounter.h | |
void IncrementStats() |
Increments stats for objects of this type | ProfilingDebugging/InstanceCounter.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FGlobalVars & GetGlobals() |
ProfilingDebugging/InstanceCounter.h | ||
static int32 GetInstanceCount
(
const TCHAR* Name |
Returns the count of instances with "Name". | ProfilingDebugging/InstanceCounter.h | |
static void LogCounts
(
FOutputDevice& OutputDevice |
Dumps stats for all counted instances to the provided output device. | ProfilingDebugging/InstanceCounter.h |