UScriptStruct

Reflection data for a standalone structure declared in a header or as a user defined struct

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

CoreUObject

Header

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

Include

#include "UObject/Class.h"

Syntax

class UScriptStruct : public UStruct

Remarks

Reflection data for a standalone structure declared in a header or as a user defined struct

Variables

Name Description

Protected variable

bool

 

bPrepareCppStructOpsCompleted

True if we have performed PrepareCppStructOps

Protected variable

ICppStructOps &...

 

CppStructOps

Holds the Cpp ctors and dtors, sizeof, etc. Is not owned by this and is not released.

Public variable

EStructFlags

 

StructFlags

Constructors

Name Description

Public function

UScriptStruct

(
    FVTableHelper& Helper
)

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

Public function

UScriptStruct

(
    const FObjectInitializer& ObjectIn...
)

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

Public function

UScriptStruct

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

Public function

UScriptStruct

(
    const FObjectInitializer& ObjectIn...,
    UScriptStruct* InSuperStruct,
    ICppStructOps* InCppStructOps,
    EStructFlags InStructFlags,
    SIZE_T ExplicitSize,
    SIZE_T ExplicitAlignment
)

Functions

Name Description

Public function Static

void

 

__DefaultConstructor

(
    const FObjectInitializer& X
)

Public function Static

UObject *...

 

__VTableCtorCaller

(
    FVTableHelper& Helper
)

Public function

void

 

ClearCppStructOps()

Resets currently assigned CppStructOps, called when loading a struct

Public function Const

void

 

ClearScriptStruct

(
    void* Dest,
    int32 ArrayDim
)

Reinitialize a struct in memory.

Public function Const

bool

 

CompareScriptStruct

(
    const void* A,
    const void* B,
    uint32 PortFlags
)

Compare two script structs

Public function Const

void

 

CopyScriptStruct

(
    void* Dest,
    void const* Src,
    int32 ArrayDim
)

Copy a struct over an existing struct

Public function Static

void

 

DeferCppStructOps

(
    FName Target,
    ICppStructOps* InCppStructOps
)

Stash a CppStructOps for future use

Public function Static

TEnableIf<&#...

 

DeferCppStructOps

(
    FName Target
)

Public function Static

TEnableIf< (...

 

DeferCppStructOps

(
    FName Target
)

Public function Const

void

 

ExportText

(
    FString& ValueStr,
    const void* Value,
    const void* Defaults,
    UObject* OwnerObject,
    int32 PortFlags,
    UObject* ExportRootScope,
    bool bAllowNativeOverride
)

Export script struct to a string that can later be imported

Public function Const

ICppStructOp...

 

GetCppStructOps()

Returns the CppStructOps that can be used to do custom operations

Public function Virtual Const

FGuid

 

GetCustomGuid()

Returns the custom Guid assigned to this struct for User Defined Structs, or an invalid Guid

Public function Virtual Const

FString

 

GetStructCPPName()

Returns the (native, c++) name of the struct

Public function Virtual Const

uint32

 

GetStructTypeHash

(
    const void* Src
)

Calls GetTypeHash for native structs, otherwise computes a hash of all struct members

Public function Const

bool

 

HasDefaults()

If it is native, it is assumed to have defaults because it has a constructor

Public function

const TCHAR ...

 

ImportText

(
    const TCHAR* Buffer,
    void* Value,
    UObject* OwnerObject,
    int32 PortFlags,
    FOutputDevice* ErrorText,
    const TFunctionRef< FString()>& St...,
    bool bAllowNativeOverride
)

Sets value of script struct based on imported string

Public function

const TCHAR ...

 

ImportText

(
    const TCHAR* Buffer,
    void* Value,
    UObject* OwnerObject,
    int32 PortFlags,
    FOutputDevice* ErrorText,
    const FString& StructName,
    bool bAllowNativeOverride
)

Sets value of script struct based on imported string

Public function Virtual Const

void

 

InitializeDefaultValue

(
    uint8* InStructData
)

Initializes this structure to its default values

Public function Virtual

void

 

PrepareCppStructOps()

Look for the CppStructOps and hook it up

Public function Virtual

void

 

RecursivelyPreload()

Used by User Defined Structs to preload this struct and any child objects

Public function

void

 

SerializeItem

(
    FStructuredArchive::FSlot Slot,
    void* Value,
    void const* Defaults
)

Serializes a specific instance of a struct

Public function

void

 

SerializeItem

(
    FArchive& Ar,
    void* Value,
    void const* Defaults
)

Serializes a specific instance of a struct

Public function

void

 

SetStructTrashed

(
    bool bIsTrash
)

Sets or unsets the trashed flag on this struct

Public function Const

bool

 

ShouldSerializeAtomically

(
    FArchive& Ar
)

Returns whether this struct should be serialized atomically.

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 Static

const TCHAR ...

 

StaticPackage()

Returns the package this class belongs in

Public function Static

void

 

StaticRegisterNativesUScriptStruct()

Public function Const

bool

 

UseBinarySerialization

(
    const FArchive& Ar
)

Returns true if this struct should be binary serialized for the given archive

Public function Const

bool

 

UseNativeSerialization()

Returns true if this struct has a native serialize function

Overridden from UStruct

Name Description

Public function Virtual Const

void

 

DestroyStruct

(
    void* Dest,
    int32 ArrayDim
)

Destroy a struct in memory.

Public function Virtual Const

void

 

InitializeStruct

(
    void* Dest,
    int32 ArrayDim
)

Initialize a struct over uninitialized memory.

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

Overridden from UObject

Name Description

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.

Operators

Name Description

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.

Classes

Name

Description

Public struct

ICppStructOps

Interface to template to manage dynamic access to C++ struct construction and destruction

Public struct

TAutoCppStructOps

Template for noexport classes to autoregister before main starts

Public struct

TCppStructOps

Template to manage dynamic access to C++ struct construction and destruction

Typedefs

Name

Description

Super

Typedef for the base class (UStruct)

ThisClass

Typedef for UScriptStruct.

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
Dismiss