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