Navigation
API > API/Runtime > API/Runtime/CoreUObject
Holds the information and memory about a UStruct. Instances of these are shared using FConstSharedStruct and FSharedStruct.
The size of the allocation for this struct always includes both the size of the struct and also the size required to hold the structure described by the ScriptStruct. This avoids two pointer referencing (cache misses). Look at Create() to understand more.
A 'const FStructSharedMemory' the memory is immutable. We restrict shallow copies of StructMemory where it's not appropriate in the owning types that compose this type:
- FSharedStruct A; ConstSharedStruct B = A; is allowed
- ConstSharedStruct A; FSharedStruct B = A; is not allowed
This type is designed to be used in composition and should not be used outside the types that compose it.
| Name | FStructSharedMemory |
| Type | struct |
| Header File | /Engine/Source/Runtime/CoreUObject/Public/StructUtils/SharedStruct.h |
| Include Path | #include "StructUtils/SharedStruct.h" |
Syntax
struct FStructSharedMemory
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStructSharedMemory
(
const FStructSharedMemory& Other |
StructUtils/SharedStruct.h | ||
FStructSharedMemory
(
const FStructSharedMemory&& Other |
StructUtils/SharedStruct.h | ||
FStructSharedMemory
(
const UScriptStruct* InScriptStruct, |
StructUtils/SharedStruct.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FStructSharedMemory() |
StructUtils/SharedStruct.h |
Structs
| Name | Remarks |
|---|---|
| FStructSharedMemoryDeleter |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| ScriptStruct | TObjectPtr< const UScriptStruct > | StructUtils/SharedStruct.h | ||
| StructMemory | uint8 | Memory for the struct described by ScriptStruct will be allocated here using the 'Flexible array member' pattern. | StructUtils/SharedStruct.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
const uint8 * GetMemory() |
Returns pointer to aligned struct memory. | StructUtils/SharedStruct.h | |
uint8 * GetMutableMemory() |
Returns mutable pointer to aligned struct memory. | StructUtils/SharedStruct.h | |
const UScriptStruct & GetScriptStruct() |
Returns struct type. | StructUtils/SharedStruct.h | |
TObjectPtr< const UScriptStruct > & GetScriptStructPtr() |
StructUtils/SharedStruct.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedPtr< FStructSharedMemory > Create
(
const UScriptStruct* InScriptStruct, |
StructUtils/SharedStruct.h | ||
static TSharedPtr< FStructSharedMemory > Create
(
const UScriptStruct& InScriptStruct, |
StructUtils/SharedStruct.h | ||
static TSharedPtr< FStructSharedMemory > CreateArgs
(
TArgs&&... InArgs |
StructUtils/SharedStruct.h | ||
static FStructSharedMemory * CreateImpl
(
const UScriptStruct* InScriptStruct, |
StructUtils/SharedStruct.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FStructSharedMemory & operator=
(
const FStructSharedMemory& Other |
StructUtils/SharedStruct.h | ||
FStructSharedMemory & operator=
(
const FStructSharedMemory&& Other |
StructUtils/SharedStruct.h |