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

#include <StructView.h>

+ Inheritance diagram for FConstStructView:

Public Member Functions

 FConstStructView ()=default
 
 FConstStructView (const UScriptStruct *InScriptStruct, const uint8 *InStructMemory=nullptr)
 
 FConstStructView (const FInstancedStruct &InstancedStruct)
 
 FConstStructView (const FSharedStruct &SharedStruct)
 
 FConstStructView (const FConstSharedStruct &SharedStruct)
 
 FConstStructView (const FStructView StructView)
 
template<typename T >
requires (std::is_const_v<T>)
constexpr T & Get () const
 
template<typename T >
requires (std::is_const_v<T>)
constexpr T * GetPtr () const
 
const UScriptStructGetScriptStruct () const
 
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
 
void SetStructData (const UScriptStruct *InScriptStruct, const uint8 *InStructMemory)
 

Static Public Member Functions

template<typename T >
static FConstStructView Make (const T &Struct)
 

Protected Attributes

const UScriptStructScriptStruct = nullptr
 
const uint8StructMemory = nullptr
 

Detailed Description

FConstStructView is "typed" struct pointer, it contains const pointer to struct plus UScriptStruct pointer. FConstStructView does not own the memory and will not free it when 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. FConstStructView is passed by value. FConstStructView is similar to FStructOnScope, but FConstStructView is a view only (FStructOnScope can either own the memory or be a view) FConstStructView prevents mutation of the actual struct data however the struct being pointed at can be changed to point at a different instance of a struct. To also prevent this use const FConstStructView. e.g. FStructView A; FConstStructView B = A; // compiles e.g. FStructView A; FConstStructView B; B = A; // compiles as B can be made to point at any other StructView e.g. FConstStructView A; FStructView B = A; // doesn't compile as the struct data for A is immutable (but mutable for B) e.g. FStructView A; A.Foo = NewVal; // compiles as the struct data for A is mutable. e.g. FConstStructView A; A.Foo = NewVal; // doesn't compile as the struct data for A is immutable. e.g. FStructView A; const FStructView B; A = B; // compiles as the struct B is pointing to can't be made to point at something else but A isn't const. e.g. const FStructView A; FStructView B; A = B; // doesn't compile as attempting to make const view point at something else

Constructor & Destructor Documentation

◆ FConstStructView() [1/6]

FConstStructView::FConstStructView ( )
default

◆ FConstStructView() [2/6]

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

◆ FConstStructView() [3/6]

FConstStructView::FConstStructView ( const FInstancedStruct InstancedStruct)
inline

◆ FConstStructView() [4/6]

FConstStructView::FConstStructView ( const FSharedStruct SharedStruct)
inline

◆ FConstStructView() [5/6]

FConstStructView::FConstStructView ( const FConstSharedStruct SharedStruct)
inline

◆ FConstStructView() [6/6]

FConstStructView::FConstStructView ( const FStructView  StructView)
inline

Member Function Documentation

◆ Get()

template<typename T >
requires (std::is_const_v<T>)
constexpr T & FConstStructView::Get ( ) const
inlineconstexpr

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

◆ GetMemory()

const uint8 * FConstStructView::GetMemory ( ) const
inline

Returns const pointer to struct memory.

◆ GetPtr()

template<typename T >
requires (std::is_const_v<T>)
constexpr T * FConstStructView::GetPtr ( ) const
inlineconstexpr

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

◆ GetScriptStruct()

const UScriptStruct * FConstStructView::GetScriptStruct ( ) const
inline

Returns struct type.

◆ IsValid()

bool FConstStructView::IsValid ( ) const
inline

Returns True if the struct is valid.

◆ Make()

template<typename T >
static FConstStructView FConstStructView::Make ( const T &  Struct)
inlinestatic

Creates a new FConstStructView from the templated struct

◆ operator!=()

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

◆ operator==()

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

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

◆ Reset()

void FConstStructView::Reset ( )
inline

Reset to empty.

◆ SetStructData()

void FConstStructView::SetStructData ( const UScriptStruct InScriptStruct,
const uint8 InStructMemory 
)
inline

Member Data Documentation

◆ ScriptStruct

const UScriptStruct* FConstStructView::ScriptStruct = nullptr
protected

◆ StructMemory

const uint8* FConstStructView::StructMemory = nullptr
protected

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