Navigation
API > API/Runtime > API/Runtime/CoreUObject > API/Runtime/CoreUObject/StructUtils
References
| Module | CoreUObject |
| Header | /Engine/Source/Runtime/CoreUObject/Public/StructUtils/SharedStruct.h |
| Include | #include "StructUtils/SharedStruct.h" |
Syntax
USTRUCT ()
struct FSharedStruct
Remarks
FSharedStruct works similarly as a TSharedPtr
This struct type is also convertible to a FStructView / FConstStructView and like FInstancedStruct it is the preferable way of passing it as a parameter. If the calling code would like to keep a shared pointer to the struct, you may pass the FSharedStruct as a parameter but it is recommended to pass it as a "const FSharedStruct&" to limit the unnecessary recounting.
A 'const FSharedStruct' can not be made to point at another instance of a struct, whilst a vanila FSharedStruct can. In either case the shared struct memory /data is mutable.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TSharedPtr< FStructSharedMemory > | StructMemoryPtr |
Constructors
| Type | Name | Description | |
|---|---|---|---|
FSharedStruct
(
const FConstStructView& InOther |
|||
FSharedStruct
(
const FSharedStruct& InOther |
Copy constructors | ||
FSharedStruct
(
FSharedStruct&& InOther |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AddStructReferencedObjects
(
FReferenceCollector& Collector |
||
| bool | CompareStructValues
(
const OtherType& Other, |
Determines whether Other contains same values as `this_ | |
| T & | Get () |
Returns reference to the struct, this getter assumes that all data is valid. | |
| uint8 * | GetMemory () |
Returns a mutable pointer to struct memory. | |
| T & | GetMutable () |
Returns mutable reference to the struct, this getter assumes that all data is valid. | |
| uint8 * | Returns a mutable pointer to struct memory. | ||
| T * | Returns mutable pointer to the struct, or nullptr if cast is not valid. | ||
| T * | GetPtr () |
Returns pointer to the struct, or nullptr if cast is not valid. | |
| const UScriptStruct * | Returns struct type. | ||
| TObjectPtr< const UScriptStruct > *const | |||
| bool | Identical
(
const FSharedStruct* Other, |
For StructOpsTypeTraits | |
| void | InitializeAs
(
const UScriptStruct* InScriptStruct, |
Initializes from struct type and optional data. | |
| void | InitializeAs
(
const T& Struct |
Initializes from templated struct instance. | |
| void | InitializeAs () |
Initializes from templated struct type. | |
| void | InitializeAs
(
TArgs&&... InArgs |
Initializes from struct type and emplace args. | |
| void | InitializeAs
(
const T& Struct |
Initializes from other related struct types. | |
| bool | IsValid () |
Returns True if the struct is valid. | |
| FSharedStruct | Make () |
Creates a new FSharedStruct from templated struct type. | |
| FSharedStruct | Make
(
TArgs&&... InArgs |
Creates a new FSharedStruct from the templated type and forward all arguments to constructor. | |
| FSharedStruct | Make
(
const T& Struct |
Creates a new FSharedStruct from templated struct instance. | |
| FSharedStruct | Make
(
const UScriptStruct* InScriptStruct, |
Creates a new FSharedStruct from struct type and optional instance memory. | |
| void | Reset () |
Reset to empty. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| bool | operator!=
(
const OtherType& Other |
||
| FSharedStruct & | operator=
(
const FSharedStruct& InOther |
Assignment operators | |
| FSharedStruct & | operator=
(
const FConstStructView& InOther |
||
| FSharedStruct & | operator=
(
FSharedStruct&& InOther |
||
| bool | operator==
(
const OtherType& Other |
Comparison operators. Note: it does not compare the internal structure itself |