UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TStructOnScope< T > Class Template Referencefinal

#include <StructOnScope.h>

+ Inheritance diagram for TStructOnScope< T >:

Public Member Functions

 TStructOnScope ()=default
 
virtual ~TStructOnScope ()=default
 
 TStructOnScope (TStructOnScope &&InOther)=default
 
TStructOnScopeoperator= (TStructOnScope &&InOther)=default
 
template<typename U , typename = typename TEnableIf<TIsDerivedFrom<typename TRemoveReference<U>::Type, T>::IsDerived, void>::Type>
 TStructOnScope (U &&InStruct)
 
template<typename U , typename = typename TEnableIf<TIsDerivedFrom<typename TRemoveReference<U>::Type, T>::IsDerived, void>::Type>
TStructOnScopeoperator= (U &&InStruct)
 
template<typename U , typename = typename TEnableIf<TIsDerivedFrom<typename TRemoveReference<U>::Type, T>::IsDerived, void>::Type, typename... TArgs>
void InitializeAs (TArgs &&... InArgs)
 
bool InitializeFrom (const FStructOnScope &InOther)
 
bool InitializeFrom (FStructOnScope &&InOther)
 
void InitializeFromChecked (const FStructOnScope &InOther)
 
void InitializeFromChecked (FStructOnScope &&InOther)
 
T * Get () const
 
T * operator-> () const
 
 operator bool () const
 
template<typename U >
U * Cast ()
 
template<typename U >
const U * Cast () const
 
template<typename U >
U * CastChecked ()
 
template<typename U >
const U * CastChecked () const
 
void Serialize (FArchive &Ar)
 
- Public Member Functions inherited from FStructOnScope
COREUOBJECT_API FStructOnScope ()
 
COREUOBJECT_API FStructOnScope (const UStruct *InScriptStruct)
 
COREUOBJECT_API FStructOnScope (const UStruct *InScriptStruct, uint8 *InData)
 
COREUOBJECT_API FStructOnScope (FStructOnScope &&InOther)
 
FStructOnScopeoperator= (FStructOnScope &&InOther)
 
 FStructOnScope (const FStructOnScope &)=delete
 
FStructOnScopeoperator= (const FStructOnScope &)=delete
 
virtual const UStructGetStruct () const
 
TWeakObjectPtr< const UStruct > & GetStructPtr ()
 
virtual bool IsValid () const
 
virtual void Reset ()
 
virtual COREUOBJECT_API ~FStructOnScope ()
 
void Initialize (TWeakObjectPtr< const UStruct > InScriptStruct)
 
COREUOBJECT_API void AddReferencedObjects (FReferenceCollector &Collector)
 

Additional Inherited Members

- Protected Attributes inherited from FStructOnScope
TWeakObjectPtr< const UStructScriptStruct
 
uint8SampleStructMemory
 
TWeakObjectPtr< UPackagePackage
 
bool OwnsMemory
 

Detailed Description

template<typename T>
class TStructOnScope< T >

Typed FStructOnScope that exposes type-safe access to the wrapped struct

Constructor & Destructor Documentation

◆ TStructOnScope() [1/3]

template<typename T >
TStructOnScope< T >::TStructOnScope ( )
default

◆ ~TStructOnScope()

template<typename T >
virtual TStructOnScope< T >::~TStructOnScope ( )
virtualdefault

◆ TStructOnScope() [2/3]

template<typename T >
TStructOnScope< T >::TStructOnScope ( TStructOnScope< T > &&  InOther)
default

◆ TStructOnScope() [3/3]

template<typename T >
template<typename U , typename = typename TEnableIf<TIsDerivedFrom<typename TRemoveReference<U>::Type, T>::IsDerived, void>::Type>
TStructOnScope< T >::TStructOnScope ( U &&  InStruct)
inlineexplicit

Member Function Documentation

◆ Cast() [1/2]

template<typename T >
template<typename U >
U * TStructOnScope< T >::Cast ( )
inline

◆ Cast() [2/2]

template<typename T >
template<typename U >
const U * TStructOnScope< T >::Cast ( ) const
inline

◆ CastChecked() [1/2]

template<typename T >
template<typename U >
U * TStructOnScope< T >::CastChecked ( )
inline

◆ CastChecked() [2/2]

template<typename T >
template<typename U >
const U * TStructOnScope< T >::CastChecked ( ) const
inline

◆ Get()

template<typename T >
T * TStructOnScope< T >::Get ( ) const
inline

◆ InitializeAs()

template<typename T >
template<typename U , typename = typename TEnableIf<TIsDerivedFrom<typename TRemoveReference<U>::Type, T>::IsDerived, void>::Type, typename... TArgs>
void TStructOnScope< T >::InitializeAs ( TArgs &&...  InArgs)
inline

Initialize the TStructOnScope as a struct of type U which needs to derive from T @params InArgs The arguments to pass to the constructor of type U

◆ InitializeFrom() [1/2]

template<typename T >
bool TStructOnScope< T >::InitializeFrom ( const FStructOnScope InOther)
inline

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T @params InOther The FStructOnScope to initialize from

Returns
True if the conversion was successful, false otherwise

◆ InitializeFrom() [2/2]

template<typename T >
bool TStructOnScope< T >::InitializeFrom ( FStructOnScope &&  InOther)
inline

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T @params InOther The FStructOnScope to initialize from

Returns
True if the conversion was successful, false otherwise

◆ InitializeFromChecked() [1/2]

template<typename T >
void TStructOnScope< T >::InitializeFromChecked ( const FStructOnScope InOther)
inline

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T @params InOther The FStructOnScope to initialize from (will assert if it contains an invalid type to store for T)

◆ InitializeFromChecked() [2/2]

template<typename T >
void TStructOnScope< T >::InitializeFromChecked ( FStructOnScope &&  InOther)
inline

Initialize the TStructOnScope from a FStructOnScope containing data that derives from T @params InOther The FStructOnScope to initialize from (will assert if it contains an invalid type to store for T)

◆ operator bool()

template<typename T >
TStructOnScope< T >::operator bool ( ) const
inlineexplicit

◆ operator->()

template<typename T >
T * TStructOnScope< T >::operator-> ( ) const
inline

◆ operator=() [1/2]

template<typename T >
TStructOnScope & TStructOnScope< T >::operator= ( TStructOnScope< T > &&  InOther)
default

◆ operator=() [2/2]

template<typename T >
template<typename U , typename = typename TEnableIf<TIsDerivedFrom<typename TRemoveReference<U>::Type, T>::IsDerived, void>::Type>
TStructOnScope & TStructOnScope< T >::operator= ( U &&  InStruct)
inline

◆ Serialize()

template<typename T >
void TStructOnScope< T >::Serialize ( FArchive Ar)
inline

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