Navigation
API > API/Runtime > API/Runtime/CoreUObject
Specific implementation of FGCObject that prevents a single UObject-based pointer from being GC'd while this guard is in scope.
This is the lean version of TStrongObjectPtr which uses an inline FGCObject so can't safely be used with containers that treat types as trivially relocatable.
| Name | TGCObjectScopeGuard |
| Type | class |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/UObject/GCObjectScopeGuard.h |
| Include Path | #include "UObject/GCObjectScopeGuard.h" |
Syntax
template<typename ObjectType>
class TGCObjectScopeGuard : public FGCObject
Inheritance Hierarchy
- FGCObject → TGCObjectScopeGuard
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TGCObjectScopeGuard
(
ObjectType* InObject |
UObject/GCObjectScopeGuard.h | ||
TGCObjectScopeGuard
(
const TGCObjectScopeGuard& |
Non-copyable | UObject/GCObjectScopeGuard.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~TGCObjectScopeGuard() |
UObject/GCObjectScopeGuard.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Object | TObjectPtr< ObjectType > | UObject/GCObjectScopeGuard.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ObjectType * Get() |
UObject/GCObjectScopeGuard.h |
Overridden from FGCObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void AddReferencedObjects
(
FReferenceCollector& Collector |
Pure virtual that must be overloaded by the inheriting class. | UObject/GCObjectScopeGuard.h | |
virtual FString GetReferencerName() |
Overload this method to report a name for your referencer | UObject/GCObjectScopeGuard.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TGCObjectScopeGuard & operator=
(
const TGCObjectScopeGuard& |
UObject/GCObjectScopeGuard.h |