Navigation
API > API/Runtime > API/Runtime/CoreUObject
TInstancedStruct is a type-safe FInstancedStruct wrapper against the given BaseStruct type.
When used as a property, this automatically defines the BaseStruct property meta-data. Example:
TInstancedStruct
TArray
| Name | TInstancedStruct |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/StructUtils/InstancedStruct.h |
| Include Path | #include "StructUtils/InstancedStruct.h" |
Syntax
template<typename BaseStructT>
struct TInstancedStruct
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TInstancedStruct
(
const TInstancedStruct< T >& InOther |
StructUtils/InstancedStruct.h | ||
| StructUtils/InstancedStruct.h | |||
TInstancedStruct
(
const TConstStructView< T > InOther |
This constructor is explicit to avoid accidentally converting struct views to instanced structs (which would result in costly copy of the struct to be made). | StructUtils/InstancedStruct.h | |
TInstancedStruct
(
const UScriptStruct* InScriptStruct |
StructUtils/InstancedStruct.h | ||
TInstancedStruct
(
TInstancedStruct< T >&& InOther |
StructUtils/InstancedStruct.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| InstancedStruct | FInstancedStruct | Note: TInstancedStruct is a wrapper for a FInstancedStruct (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 workaround the restrictions. | StructUtils/InstancedStruct.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddReferencedObjects
(
FReferenceCollector& Collector |
StructUtils/InstancedStruct.h | ||
const T & Get() |
Returns const reference to the struct, this getter assumes that all data is valid. | StructUtils/InstancedStruct.h | |
const uint8 * GetMemory() |
Returns const pointer to raw struct memory. | StructUtils/InstancedStruct.h | |
T & GetMutable() |
Returns mutable reference to the struct, this getter assumes that all data is valid. | StructUtils/InstancedStruct.h | |
uint8 * GetMutableMemory() |
Returns a mutable pointer to raw struct memory. | StructUtils/InstancedStruct.h | |
T * GetMutablePtr() |
Returns mutable pointer to the struct, or nullptr if cast is not valid. | StructUtils/InstancedStruct.h | |
const T * GetPtr() |
Returns const pointer to the struct, or nullptr if cast is not valid. | StructUtils/InstancedStruct.h | |
const UScriptStruct * GetScriptStruct() |
Returns struct type. | StructUtils/InstancedStruct.h | |
void InitializeAs
(
TArgs&&... InArgs |
Initializes from struct type and emplace construct. | StructUtils/InstancedStruct.h | |
void InitializeAsScriptStruct
(
const UScriptStruct* InScriptStruct, |
Initializes from a raw struct type and optional data. | StructUtils/InstancedStruct.h | |
bool IsValid() |
Returns True if the struct is valid. | StructUtils/InstancedStruct.h | |
bool NetSerialize
(
FArchive& Ar, |
StructUtils/InstancedStruct.h | ||
void Reset() |
Reset to empty. | StructUtils/InstancedStruct.h | |
bool Serialize
(
FArchive& Ar |
StructUtils/InstancedStruct.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TInstancedStruct Make () |
Creates a new TInstancedStruct from templated struct type. | StructUtils/InstancedStruct.h | |
static TInstancedStruct Make
(
const T& Struct |
Creates a new TInstancedStruct from templated struct. | StructUtils/InstancedStruct.h | |
static TInstancedStruct Make
(
TArgs&&... InArgs |
Creates a new TInstancedStruct from the templated type and forward all arguments to constructor. | StructUtils/InstancedStruct.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const TInstancedStruct< T >& Other |
StructUtils/InstancedStruct.h | ||
TInstancedStruct & operator=
(
TInstancedStruct< T >&& InOther |
StructUtils/InstancedStruct.h | ||
TInstancedStruct & operator=
(
const TInstancedStruct< T >& InOther |
StructUtils/InstancedStruct.h | ||
TInstancedStruct & operator=
(
const TConstStructView< T > InOther |
StructUtils/InstancedStruct.h | ||
bool operator==
(
const TInstancedStruct< T >& Other |
Comparison operators. Deep compares the struct instance when identical. | StructUtils/InstancedStruct.h |