Navigation
API > API/Runtime > API/Runtime/CoreUObject
TSharedStruct is a type-safe FSharedStruct wrapper against the given BaseStruct type.
When used as a property, this automatically defines the BaseStruct property meta-data. Example:
TSharedStruct
TArray
| Name | TSharedStruct |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/StructUtils/SharedStruct.h |
| Include Path | #include "StructUtils/SharedStruct.h" |
Syntax
template<typename BaseStructT>
struct TSharedStruct
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TSharedStruct
(
const TSharedStruct< T >& InOther |
Copy constructors | StructUtils/SharedStruct.h | |
| StructUtils/SharedStruct.h | |||
TSharedStruct
(
TSharedStruct< T >&& InOther |
StructUtils/SharedStruct.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| SharedStruct | FSharedStruct | Note: TSharedStruct is a wrapper for a FSharedStruct (rather than inheriting) so that it can provide a locked-down type-safe API for use in C++, without being able to accidentally take a reference to the untyped API to work around the restrictions. | StructUtils/SharedStruct.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T & Get() |
Returns reference to the struct, this getter assumes that all data is valid. | StructUtils/SharedStruct.h | |
uint8 * GetMemory() |
Returns a mutable pointer to struct memory. | StructUtils/SharedStruct.h | |
T * GetPtr() |
Returns pointer to the struct, or nullptr if cast is not valid. | StructUtils/SharedStruct.h | |
const UScriptStruct * GetScriptStruct() |
Returns struct type. | StructUtils/SharedStruct.h | |
TObjectPtr< const UScriptStruct > * GetScriptStructPtr() |
StructUtils/SharedStruct.h | ||
void Initialize
(
TArgs&&... InArgs |
Initializes from struct type and emplace args. | StructUtils/SharedStruct.h | |
void Initialize
(
const T& Struct |
Initializes from templated struct instance. | StructUtils/SharedStruct.h | |
void Initialize () |
Initializes from a templated struct type. | StructUtils/SharedStruct.h | |
bool IsValid() |
Returns True if the struct is valid. | StructUtils/SharedStruct.h | |
void Reset() |
Reset to empty. | StructUtils/SharedStruct.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedStruct Make () |
Creates a new TSharedStruct. | StructUtils/SharedStruct.h | |
static TSharedStruct Make
(
const T& Struct |
Creates a new TSharedStruct from templated struct instance. | StructUtils/SharedStruct.h | |
static TSharedStruct Make
(
TArgs&&... InArgs |
Creates a new TSharedStruct from the templated type and forward all arguments to constructor. | StructUtils/SharedStruct.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const T& Other |
StructUtils/SharedStruct.h | ||
TSharedStruct & operator=
(
const TSharedStruct< T >& InOther |
Assignment operators | StructUtils/SharedStruct.h | |
TSharedStruct & operator=
(
TSharedStruct< T >&& InOther |
StructUtils/SharedStruct.h | ||
bool operator==
(
const T& Other |
Comparison operators. Note: it does not compare the internal structure itself | StructUtils/SharedStruct.h |