engine
 
载入中...
搜索中...
未找到
类 | Public 成员函数 | 静态 Public 成员函数 | Protected 属性 | 所有成员列表
UScriptStruct类 参考

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

#include <Class.h>

+ 类 UScriptStruct 继承关系图:

类

struct  ICppStructOps
 Interface to template to manage dynamic access to C++ struct construction and destruction 更多...
 
struct  TAutoCppStructOps
 Template for noexport classes to autoregister before main starts 更多...
 
struct  TCppStructOps
 Template to manage dynamic access to C++ struct construction and destruction 更多...
 

Public 成员函数

void ClearCppStructOps ()
 Resets currently assigned CppStructOps, called when loading a struct
 
COREUOBJECT_API void ClearScriptStruct (void *Dest, int32 ArrayDim=1) const
 Reinitialize a struct in memory. 更多...
 
COREUOBJECT_API bool CompareScriptStruct (const void *A, const void *B, uint32 PortFlags) const
 Compare two script structs 更多...
 
COREUOBJECT_API void CopyScriptStruct (void *Dest, void const *Src, int32 ArrayDim=1) const
 Copy a struct over an existing struct 更多...
 
virtual COREUOBJECT_API void DestroyStruct (void *Dest, int32 ArrayDim=1) const override
 Destroy a struct in memory. 更多...
 
COREUOBJECT_API void ExportText (FString &ValueStr, const void *Value, const void *Defaults, UObject *OwnerObject, int32 PortFlags, UObject *ExportRootScope, bool bAllowNativeOverride=true) const
 Export script struct to a string that can later be imported 更多...
 
FORCEINLINE ICppStructOps * GetCppStructOps () const
 Returns the CppStructOps that can be used to do custom operations
 
virtual COREUOBJECT_API FGuid GetCustomGuid () const
 Returns the custom Guid assigned to this struct for User Defined Structs, or an invalid Guid
 
virtual COREUOBJECT_API FString GetStructCPPName () const
 Returns the (native, c++) name of the struct
 
virtual COREUOBJECT_API uint32 GetStructTypeHash (const void *Src) const
 Calls GetTypeHash for native structs, otherwise computes a hash of all struct members 更多...
 
FORCEINLINE bool HasDefaults () const
 If it is native, it is assumed to have defaults because it has a constructor 更多...
 
COREUOBJECT_API const TCHAR * ImportText (const TCHAR *Buffer, void *Value, UObject *OwnerObject, int32 PortFlags, FOutputDevice *ErrorText, const FString &StructName, bool bAllowNativeOverride=true)
 Sets value of script struct based on imported string 更多...
 
COREUOBJECT_API const TCHAR * ImportText (const TCHAR *Buffer, void *Value, UObject *OwnerObject, int32 PortFlags, FOutputDevice *ErrorText, const TFunctionRef< FString()> &StructNameGetter, bool bAllowNativeOverride=true)
 Sets value of script struct based on imported string 更多...
 
virtual COREUOBJECT_API void InitializeDefaultValue (uint8 *InStructData) const
 Initializes this structure to its default values 更多...
 
virtual COREUOBJECT_API void InitializeStruct (void *Dest, int32 ArrayDim=1) const override
 Initialize a struct over uninitialized memory. 更多...
 
virtual COREUOBJECT_API bool IsStructTrashed () const override
 If true, this class has been cleaned and sanitized (trashed) and should not be used
 
virtual COREUOBJECT_API void Link (FArchive &Ar, bool bRelinkExistingProperties) override
 Creates the field/property links and gets structure ready for use at runtime
 
virtual COREUOBJECT_API void PrepareCppStructOps ()
 Look for the CppStructOps and hook it up
 
virtual COREUOBJECT_API void RecursivelyPreload ()
 Used by User Defined Structs to preload this struct and any child objects
 
virtual COREUOBJECT_API void Serialize (FArchive &Ar) override
 Handles reading, writing, and reference collecting using FArchive. 更多...
 
COREUOBJECT_API void SerializeItem (FArchive &Ar, void *Value, void const *Defaults)
 Serializes a specific instance of a struct 更多...
 
void COREUOBJECT_API SetStructTrashed (bool bIsTrash)
 Sets or unsets the trashed flag on this struct
 
bool ShouldSerializeAtomically (FArchive &Ar) const
 Returns whether this struct should be serialized atomically. 更多...
 
COREUOBJECT_API bool UseBinarySerialization (const FArchive &Ar) const
 Returns true if this struct should be binary serialized for the given archive
 
bool UseNativeSerialization () const
 Returns true if this struct has a native serialize function
 
- Public 成员函数 继承自 UStruct
void CollectBytecodeAndPropertyReferencedObjects ()
 Collects UObjects referenced by bytecode and properties for faster GC access
 
void CollectBytecodeReferencedObjects (TArray< UObject * > &OutReferencedObjects)
 Collects UObjects referenced by bytecode 更多...
 
void CollectPropertyReferencedObjects (TArray< UObject * > &OutReferencedObjects)
 Collects UObjects referenced by properties 更多...
 
virtual FProperty * CustomFindProperty (const FName InName) const
 Look up a property by an alternate name if it was not found in the first search, this is overridden for user structs
 
FORCEINLINE void DeleteUnresolvedScriptProperties ()
 Deletes the UnresolvedScriptProperties array
 
void DestroyChildPropertiesAndResetPropertyLinks ()
 Destroys all properties owned by this struct
 
virtual void DestroyStruct (void *Dest, int32 ArrayDim=1) const
 Destroy a struct in memory. 更多...
 
FProperty * FindPropertyByName (FName InName) const
 Searches property link chain for a property with the specified name
 
virtual void FinishDestroy () override
 Called to finish destroying the object. 更多...
 
virtual FString GetAuthoredNameForField (const FField *Field) const
 Returns a human readable string for a given field, overridden for user defined structs
 
virtual FString GetAuthoredNameForField (const UField *Field) const
 Returns a human readable string for a given field, overridden for user defined structs
 
virtual UStruct * GetInheritanceSuper () const
 Returns the structure used for inheritance, may be changed by child types
 
FORCEINLINE int32 GetMinAlignment () const
 Alignment of structure in memory, structure will be at least this large
 
virtual const TCHAR * GetPrefixCPP () const
 Returns the struct/ class prefix used for the C++ declaration of this struct/ class. 更多...
 
virtual void GetPreloadDependencies (TArray< UObject * > &OutDeps) override
 Called during cooking. 更多...
 
FORCEINLINE int32 GetPropertiesSize () const
 Total size of all UProperties, the allocated structure may be larger due to alignment
 
FORCEINLINE int32 GetStructureSize () const
 Returns actual allocated size of structure in memory
 
UStruct * GetSuperStruct () const
 Struct this inherits from, may be null
 
virtual void InitializeStruct (void *Dest, int32 ArrayDim=1) const
 Initialize a struct over uninitialized memory. 更多...
 
void InstanceSubobjectTemplates (void *Data, void const *DefaultData, UStruct *DefaultStruct, UObject *Owner, FObjectInstancingGraph *InstanceGraph)
 Creates new copies of components 更多...
 
template<class T >
bool IsChildOf () const
 Returns true if this struct either is class T, or is a child of class T. 更多...
 
bool IsChildOf (const UStruct *SomeBase) const
 Returns true if this struct either is SomeBase, or is a child of SomeBase. 更多...
 
virtual bool IsStructTrashed () const
 If true, this class has been cleaned and sanitized (trashed) and should not be used
 
virtual void Link (FArchive &Ar, bool bRelinkExistingProperties)
 Creates the field/property links and gets structure ready for use at runtime
 
virtual void PostLoad () override
 Do any object-specific cleanup required immediately after loading an object. 更多...
 
virtual void RegisterDependencies () override
 Force any base classes to be registered first
 
virtual void Serialize (FArchive &Ar) override
 Handles reading, writing, and reference collecting using FArchive. 更多...
 
virtual void SerializeBin (FArchive &Ar, void *Data) const final
 Serializes struct properties, does not handle defaults
 
virtual void SerializeBin (FStructuredArchive::FSlot Slot, void *Data) const
 Serializes struct properties, does not handle defaults
 
void SerializeBinEx (FStructuredArchive::FSlot Slot, void *Data, void const *DefaultData, UStruct *DefaultStruct) const
 Serializes the class properties that reside in Data if they differ from the corresponding values in DefaultData 更多...
 
virtual EExprToken SerializeExpr (int32 &iCode, FArchive &Ar)
 Serialize an expression to an archive. 更多...
 
virtual void SerializeTaggedProperties (FArchive &Ar, uint8 *Data, UStruct *DefaultsStruct, uint8 *Defaults, const UObject *BreakRecursionIfFullyLoad=nullptr) const final
 Serializes list of properties, using property tags to handle mismatches
 
virtual void SerializeTaggedProperties (FStructuredArchive::FSlot Slot, uint8 *Data, UStruct *DefaultsStruct, uint8 *Defaults, const UObject *BreakRecursionIfFullyLoad=nullptr) const
 Serializes list of properties, using property tags to handle mismatches
 
void SetPropertiesSize (int32 NewSize)
 Modifies the property size after it's been recomputed
 
virtual void SetSuperStruct (UStruct *NewSuperStruct)
 Sets the super struct pointer and updates hash information as necessary. 更多...
 
void SetUnresolvedScriptProperties (FUnresolvedScriptPropertiesArray &InUnresolvedProperties)
 Sets the UnresolvedScriptProperties array
 
void StaticLink (bool bRelinkExistingProperties=false)
 Static wrapper for Link, using a dummy archive
 
virtual void TagSubobjects (EObjectFlags NewFlags) override
 Tags objects that are part of the same asset with the specified object flag, used for GC checking 更多...
 

静态 Public 成员函数

static COREUOBJECT_API void DeferCppStructOps (FName Target, ICppStructOps *InCppStructOps)
 Stash a CppStructOps for future use 更多...
 

Protected 属性

bool bPrepareCppStructOpsCompleted
 true if we have performed PrepareCppStructOps
 
ICppStructOps * CppStructOps
 Holds the Cpp ctors and dtors, sizeof, etc. 更多...
 

额外继承的成员函数

- Public 属性 继承自 UStruct
FField * ChildProperties
 Pointer to start of linked list of child fields
 
UField * Children
 Pointer to start of linked list of child fields
 
FProperty * DestructorLink
 In memory only: Linked list of properties requiring destruction. 更多...
 
int32 MinAlignment
 Alignment of structure in memory, structure will be at least this large
 
FProperty * PostConstructLink
 In memory only: Linked list of properties requiring post constructor initialization
 
int32 PropertiesSize
 Total size of all UProperties, the allocated structure may be larger due to alignment
 
FProperty * PropertyLink
 In memory only: Linked list of properties from most-derived to base
 
FProperty * RefLink
 In memory only: Linked list of object reference properties from most-derived to base
 
TArray< uint8 > Script
 Script bytecode associated with this object
 
TArray< UObject * > ScriptAndPropertyObjectReferences
 Array of object references embedded in script code and referenced by FProperties. 更多...
 
FUnresolvedScriptPropertiesArray * UnresolvedScriptProperties
 Contains a list of script properties that couldn't be resolved at load time
 
const struct FUnversionedStructSchema * UnversionedSchema = nullptr
 Cached schema for optimized unversioned property serialization, owned by this.
 
- Protected 成员函数 继承自 UStruct
virtual bool ArePropertyGuidsAvailable () const
 Returns if we have access to property guids
 
virtual FGuid FindPropertyGuidFromName (const FName InName) const
 Find property guid
 
virtual FName FindPropertyNameFromGuid (const FGuid &PropertyGuid) const
 Returns the property name from the guid
 
void LoadTaggedPropertiesFromText (FStructuredArchive::FSlot Slot, uint8 *Data, UStruct *DefaultsStruct, uint8 *Defaults, const UObject *BreakRecursionIfFullyLoad) const
 Serializes list of properties to a te, using property tags to handle mismatches
 
void SerializeProperties (FArchive &Ar)
 Serializes properties of this struct
 

详细描述

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

成员函数说明

◆ ClearScriptStruct()

COREUOBJECT_API void UScriptStruct::ClearScriptStruct ( void *  Dest,
int32  ArrayDim = 1 
) const

Reinitialize a struct in memory.

This may be done by calling the native destructor and then the constructor or individually reinitializing properties

参数
DestPointer to memory to reinitialize
ArrayDimNumber of elements in the array
StrideStride of the array, only relevant if there more than one element. If this default (0), then we will pull the size from the struct

◆ CompareScriptStruct()

COREUOBJECT_API bool UScriptStruct::CompareScriptStruct ( const void *  A,
const void *  B,
uint32  PortFlags 
) const

Compare two script structs

参数
DestPointer to memory to a struct
SrcPointer to memory to the other struct
PortFlagsComparison flags
返回
true if the structs are identical

◆ CopyScriptStruct()

COREUOBJECT_API void UScriptStruct::CopyScriptStruct ( void *  Dest,
void const *  Src,
int32  ArrayDim = 1 
) const

Copy a struct over an existing struct

参数
DestPointer to memory to initialize
SrcPointer to memory to copy from
ArrayDimNumber of elements in the array
StrideStride of the array, If this default (0), then we will pull the size from the struct

◆ DeferCppStructOps()

static COREUOBJECT_API void UScriptStruct::DeferCppStructOps ( FName  Target,
ICppStructOps *  InCppStructOps 
)
static

Stash a CppStructOps for future use

参数
TargetName of the struct
InCppStructOpsCpp ops for this struct

◆ DestroyStruct()

virtual COREUOBJECT_API void UScriptStruct::DestroyStruct ( void *  Dest,
int32  ArrayDim = 1 
) const
overridevirtual

Destroy a struct in memory.

This may be done by calling the native destructor and then the constructor or individually reinitializing properties

参数
DestPointer to memory to destory
ArrayDimNumber of elements in the array
StrideStride of the array. If this default (0), then we will pull the size from the struct

重载 UStruct .

◆ ExportText()

COREUOBJECT_API void UScriptStruct::ExportText ( FString &  ValueStr,
const void *  Value,
const void *  Defaults,
UObject *  OwnerObject,
int32  PortFlags,
UObject *  ExportRootScope,
bool  bAllowNativeOverride = true 
) const

Export script struct to a string that can later be imported

参数
ValueStrString to write to
ValueActual struct being exported
DefaultsDefault value for this struct, pass nullptr to not use defaults
OwnerObjectUObject that contains this struct
PortFlagsEPropertyPortFlags controlling export behavior
ExportRootScopeThe scope to create relative paths from, if the PPF_ExportsNotFullyQualified flag is passed in. If NULL, the package containing the object will be used instead.
bAllowNativeOverrideIf true, will try to run native version of export text on the struct

◆ GetStructTypeHash()

virtual COREUOBJECT_API uint32 UScriptStruct::GetStructTypeHash ( const void *  Src) const
virtual

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

参数
SrcPointer to instance to hash
返回
hashed value of Src

◆ HasDefaults()

FORCEINLINE bool UScriptStruct::HasDefaults ( ) const
inline

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

返回
true if this struct has defaults

◆ ImportText() [1/2]

COREUOBJECT_API const TCHAR * UScriptStruct::ImportText ( const TCHAR *  Buffer,
void *  Value,
UObject *  OwnerObject,
int32  PortFlags,
FOutputDevice *  ErrorText,
const FString &  StructName,
bool  bAllowNativeOverride = true 
)

Sets value of script struct based on imported string

参数
BufferString to read text data out of
ValueStruct that will be modified
OwnerObjectUObject that contains this struct
PortFlagsEPropertyPortFlags controlling import behavior
ErrorTextWhat to print import errors to
StructNameName of struct, used in error display
bAllowNativeOverrideIf true, will try to run native version of export text on the struct
返回
Buffer after parsing has succeeded, or NULL on failure

◆ ImportText() [2/2]

COREUOBJECT_API const TCHAR * UScriptStruct::ImportText ( const TCHAR *  Buffer,
void *  Value,
UObject *  OwnerObject,
int32  PortFlags,
FOutputDevice *  ErrorText,
const TFunctionRef< FString()> &  StructNameGetter,
bool  bAllowNativeOverride = true 
)

Sets value of script struct based on imported string

参数
BufferString to read text data out of
ValueStruct that will be modified
OwnerObjectUObject that contains this struct
PortFlagsEPropertyPortFlags controlling import behavior
ErrorTextWhat to print import errors to
StructNameGetterFunction to return the struct name to avoid doing work if no error message is forthcoming
bAllowNativeOverrideIf true, will try to run native version of export text on the struct
返回
Buffer after parsing has succeeded, or NULL on failure

◆ InitializeDefaultValue()

virtual COREUOBJECT_API void UScriptStruct::InitializeDefaultValue ( uint8 *  InStructData) const
virtual

Initializes this structure to its default values

参数
InStructDataThe memory location to initialize

◆ InitializeStruct()

virtual COREUOBJECT_API void UScriptStruct::InitializeStruct ( void *  Dest,
int32  ArrayDim = 1 
) const
overridevirtual

Initialize a struct over uninitialized memory.

This may be done by calling the native constructor or individually initializing properties

参数
DestPointer to memory to initialize
ArrayDimNumber of elements in the array
StrideStride of the array, If this default (0), then we will pull the size from the struct

重载 UStruct .

◆ Serialize()

virtual COREUOBJECT_API void UScriptStruct::Serialize ( FArchive &  Ar)
overridevirtual

Handles reading, writing, and reference collecting using FArchive.

This implementation handles all FProperty serialization, but can be overridden for native variables.

重载 UStruct .

◆ SerializeItem()

COREUOBJECT_API void UScriptStruct::SerializeItem ( FArchive &  Ar,
void *  Value,
void const *  Defaults 
)

Serializes a specific instance of a struct

参数
SlotThe structured archive slot we are serializing to
ValuePointer to memory of struct
DefaultsDefault value for this struct, pass nullptr to not use defaults

◆ ShouldSerializeAtomically()

bool UScriptStruct::ShouldSerializeAtomically ( FArchive &  Ar) const
inline

Returns whether this struct should be serialized atomically.

参数
ArArchive the struct is going to be serialized with later on

类成员变量说明

◆ CppStructOps

ICppStructOps* UScriptStruct::CppStructOps
protected

Holds the Cpp ctors and dtors, sizeof, etc.

Is not owned by this and is not released.


该类的文档由以下文件生成: