![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#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 UScriptStruct * | GetScriptStruct () const |
| const uint8 * | GetMemory () 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 UScriptStruct * | ScriptStruct = nullptr |
| const uint8 * | StructMemory = nullptr |
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
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Returns const reference to the struct, this getter assumes that all data is valid.
|
inline |
Returns const pointer to struct memory.
|
inlineconstexpr |
Returns const pointer to the struct, or nullptr if cast is not valid.
|
inline |
Returns struct type.
|
inline |
Returns True if the struct is valid.
|
inlinestatic |
Creates a new FConstStructView from the templated struct
Comparison operators. Note: it does not compare the internal structure itself
|
inline |
Reset to empty.
|
inline |
|
protected |
|
protected |