Navigation
Unreal Engine C++ API Reference > Runtime > Core > UObject
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/UObject/StrongObjectPtrTemplates.h |
Include | #include "UObject/StrongObjectPtrTemplates.h" |
Syntax
template<typename ObjectType, typename ReferencerNameProvider>
class TStrongObjectPtr
Remarks
Take a ref-count on a UObject to prevent it from being GC'd while this guard is in scope.
TStrongObjectPtr is a strong pointer to a UObject. It can return nullptr if it has not been initialized or has been constructed from a weak ptr that is already garbage collected. It prevents an object from being garbage collected. It can't be directly used across a network.
Most often it is used when you explicitly want to prevent something from being garbage collected.
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
TStrongObjectPtr
(
TStrongObjectPtr&& InOther |
||
![]() |
|||
![]() |
TStrongObjectPtr
(
ObjectType* InObject |
||
![]() |
TStrongObjectPtr
(
const TStrongObjectPtr& InOther |
||
![]() |
TStrongObjectPtr
(
const TStrongObjectPtr< OtherObjectType, OtherReferencerNameProvider >& InOther |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() |
Functions
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
ObjectType * | Get () |
|
![]() ![]() |
bool | IsValid () |
|
![]() |
void | Reset () |
|
![]() |
void | Reset
(
ObjectType* InNewObject |
Operators
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
|||
![]() ![]() |
ObjectType & | operator* () |
|
![]() |
TStrongObjectPtr & | operator=
(
TStrongObjectPtr&& InOther |
|
![]() |
TStrongObjectPtr & | operator=
(
const TStrongObjectPtr& InOther |
|
![]() |
TStrongObjectPtr & | operator=
(
const TStrongObjectPtr< OtherObjectType, OtherReferencerNameProvider >& InOther |
|
![]() ![]() |
ObjectType * | operator-> () |
Typedefs
Name | Description |
---|---|
ElementType |