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

#include <ReferenceChainSearch.h>

Classes

struct  FCallbackParams
 
struct  FGraphNode
 
class  FReferenceChain
 
struct  TReferenceInfo
 

Public Types

enum class  EReferenceType { Unknown = 0 , Property = 1 , AddReferencedObjects = 2 , OuterChain = 3 }
 
typedef TReferenceInfo< FGCObjectInfoFObjectReferenceInfo
 
typedef TReferenceInfo< FGraphNodeFNodeReferenceInfo
 

Public Member Functions

COREUOBJECT_API FReferenceChainSearch (UObject *InObjectToFindReferencesTo, EReferenceChainSearchMode Mode=EReferenceChainSearchMode::PrintResults, ELogVerbosity::Type InVerbosityForPrint=ELogVerbosity::Log)
 
COREUOBJECT_API FReferenceChainSearch (TConstArrayView< UObject * > InObjectsToFindReferencesTo, EReferenceChainSearchMode Mode=EReferenceChainSearchMode::PrintResults, ELogVerbosity::Type InVerbosityForPrint=ELogVerbosity::Log)
 
COREUOBJECT_API FReferenceChainSearch (EReferenceChainSearchMode Mode)
 
COREUOBJECT_API ~FReferenceChainSearch ()
 
COREUOBJECT_API int32 PrintResults (bool bDumpAllChains=false, UObject *TargetObject=nullptr, ELogVerbosity::Type VerbosityForPrint=ELogVerbosity::Log) const
 
COREUOBJECT_API void SetVerbosityForPrint (ELogVerbosity::Type Verbosity)
 
COREUOBJECT_API int32 PrintResults (TFunctionRef< bool(FCallbackParams &Params)> ReferenceCallback, bool bDumpAllChains=false, UObject *TargetObject=nullptr, ELogVerbosity::Type VerbosityForPrint=ELogVerbosity::Log) const
 
COREUOBJECT_API FString GetRootPath (UObject *TargetObject=nullptr) const
 
COREUOBJECT_API FString GetRootPath (TFunctionRef< bool(FCallbackParams &Params)> ReferenceCallback, UObject *TargetObject=nullptr) const
 
const TArray< FReferenceChain * > & GetReferenceChains () const
 
int64 GetAllocatedSize () const
 

Static Public Member Functions

static COREUOBJECT_API FString FindAndPrintStaleReferencesToObject (UObject *ObjectToFindReferencesTo, EPrintStaleReferencesOptions Options)
 
static COREUOBJECT_API TArray< FString > FindAndPrintStaleReferencesToObjects (TConstArrayView< UObject * > ObjectsToFindReferencesTo, EPrintStaleReferencesOptions Options)
 
static FString GetObjectFlags (const FGCObjectInfo &InObject)
 

Member Typedef Documentation

◆ FNodeReferenceInfo

◆ FObjectReferenceInfo

Convenience type definitions to avoid template hell

Member Enumeration Documentation

◆ EReferenceType

Type of reference

Enumerator
Unknown 
Property 
AddReferencedObjects 
OuterChain 

Constructor & Destructor Documentation

◆ FReferenceChainSearch() [1/3]

FReferenceChainSearch::FReferenceChainSearch ( UObject InObjectToFindReferencesTo,
EReferenceChainSearchMode  Mode = EReferenceChainSearchMode::PrintResults,
ELogVerbosity::Type  InVerbosityForPrint = ELogVerbosity::Log 
)
explicit

Constructs a new search engine and finds references to the specified object

◆ FReferenceChainSearch() [2/3]

FReferenceChainSearch::FReferenceChainSearch ( TConstArrayView< UObject * >  InObjectsToFindReferencesTo,
EReferenceChainSearchMode  Mode = EReferenceChainSearchMode::PrintResults,
ELogVerbosity::Type  InVerbosityForPrint = ELogVerbosity::Log 
)
explicit

◆ FReferenceChainSearch() [3/3]

FReferenceChainSearch::FReferenceChainSearch ( EReferenceChainSearchMode  Mode)
explicit

Constructs a new search engine but does not find references to any objects until one of the PerformSearch*() functions is called

◆ ~FReferenceChainSearch()

FReferenceChainSearch::~FReferenceChainSearch ( )

Destructor

Member Function Documentation

◆ FindAndPrintStaleReferencesToObject()

FString FReferenceChainSearch::FindAndPrintStaleReferencesToObject ( UObject ObjectToFindReferencesTo,
EPrintStaleReferencesOptions  Options 
)
static

Attempts to find a reference chain leading to a world that should have been garbage collected

Parameters
ObjectToFindReferencesToWorld or its package (or any object from the world package that should've been destroyed)
OptionsDetermines how the stale references messages should be logged

◆ FindAndPrintStaleReferencesToObjects()

TArray< FString > FReferenceChainSearch::FindAndPrintStaleReferencesToObjects ( TConstArrayView< UObject * >  ObjectsToFindReferencesTo,
EPrintStaleReferencesOptions  Options 
)
static

◆ GetAllocatedSize()

int64 FReferenceChainSearch::GetAllocatedSize ( ) const

◆ GetObjectFlags()

FString FReferenceChainSearch::GetObjectFlags ( const FGCObjectInfo InObject)
static

Returns a string with all flags (we care about) set on an object

◆ GetReferenceChains()

const TArray< FReferenceChain * > & FReferenceChainSearch::GetReferenceChains ( ) const
inline

Returns all reference chains

◆ GetRootPath() [1/2]

FString FReferenceChainSearch::GetRootPath ( TFunctionRef< bool(FCallbackParams &Params)>  ReferenceCallback,
UObject TargetObject = nullptr 
) const

Returns a string with a short report explaining the root path, will contain newlines

Parameters
ReferenceCallback- function called when processing each reference, if true is returned the next reference will be processed otherwise printing will be aborted

◆ GetRootPath() [2/2]

FString FReferenceChainSearch::GetRootPath ( UObject TargetObject = nullptr) const

Returns a string with a short report explaining the root path, will contain newlines

◆ PrintResults() [1/2]

int32 FReferenceChainSearch::PrintResults ( bool  bDumpAllChains = false,
UObject TargetObject = nullptr,
ELogVerbosity::Type  VerbosityForPrint = ELogVerbosity::Log 
) const

Dumps results to log

Parameters
bDumpAllChains- if set to false, the output will be trimmed to the first 100 reference chains
Returns
The number of results printed.

◆ PrintResults() [2/2]

int32 FReferenceChainSearch::PrintResults ( TFunctionRef< bool(FCallbackParams &Params)>  ReferenceCallback,
bool  bDumpAllChains = false,
UObject TargetObject = nullptr,
ELogVerbosity::Type  VerbosityForPrint = ELogVerbosity::Log 
) const

Dumps results to log

Parameters
ReferenceCallback- function called when processing each reference, if true is returned the next reference will be processed otherwise printing will be aborted
bDumpAllChains- if set to false, the output will be trimmed to the first 100 reference chains
Returns
The number of results printed.

◆ SetVerbosityForPrint()

void FReferenceChainSearch::SetVerbosityForPrint ( ELogVerbosity::Type  Verbosity)

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