UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FStructView Struct Reference

#include <StructView.h>

+ Inheritance diagram for FStructView:

Public Member Functions

 FStructView ()=default
 
 FStructView (const UScriptStruct *InScriptStruct, uint8 *InStructMemory=nullptr)
 
 FStructView (FInstancedStruct &InstancedStruct)
 
 FStructView (const FSharedStruct &SharedStruct)
 
template<typename T >
T & Get () const
 
template<typename T >
T * GetPtr () const
 
const UScriptStructGetScriptStruct () const
 
uint8GetMemory () const
 
void Reset ()
 
bool IsValid () const
 
template<typename OtherType >
bool operator== (const OtherType &Other) const
 
template<typename OtherType >
bool operator!= (const OtherType &Other) const
 

Static Public Member Functions

template<typename T >
static FStructView Make (T &InStruct)
 

Protected Attributes

const UScriptStructScriptStruct = nullptr
 
uint8StructMemory = nullptr
 

Detailed Description

FStructView is "typed" struct pointer, it contains pointer to struct plus UScriptStruct pointer. FStructView does not own the memory and will not free it when out of scope. It should be only used to pass struct pointer in a limited scope, or when the user controls the lifetime of the struct being stored. E.g. instead of passing ref or pointer to a FInstancedStruct, you should use FConstStructView or FStructView to pass around a view to the contents. FStructView is passed by value. FStructView is similar to FStructOnScope, but FStructView is a view only (FStructOnScope can either own the memory or be a view) const FStructView prevents the struct from pointing at a different instance of a struct. However the actual struct data can be mutated. Use FConstStructView to prevent mutation of the actual struct data. See FConstStructView for examples.

Constructor & Destructor Documentation

◆ FStructView() [1/4]

FStructView::FStructView ( )
default

◆ FStructView() [2/4]

FStructView::FStructView ( const UScriptStruct InScriptStruct,
uint8 InStructMemory = nullptr 
)
inline

◆ FStructView() [3/4]

FStructView::FStructView ( FInstancedStruct InstancedStruct)
inline

◆ FStructView() [4/4]

FStructView::FStructView ( const FSharedStruct SharedStruct)
inline

Member Function Documentation

◆ Get()

template<typename T >
T & FStructView::Get ( ) const
inline

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

◆ GetMemory()

uint8 * FStructView::GetMemory ( ) const
inline

Returns pointer to struct memory.

◆ GetPtr()

template<typename T >
T * FStructView::GetPtr ( ) const
inline

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

◆ GetScriptStruct()

const UScriptStruct * FStructView::GetScriptStruct ( ) const
inline

Returns struct type.

◆ IsValid()

bool FStructView::IsValid ( ) const
inline

Returns True if the struct is valid.

◆ Make()

template<typename T >
static FStructView FStructView::Make ( T &  InStruct)
inlinestatic

Creates a new FStructView from the templated struct. Note its not safe to make InStruct const ref as the original object may have been declared const

◆ operator!=()

template<typename OtherType >
bool FStructView::operator!= ( const OtherType Other) const
inline

◆ operator==()

template<typename OtherType >
bool FStructView::operator== ( const OtherType Other) const
inline

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

◆ Reset()

void FStructView::Reset ( )
inline

Reset to empty.

Member Data Documentation

◆ ScriptStruct

const UScriptStruct* FStructView::ScriptStruct = nullptr
protected

◆ StructMemory

uint8* FStructView::StructMemory = nullptr
protected

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