UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TGCObjectsScopeGuard< ObjectType > Class Template Reference

#include <GCObjectScopeGuard.h>

+ Inheritance diagram for TGCObjectsScopeGuard< ObjectType >:

Public Member Functions

 TGCObjectsScopeGuard (const TArray< ObjectType * > &InObjects)
 
virtual ~TGCObjectsScopeGuard ()
 
 TGCObjectsScopeGuard (const TGCObjectsScopeGuard &)=delete
 
TGCObjectsScopeGuardoperator= (const TGCObjectsScopeGuard &)=delete
 
virtual void AddReferencedObjects (FReferenceCollector &Collector) override
 
virtual FString GetReferencerName () const override
 
UE_FORCEINLINE_HINT const TArray< ObjectType * > & Get () const
 
- Public Member Functions inherited from FGCObject
 FGCObject ()
 
 FGCObject (const FGCObject &Other)
 
 FGCObject (FGCObject &&Other)
 
 FGCObject (EFlags Flags)
 
virtual ~FGCObject ()
 
FGCObjectoperator= (const FGCObject &)
 
FGCObjectoperator= (FGCObject &&)
 
COREUOBJECT_API void RegisterGCObject ()
 
COREUOBJECT_API void UnregisterGCObject ()
 
virtual bool GetReferencerPropertyName (UObject *Object, FString &OutPropertyName) const
 

Additional Inherited Members

- Public Types inherited from FGCObject
enum class  EFlags : uint32 { None = 0 , RegisterLater = 1 << 0 , AddStableNativeReferencesOnly = 1 << 1 }
 
- Static Public Member Functions inherited from FGCObject
static COREUOBJECT_API void StaticInit ()
 
- Static Public Attributes inherited from FGCObject
static COREUOBJECT_API UGCObjectReferencerGGCObjectReferencer = nullptr
 

Detailed Description

template<typename ObjectType>
class TGCObjectsScopeGuard< ObjectType >

Specific implementation of FGCObject that prevents an array of UObject-based pointers from being GC'd while this guard is in scope.

Constructor & Destructor Documentation

◆ TGCObjectsScopeGuard() [1/2]

template<typename ObjectType >
TGCObjectsScopeGuard< ObjectType >::TGCObjectsScopeGuard ( const TArray< ObjectType * > &  InObjects)
inlineexplicit

◆ ~TGCObjectsScopeGuard()

template<typename ObjectType >
virtual TGCObjectsScopeGuard< ObjectType >::~TGCObjectsScopeGuard ( )
inlinevirtual

◆ TGCObjectsScopeGuard() [2/2]

template<typename ObjectType >
TGCObjectsScopeGuard< ObjectType >::TGCObjectsScopeGuard ( const TGCObjectsScopeGuard< ObjectType > &  )
delete

Non-copyable

Member Function Documentation

◆ AddReferencedObjects()

template<typename ObjectType >
virtual void TGCObjectsScopeGuard< ObjectType >::AddReferencedObjects ( FReferenceCollector Collector)
inlineoverridevirtual

Pure virtual that must be overloaded by the inheriting class. Use this method to serialize any UObjects contained that you wish to keep around.

Parameters
CollectorThe collector of referenced objects.

Implements FGCObject.

◆ Get()

template<typename ObjectType >
UE_FORCEINLINE_HINT const TArray< ObjectType * > & TGCObjectsScopeGuard< ObjectType >::Get ( ) const
inline

◆ GetReferencerName()

template<typename ObjectType >
virtual FString TGCObjectsScopeGuard< ObjectType >::GetReferencerName ( ) const
inlineoverridevirtual

Overload this method to report a name for your referencer

Implements FGCObject.

◆ operator=()

template<typename ObjectType >
TGCObjectsScopeGuard & TGCObjectsScopeGuard< ObjectType >::operator= ( const TGCObjectsScopeGuard< ObjectType > &  )
delete

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