Navigation
API > API/Runtime > API/Runtime/CoreUObject
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.
| Name | FStructView |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/StructUtils/StructView.h |
| Include Path | #include "StructUtils/StructView.h" |
Syntax
struct FStructView
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStructView () |
StructUtils/StructView.h | ||
FStructView
(
FInstancedStruct& InstancedStruct |
StructUtils/StructView.h | ||
FStructView
(
const FSharedStruct& SharedStruct |
StructUtils/StructView.h | ||
FStructView
(
const UScriptStruct* InScriptStruct, |
StructUtils/StructView.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T & Get() |
Returns mutable reference to the struct, this getter assumes that all data is valid. | StructUtils/StructView.h | |
uint8 * GetMemory() |
Returns pointer to struct memory. | StructUtils/StructView.h | |
T * GetPtr() |
Returns mutable pointer to the struct, or nullptr if cast is not valid. | StructUtils/StructView.h | |
const UScriptStruct * GetScriptStruct() |
Returns struct type. | StructUtils/StructView.h | |
bool IsValid() |
Returns True if the struct is valid. | StructUtils/StructView.h | |
void Reset() |
Reset to empty. | StructUtils/StructView.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static FStructView Make
(
T& InStruct |
Creates a new FStructView from the templated struct. | StructUtils/StructView.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const OtherType& Other |
StructUtils/StructView.h | ||
bool operator==
(
const OtherType& Other |
Comparison operators. Note: it does not compare the internal structure itself | StructUtils/StructView.h |