FReferenceCollector

Used by garbage collector to collect references via virtual AddReferencedObjects calls

Inheritance Hierarchy

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/UObjectGlobals.h

Include

#include "UObject/UObjectGlobals.h"

Syntax

class FReferenceCollector

Remarks

Used by garbage collector to collect references via virtual AddReferencedObjects calls

Destructors

Name Description

Public function Virtual

~FReferenceCollector()

Functions

Name Description

Public function

void

 

AddPropertyReferences

(
    const UStruct* Struct,
    void* Instance,
    const UObject* ReferencingObje...
)

Adds all strong property references from a struct instance, but not the struct itself.

Public function

void

 

AddPropertyReferencesLimitedToObjectProperties

(
    const UStruct* Struct,
    void* Instance,
    const UObject* ReferencingObje...
)

Internal use only.

Public function

void

 

AddPropertyReferencesWithStructARO

(
    const UClass* Class,
    void* Instance,
    const UObject* ReferencingObje...
)

Same as AddPropertyReferences but also calls AddStructReferencedObjects on all nested structs

Public function

void

 

AddPropertyReferencesWithStructARO

(
    const UScriptStruct* Struct,
    void* Instance,
    const UObject* ReferencingObje...
)

Same as AddPropertyReferences but also calls AddStructReferencedObjects on Struct and all nested structs

Public function

void

 

AddReferencedObject

(
    TObjectPtr< const UObjectType >& O...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds const object reference, this reference can still be nulled out if forcefully collected.

Public function

void

 

AddReferencedObject

(
    TObjectPtr< UObjectType >& Object,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds object reference.

Public function

void

 

AddReferencedObject

(
    const UObjectType*& Object,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds const object reference, this reference can still be nulled out if forcefully collected.

Public function

void

 

AddReferencedObject

(
    UObjectType*& Object,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds object reference.

Public function

void

 

AddReferencedObject

(
    TWeakObjectPtr< T >& P,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObject

(
    FWeakObjectPtr& P,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObjects

(
    TSet< TObjectPtr< UObjectType >>& ...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to a set of objects.

Public function

void

 

AddReferencedObjects

(
    TMapBase< KeyType*, ValueType ...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObjects

(
    TMapBase< KeyType, ValueType*,...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObjects

(
    TMapBase< KeyType*, ValueType,...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to a map of objects.

Public function

void

 

AddReferencedObjects

(
    TArray< const UObjectType* >&...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to an array of const objects, these objects can still be nulled out if forcefully collected.

Public function

void

 

AddReferencedObjects

(
    TMapBase< TObjectPtr< KeyType >, Va...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to a map of objects.

Public function

void

 

AddReferencedObjects

(
    TMapBase< KeyType, TObjectPtr< Valu...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObjects

(
    TMapBase< TObjectPtr< KeyType >, TO...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObjects

(
    const UScriptStruct*& ScriptSt...,
    void* Instance,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds all strong property references from a UScriptStruct instance including the struct itself

Public function

void

 

AddReferencedObjects

(
    TObjectPtr< const UScriptStruct >&...,
    void* Instance,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Public function

void

 

AddReferencedObjects

(
    TWeakObjectPtr< const UScriptStruct...,
    void* Instance,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to an array of objects.

Public function

void

 

AddReferencedObjects

(
    TArray< TObjectPtr< const UObjectTy...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to an array of const objects, these objects can still be nulled out if forcefully collected.

Public function

void

 

AddReferencedObjects

(
    TArray< TObjectPtr< UObjectType >> ...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to an array of objects.

Public function

void

 

AddReferencedObjects

(
    TSet< UObjectType* >& ObjectS...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to a set of objects.

Public function

void

 

AddReferencedObjects

(
    TArray< UObjectType* >& Objec...,
    const UObject* ReferencingObje...,
    const FProperty* ReferencingPr...
)

Adds references to an array of objects.

Public function

void

 

AddStableReference

(
    TObjectPtr< UObjectType >* Obj...
)

Public function Virtual

void

 

AddStableReference

(
    UObject** Object
)

Preferred way to add a reference that allows batching.

Public function Virtual

void

 

AddStableReference

(
    TObjectPtr< UObject >* Object
)

Preferred way to add a reference that allows batching.

Public function

void

 

AddStableReference

(
    UObjectType** Object
)

Public function Virtual

void

 

AddStableReferenceArray

(
    TArray< UObject* >* Objec...
)

Preferred way to add a reference array that allows batching.

Public function Virtual

void

 

AddStableReferenceArray

(
    TArray< TObjectPtr< UObject >>*...
)

Preferred way to add a reference array that allows batching.

Public function

void

 

AddStableReferenceArray

(
    TArray< TObjectPtr< UObjectType >> ...
)

Public function

void

 

AddStableReferenceArray

(
    TArray< UObjectType* >* O...
)

Public function

void

 

AddStableReferenceMap

(
    TMapBase< KeyType, ValueType, Alloc...
)

Public function Virtual

void

 

AddStableReferenceSet

(
    TSet< TObjectPtr< UObject >>* ...
)

Preferred way to add a reference set that allows batching. Can't be used for temporary/stack set.

Public function Virtual

void

 

AddStableReferenceSet

(
    TSet< UObject* >* Objects
)

Preferred way to add a reference set that allows batching. Can't be used for temporary/stack set.

Public function

void

 

AddStableReferenceSet

(
    TSet< UObjectType* >* Obj...
)

Public function

void

 

AddStableReferenceSet

(
    TSet< TObjectPtr< UObjectType >>&#...
)

Public function Virtual

void

 

AllowEliminatingReferences

(
    bool bAllow
)

Allows reference elimination by this collector.

Public function Virtual Const

FProperty &#...

 

GetSerializedProperty()

Gets the property that is currently being serialized

Public function

FReferenceCo...

 

GetVerySlowReferenceCollectorArchive()

Get archive to collect references via SerializeBin / Serialize.

Protected function

void

 

HandleObjectReference

(
    UObject*& InObject,
    const UObject* InReferencingOb...,
    const FProperty* InReferencing...
)

Handle object reference. Called by AddReferencedObject.

Protected function Virtual

void

 

HandleObjectReferences

(
    FObjectPtr* InObjects,
    const int32 ObjectNum,
    const UObject* InReferencingOb...,
    const FProperty* InReferencing...
)

Handle multiple object references.

Protected function Virtual

void

 

HandleObjectReferences

(
    UObject** InObjects,
    const int32 ObjectNum,
    const UObject* InReferencingOb...,
    const FProperty* InReferencing...
)

Handle multiple object references.

Public function Const

bool

 

IsIgnoringArchetypeRef()

If true archetype references should not be added to this collector.

Public function Const

bool

 

IsIgnoringTransient()

If true transient objects should not be added to this collector.

Public function Virtual Const

bool

 

IsProcessingNativeReferences()

If true, this collector is currently processing native references (true by default).

Public function Virtual

bool

 

MarkWeakObjectReferenceForClearing

(
    UObject** WeakReference
)

Marks a specific object reference as a weak reference.

Public function Virtual Const

bool

 

NeedsInitialReferences()

Used by parallel reachability analysis to pre-collect and then exclude some initial FGCObject references

Public function Virtual Const

bool

 

NeedsPropertyReferencer()

Make Add[OnlyObject]PropertyReference/AddReferencedObjects(UScriptStruct) use AddReferencedObjects(UObject*&) callbacks with ReferencingObject and ReferencingProperty context supplied and check for null references before making a callback.

Public function Virtual

void

 

SetIsProcessingNativeReferences

(
    bool bIsNative
)

Sets whether this collector is currently processing native references or not.

Public function Virtual

void

 

SetSerializedProperty

(
    FProperty* Inproperty
)

Sets the property that is currently being serialized

Classes

Name

Description

Public struct

AROPrivate

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel