Navigation
API > API/Plugins > API/Plugins/DataRegistry
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.
| Name | FDataRegistryType |
| Type | struct |
| Header File | /Engine/Plugins/Runtime/DataRegistry/Source/DataRegistry/Public/DataRegistryId.h |
| Include Path | #include "DataRegistryId.h" |
Syntax
USTRUCT (BlueprintType )
struct FDataRegistryType
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Constructors, one for each FName constructor | DataRegistryId.h | ||
FDataRegistryType
(
FName InName |
DataRegistryId.h | ||
FDataRegistryType
(
EName InName |
DataRegistryId.h | ||
FDataRegistryType
(
const WIDECHAR* InName |
DataRegistryId.h | ||
FDataRegistryType
(
const ANSICHAR* InName |
DataRegistryId.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| CustomContextType | const FDataRegistryType | 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 | DataRegistryId.h |
| ItemStructMetaData | const FName | MetaData tag for both Type and Id that is used to restrict available registries to a certain item struct base class, ex. | DataRegistryId.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool ExportTextItem
(
FString& ValueStr, |
UStruct Overrides | DataRegistryId.h | |
FName GetName() |
Returns internal Name explicitly, not normally needed | DataRegistryId.h | |
bool ImportTextItem
(
const TCHAR*& Buffer, |
DataRegistryId.h | ||
bool IsValid() |
Returns true if this is a valid Type | DataRegistryId.h | |
bool SerializeFromMismatchedTag
(
FPropertyTag const& Tag, |
DataRegistryId.h | ||
FString ToString() |
Returns string version of this Type | DataRegistryId.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator const FName &() |
DataRegistryId.h | ||
operator FName &() |
Implicitly convert to FName | DataRegistryId.h | |
bool operator!=
(
const FDataRegistryType& Other |
DataRegistryId.h | ||
bool operator==
(
const FDataRegistryType& Other |
DataRegistryId.h |