FDataRegistryType

A DataRegistry item is an arbitrary USTRUCT representing a specific piece of data, that can be acquired from many possible sources, cached, and returned to requesting code.

Windows
MacOS
Linux

References

Module

DataRegistry

Header

/Engine/Plugins/Runtime/DataRegistry/Source/DataRegistry/Public/DataRegistryId.h

Include

#include "DataRegistryId.h"

Syntax

[USTRUCT](Programming/UnrealArchitecture/Reference/Structs)([BlueprintType](Programming/UnrealArchitecture/Reference/Structs/Specifiers/BlueprintType))
struct FDataRegistryType

Remarks

A DataRegistry item is an arbitrary USTRUCT representing a specific piece of data, that can be acquired from many possible sources, cached, and returned to requesting code. It is similar in concept to a DataTable Row, and will often literally be one.

Here is the asynchronous data flow to go from DataRegistryId to a DataRegistryItem:

DataRegistryId is constructed with either a special editor customization or at runtime. Can be a gameplay tag or raw name

User tells DataRegistrySubsystem to start an async request to fetch a DataRegistryItem using the Id, and passes in a context object

Subsystem finds the right DataRegistry by looking at the type and forwards the request

Registry resolves the id into DataRegistryLookup using the context object and game specific logic (ex: converts tag Banner.Foo.Bar into Foo_Bar in a local datatable)

Registry looks in its cache for that lookup, if it is found and valid then it schedules success callback for next frame

If not found in cache, use lookup to search DataRegistrySources in order

Source looks for item, if finding it requires loading an asset or accessing the internet this may take a long time

If source fails to find item, try next source until exhausted. If all exhausted, schedule failure callback

If source finds item, cache found result into Registry, then schedule success callback

Once asset is in cache due to previous async call or always loaded assets, it can be accessed directly via the subsystem cache get functions Wrapper struct to represent a global data registry, represented as an FName internally and implicitly convertible back and forth. This exists so the blueprint API can understand it's not a normal FName.

Variables

Name Description

Protected variable UProperty Category, EditAnywhere BlueprintReadWrite SaveGame

FName

 

Name

The FName representing this type

Constructors

Name Description

Public function

FDataRegistryType()

Constructors, one for each FName constructor

Public function

FDataRegistryType

(
    FName InName
)

Public function

FDataRegistryType

(
    EName InName
)

Public function

FDataRegistryType

(
    const WIDECHAR* InName
)

Public function

FDataRegistryType

(
    const ANSICHAR* InName
)

Functions

Name Description

Public function Const

bool

 

ExportTextItem

(
    FString& ValueStr,
    FDataRegistryType const& DefaultVa...,
    UObject* Parent,
    int32 PortFlags,
    UObject* ExportRootScope
)

UStruct Overrides

Public function Const

FName

 

GetName()

Returns internal Name explicitly, not normally needed

Public function

bool

 

ImportTextItem

(
    const TCHAR*& Buffer,
    int32 PortFlags,
    UObject* Parent,
    FOutputDevice* ErrorText
)

Public function Const

bool

 

IsValid()

Returns true if this is a valid Type

Public function

bool

 

SerializeFromMismatchedTag

(
    FPropertyTag const& Tag,
    FStructuredArchive::FSlot Slot
)

Public function Const

FString

 

ToString()

Returns string version of this Type

Operators

Name Description

Public function Const

 

operator const FName &()

Public function

 

operator FName &()

Implicitly convert to FName

Public function Const

bool

 

operator!=

(
    const FDataRegistryType& Other
)

Public function

FDataRegistr...

 

operator=

(
    const FDataRegistryType& Other
)

Public function Const

bool

 

operator==

(
    const FDataRegistryType& Other
)

Constants

Name

Description

CustomContextType

Fake type that can be used in the picker UI to specify that the Id contains a context-specific name that will be interpreted later

ItemStructMetaData

MetaData tag for both Type and Id that is used to restrict available registries to a certain item struct base class, ex.

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