UStruct

Base class for all [UObject](API\Runtime\CoreUObject\UObject\UObject) types that contain fields.

Inheritance Hierarchy

References

Module

CoreUObject

Header

/Engine/Source/Runtime/CoreUObject/Public/UObject/Class.h

Include

#include "UObject/Class.h"

Syntax

class UStruct :
    public UField,
    private FStructBaseChain

Remarks

Base class for all UObject types that contain fields.

Variables

Name Description

Protected variable

bool

 

bHasAssetRegistrySearchableProperties

True if this struct has Asset Registry searchable properties

Public variable

FField *

 

ChildProperties

Pointer to start of linked list of child fields

Public variable

TObjectPtr< UFi...

 

Children

Pointer to start of linked list of child fields

Public variable

FProperty *

 

DestructorLink

In memory only: Linked list of properties requiring destruction.

Public variable

int32

 

FieldPathSerialNumber

Unique id incremented each time this class properties get destroyed

Public variable

int32

 

MinAlignment

Alignment of structure in memory, structure will be at least this large

Public variable

FProperty *

 

PostConstructLink

In memory only: Linked list of properties requiring post constructor initialization

Public variable

int32

 

PropertiesSize

Total size of all UProperties, the allocated structure may be larger due to alignment

Public variable

FProperty *

 

PropertyLink

In memory only: Linked list of properties from most-derived to base

Public variable

TArray< TObject...

 

PropertyWrappers

List of wrapper UObjects for FProperties

Public variable

FProperty *

 

RefLink

In memory only: Linked list of object reference properties from most-derived to base

Public variable

TArray< uint8 >

 

Script

Script bytecode associated with this object

Public variable

TArray< TObject...

 

ScriptAndPropertyObjectReferences

Array of object references embedded in script code and referenced by FProperties.

Public variable

FUnresolvedScri...

 

UnresolvedScriptProperties

Contains a list of script properties that couldn't be resolved at load time

Public variable

const FUnversio...

 

UnversionedEditorSchema

Cached schema for optimized unversioned property serialization, with editor data, owned by this.

Public variable

const FUnversio...

 

UnversionedGameSchema

Cached schema for optimized unversioned and filtereditoronly property serialization, owned by this.

Constructors

Name Description

Public function

UStruct

(
    const FObjectInitializer& ObjectIn...
)

Public function

UStruct

(
    FVTableHelper& Helper
)

DO NOT USE. This constructor is for internal usage only for hot-reload purposes.

Public function

UStruct

(
    UStruct* InSuperStruct,
    SIZE_T ParamsSize,
    SIZE_T Alignment
)

Public function

UStruct

(
    EStaticConstructor,
    int32 InSize,
    int32 InAlignment,
    EObjectFlags InFlags
)

Constructors.

Public function

UStruct

(
    const FObjectInitializer& ObjectIn...,
    UStruct* InSuperStruct,
    SIZE_T ParamsSize,
    SIZE_T Alignment
)

Destructors

Name Description

Public function Virtual

~UStruct()

Functions

Name Description

Public function Static

void

 

__DefaultConstructor

(
    const FObjectInitializer& X
)

Public function Static

UObject *...

 

__VTableCtorCaller

(
    FVTableHelper& Helper
)

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Protected function Virtual Const

bool

 

ArePropertyGuidsAvailable()

Returns if we have access to property guids

Public function

void

 

CollectBytecodeAndPropertyReferencedObjects()

Collects UObjects referenced by bytecode and properties for faster GC access

Public function

void

 

CollectBytecodeAndPropertyReferencedObjectsRecursively()

Collects UObjects referenced by bytecode and properties for this class and its child fields and their children...

Public function

void

 

CollectBytecodeReferencedObjects

(
    TArray< UObject* >& OutRefere...
)

Collects UObjects referenced by bytecode

Public function

void

 

CollectPropertyReferencedObjects

(
    TArray< UObject* >& OutRefere...
)

Collects UObjects referenced by properties

Protected function

void

 

ConvertUFieldsToFFields()

Public function Virtual Const

FProperty &#...

 

CustomFindProperty

(
    const FName InName
)

Look up a property by an alternate name if it was not found in the first search, this is overridden for user structs

Public function

void

 

DeleteUnresolvedScriptProperties()

Deletes the UnresolvedScriptProperties array

Public function

void

 

DestroyChildPropertiesAndResetPropertyLinks()

Destroys all properties owned by this struct

Public function Virtual Const

void

 

DestroyStruct

(
    void* Dest,
    int32 ArrayDim
)

Destroy a struct in memory.

Public function Const

FProperty &#...

 

FindPropertyByName

(
    FName InName
)

Searches property link chain for a property with the specified name

Protected function Virtual Const

FGuid

 

FindPropertyGuidFromName

(
    const FName InName
)

Find property guid

Protected function Virtual Const

FName

 

FindPropertyNameFromGuid

(
    const FGuid& PropertyGuid
)

Returns the property name from the guid

Public function Virtual Const

FString

 

GetAuthoredNameForField

(
    const UField* Field
)

Returns a human readable string for a given field, overridden for user defined structs

Public function Virtual Const

FString

 

GetAuthoredNameForField

(
    const FField* Field
)

Returns a human readable string for a given field, overridden for user defined structs

Public function Const

bool

 

GetBoolMetaDataHierarchical

(
    const FName& Key
)

Try and find boolean metadata with the given key.

Public function Virtual Const

UStruct *...

 

GetInheritanceSuper()

Returns the structure used for inheritance, may be changed by child types

Public function Const

int32

 

GetMinAlignment()

Alignment of structure in memory, structure will be at least this large

Public function Virtual Const

const TCHAR ...

 

GetPrefixCPP()

Returns the struct/ class prefix used for the C++ declaration of this struct/ class.

Public function Const

int32

 

GetPropertiesSize()

Total size of all UProperties, the allocated structure may be larger due to alignment

Public function Const

const FBlake...

 

GetSchemaHash

(
    bool bSkipEditorOnly
)

Get the Schema Hash for this struct - the hash of its property names and types.

Public function Const

bool

 

GetStringMetaDataHierarchical

(
    const FName& Key,
    FString* OutValue
)

Try and find string metadata with the given key.

Public function Const

FTopLevelAss...

 

GetStructPathName()

Returns struct path name as a package + struct FName pair

Public function Const

int32

 

GetStructureSize()

Returns actual allocated size of structure in memory

Public function Const

UStruct *...

 

GetSuperStruct()

Struct this inherits from, may be null

Public function Const

bool

 

HasAssetRegistrySearchableProperties()

Returns true if this struct has Asset Registry searchable properties

Public function Const

const UStruc...

 

HasMetaDataHierarchical

(
    const FName& Key
)

Determines if the struct or any of its super structs has any metadata associated with the provided key

Public function Virtual Const

void

 

InitializeStruct

(
    void* Dest,
    int32 ArrayDim
)

Initialize a struct over uninitialized memory.

Public function

void

 

InstanceSubobjectTemplates

(
    void* Data,
    void const* DefaultData,
    UStruct* DefaultStruct,
    UObject* Owner,
    FObjectInstancingGraph* Instan...
)

Creates new copies of components

Public function Const

bool

 

IsChildOf

(
    const UStruct* SomeBase
)

Returns true if this struct either is SomeBase, or is a child of SomeBase.

Public function Const

bool

 

IsChildOf()

Returns true if this struct either is class T, or is a child of class T.

Public function Virtual Const

bool

 

IsStructTrashed()

If true, this class has been cleaned and sanitized (trashed) and should not be used

Public function Virtual

void

 

Link

(
    FArchive& Ar,
    bool bRelinkExistingProperties
)

Creates the field/property links and gets structure ready for use at runtime

Protected function Const

void

 

LoadTaggedPropertiesFromText

(
    FStructuredArchive::FSlot Slot,
    uint8* Data,
    UStruct* DefaultsStruct,
    uint8* Defaults,
    const UObject* BreakRecursionI...
)

Serializes list of properties to a te, using property tags to handle mismatches

Public function Virtual

void

 

PreloadChildren

(
    FArchive& Ar
)

Preloads all fields that belong to this struct

Public function Virtual Const

void

 

SerializeBin

(
    FStructuredArchive::FSlot Slot,
    void* Data
)

Serializes struct properties, does not handle defaults.

Public function Virtual Const

void

 

SerializeBin

(
    FArchive& Ar,
    void* Data
)

Serializes struct properties, does not handle defaults.

Public function Const

void

 

SerializeBinEx

(
    FStructuredArchive::FSlot Slot,
    void* Data,
    void const* DefaultData,
    UStruct* DefaultStruct
)

Serializes the class properties that reside in Data if they differ from the corresponding values in DefaultData

Public function Virtual

EExprToken

 

SerializeExpr

(
    int32& iCode,
    FArchive& Ar
)

Serialize an expression to an archive. Returns expression token

Protected function

void

 

SerializeProperties

(
    FArchive& Ar
)

Serializes properties of this struct

Public function Virtual Const

void

 

SerializeTaggedProperties

(
    FStructuredArchive::FSlot Slot,
    uint8* Data,
    UStruct* DefaultsStruct,
    uint8* Defaults,
    const UObject* BreakRecursionI...
)

Serializes list of properties, using property tags to handle mismatches

Public function Virtual Const

void

 

SerializeTaggedProperties

(
    FArchive& Ar,
    uint8* Data,
    UStruct* DefaultsStruct,
    uint8* Defaults,
    const UObject* BreakRecursionI...
)

Serializes list of properties, using property tags to handle mismatches

Public function

void

 

SetPropertiesSize

(
    int32 NewSize
)

Modifies the property size after it's been recomputed

Public function Virtual

void

 

SetSuperStruct

(
    UStruct* NewSuperStruct
)

Sets the super struct pointer and updates hash information as necessary.

Public function

void

 

SetUnresolvedScriptProperties

Sets the UnresolvedScriptProperties array

Public function Static

UClass *

 

StaticClass()

Returns a UClass object representing this class at runtime

Public function Static

EClassCastFl...

 

StaticClassCastFlags()

Returns the static cast flags for this class

Public function

void

 

StaticLink

(
    bool bRelinkExistingProperties
)

Static wrapper for Link, using a dummy archive

Public function Static

const TCHAR ...

 

StaticPackage()

Returns the package this class belongs in

Public function Static

void

 

StaticRegisterNativesUStruct()

Overridden from UField

Name Description

Public function Virtual

void

 

AddCppProperty

(
    FProperty* Property
)

Overridden from UObject

Name Description

Public function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Public function Virtual

void

 

GetPreloadDependencies

(
    TArray< UObject* >& OutDeps
)

Called during cooking.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FStructuredArchive::FRecord Record
)

Handles reading, writing, and reference collecting using FArchive.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Public function Virtual

void

 

TagSubobjects

(
    EObjectFlags NewFlags
)

Tags objects that are part of the same asset with the specified object flag, used for GC checking

Overridden from UObjectBase

Name Description

Public function Virtual

void

 

RegisterDependencies()

Force any base classes to be registered first, then call BaseRegister

Operators

Name Description

Public function

void

 

operator delete

(
    void* InMem
)

Eliminate V1062 warning from PVS-Studio while keeping MSVC and Clang happy.

Public function

void *

 

operator new

(
    const size_t InSize,
    EInternal InInternalOnly,
    UObject* InOuter,
    FName InName,
    EObjectFlags InSetFlags
)

For internal use only; use StaticConstructObject() to create new objects.

Public function

void *

 

operator new

(
    const size_t InSize,
    EInternal* InMem
)

For internal use only; use StaticConstructObject() to create new objects.

Typedefs

Name

Description

FUnresolvedScriptPropertiesArray

Super

Typedef for the base class (UField)

ThisClass

Typedef for UStruct.

Constants

Name

Description

StaticClassFlags

Bitwise union of EClassFlags pertaining to this class.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Cancel