UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TSharedStruct< BaseStructT > Struct Template Reference

#include <SharedStruct.h>

Public Member Functions

 TSharedStruct ()=default
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
 TSharedStruct (const TSharedStruct< T > &InOther)
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
 TSharedStruct (TSharedStruct< T > &&InOther)
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
TSharedStructoperator= (const TSharedStruct< T > &InOther)
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
TSharedStructoperator= (TSharedStruct< T > &&InOther)
 
const UScriptStructGetScriptStruct () const
 
TObjectPtr< const UScriptStruct > * GetScriptStructPtr () const
 
uint8GetMemory () const
 
void Reset ()
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
void Initialize ()
 
template<typename T = BaseStructT>
requires ( std::is_base_of_v<BaseStructT, std::decay_t<T>> && !(std::is_same_v<TStructView<T>, T> || std::is_same_v<TConstStructView<T>, T> || std::is_same_v<TSharedStruct<T>, T> || std::is_same_v<TConstSharedStruct<T>, T> || std::is_same_v<TInstancedStruct<T>, T>))
void Initialize (const T &Struct)
 
template<typename T = BaseStructT, typename... TArgs>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
void Initialize (TArgs &&... InArgs)
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
T & Get () const
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
T * GetPtr () const
 
bool IsValid () const
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
bool operator== (const T &Other) const
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
bool operator!= (const T &Other) const
 

Static Public Member Functions

template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
static TSharedStruct Make ()
 
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
static TSharedStruct Make (const T &Struct)
 
template<typename... TArgs>
static TSharedStruct Make (TArgs &&... InArgs)
 

Friends

template<typename U >
struct TSharedStruct
 

Detailed Description

template<typename BaseStructT>
struct TSharedStruct< BaseStructT >

TSharedStruct is a type-safe FSharedStruct wrapper against the given BaseStruct type.

Note
When used as a property, this automatically defines the BaseStruct property meta-data.

Example:

TSharedStruct<FTestStructBase> Test;

TArray<TSharedStruct<FTestStructBase>> TestArray;

Constructor & Destructor Documentation

◆ TSharedStruct() [1/3]

template<typename BaseStructT >
TSharedStruct< BaseStructT >::TSharedStruct ( )
explicitdefault

◆ TSharedStruct() [2/3]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
TSharedStruct< BaseStructT >::TSharedStruct ( const TSharedStruct< T > &  InOther)
inline

Copy constructors

◆ TSharedStruct() [3/3]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
TSharedStruct< BaseStructT >::TSharedStruct ( TSharedStruct< T > &&  InOther)
inline

Member Function Documentation

◆ Get()

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
T & TSharedStruct< BaseStructT >::Get ( ) const
inline

Returns reference to the struct, this getter assumes that all data is valid.

◆ GetMemory()

template<typename BaseStructT >
uint8 * TSharedStruct< BaseStructT >::GetMemory ( ) const
inline

Returns a mutable pointer to struct memory.

◆ GetPtr()

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
T * TSharedStruct< BaseStructT >::GetPtr ( ) const
inline

Returns pointer to the struct, or nullptr if cast is not valid.

◆ GetScriptStruct()

template<typename BaseStructT >
const UScriptStruct * TSharedStruct< BaseStructT >::GetScriptStruct ( ) const
inline

Returns struct type.

◆ GetScriptStructPtr()

template<typename BaseStructT >
TObjectPtr< const UScriptStruct > * TSharedStruct< BaseStructT >::GetScriptStructPtr ( ) const
inline

◆ Initialize() [1/3]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
void TSharedStruct< BaseStructT >::Initialize ( )
inline

Initializes from a templated struct type. This will create a new instance of the shared struct memory.

◆ Initialize() [2/3]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires ( std::is_base_of_v<BaseStructT, std::decay_t<T>> && !(std::is_same_v<TStructView<T>, T> || std::is_same_v<TConstStructView<T>, T> || std::is_same_v<TSharedStruct<T>, T> || std::is_same_v<TConstSharedStruct<T>, T> || std::is_same_v<TInstancedStruct<T>, T>))
void TSharedStruct< BaseStructT >::Initialize ( const T &  Struct)
inline

Initializes from templated struct instance. This will create a new instance of the shared struct memory.

◆ Initialize() [3/3]

template<typename BaseStructT >
template<typename T = BaseStructT, typename... TArgs>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
void TSharedStruct< BaseStructT >::Initialize ( TArgs &&...  InArgs)
inline

Initializes from struct type and emplace args. This will create a new instance of the shared struct memory.

◆ IsValid()

template<typename BaseStructT >
bool TSharedStruct< BaseStructT >::IsValid ( ) const
inline

Returns True if the struct is valid.

◆ Make() [1/3]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
static TSharedStruct TSharedStruct< BaseStructT >::Make ( )
inlinestatic

Creates a new TSharedStruct. This will create a new instance of the shared struct memory.

◆ Make() [2/3]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
static TSharedStruct TSharedStruct< BaseStructT >::Make ( const T &  Struct)
inlinestatic

Creates a new TSharedStruct from templated struct instance. This will create a new instance of the shared struct memory.

◆ Make() [3/3]

template<typename BaseStructT >
template<typename... TArgs>
static TSharedStruct TSharedStruct< BaseStructT >::Make ( TArgs &&...  InArgs)
inlinestatic

Creates a new TSharedStruct from the templated type and forward all arguments to constructor. This will create a new instance of the shared struct memory.

◆ operator!=()

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
bool TSharedStruct< BaseStructT >::operator!= ( const T &  Other) const
inline

◆ operator=() [1/2]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
TSharedStruct & TSharedStruct< BaseStructT >::operator= ( const TSharedStruct< T > &  InOther)
inline

Assignment operators

◆ operator=() [2/2]

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
TSharedStruct & TSharedStruct< BaseStructT >::operator= ( TSharedStruct< T > &&  InOther)
inline

◆ operator==()

template<typename BaseStructT >
template<typename T = BaseStructT>
requires (std::is_base_of_v<BaseStructT, std::decay_t<T>>)
bool TSharedStruct< BaseStructT >::operator== ( const T &  Other) const
inline

Comparison operators. Note: it does not compare the internal structure itself

◆ Reset()

template<typename BaseStructT >
void TSharedStruct< BaseStructT >::Reset ( )
inline

Reset to empty.

Friends And Related Symbol Documentation

◆ TSharedStruct

template<typename BaseStructT >
template<typename U >
friend struct TSharedStruct
friend

The documentation for this struct was generated from the following file: