Navigation
API > API/Plugins > API/Plugins/DataRegistry
Defines a place to efficiently store and retrieve structure data, can be used as a wrapper around Data/Curve Tables or extended with other sources
| Name | UDataRegistry |
| Type | class |
| Header File | /Engine/Plugins/Runtime/DataRegistry/Source/DataRegistry/Public/DataRegistry.h |
| Include Path | #include "DataRegistry.h" |
Syntax
UCLASS (MinimalAPI)
class UDataRegistry : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UDataRegistry
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UDataRegistry() |
DataRegistry.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~UDataRegistry() |
DataRegistry.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsInitialized | bool | True if this registry has been initialized and is expected to respond to requests | DataRegistry.h | |
| bNeedsRuntimeRefresh | bool | True if this registry needs a runtime refresh due to asset changes | DataRegistry.h | |
| Cache | FDataRegistryCache * | Internal cache data, can't use TUniquePtr due to UObject weirdness | DataRegistry.h | |
| UpdateTimer | FTimerHandle | DataRegistry.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool AcquireItem
(
const FDataRegistryId& ItemId, |
Start an async request for a single item | DataRegistry.h | |
virtual void ApplyCachePolicy() |
Applies the cache policy, is called regularly but can be manually executed | DataRegistry.h | |
virtual bool BatchAcquireItems
(
const TArray< FDataRegistryId >& ItemIds, |
Start an async request for multiple items | DataRegistry.h | |
virtual bool BatchAcquireSourceItems
(
TArray< FDataRegistrySourceItemId >& SourceItems, |
Request a list of source items | DataRegistry.h | |
virtual void Deinitialize() |
Disable access and restore to state before initialization, won't do anything if not initialized | DataRegistry.h | |
virtual bool DidRegisterAssetResultCauseChange
(
EDataRegistryRegisterAssetResult RegisterAssetStatus |
Use this to confirm that a DataRegistryRegisterAssetResult caused a change to the Data Registry. | DataRegistry.h | |
bool DoesItemStructMatchFilter
(
FName FilterStructName |
Returns true if this registry struct inherits from a particular named struct | DataRegistry.h | |
virtual void EditorRefreshRegistry() |
Validate and refresh registration | DataRegistry.h | |
void ForEachCachedItem
(
const FString& ContextString, |
Method to run the given predicate on all items | DataRegistry.h | |
virtual FDataRegistryCacheGetResult GetAllCachedItems
(
TMap< FDataRegistryId, const uint8* >& OutItemMap, |
Fills in a map with all cached (and precached) ids and items for fast iteration. | DataRegistry.h | |
void GetAllItems
(
const TCHAR* ContextString, |
Method to get all items in the registry | DataRegistry.h | |
virtual void GetAllSourceItems
(
TArray< FDataRegistrySourceItemId >& OutSourceItems |
Returns all source ids for editor display | DataRegistry.h | |
virtual FDataRegistryCacheGetResult GetCachedCurveRaw
(
const FRealCurve*& OutCurve, |
Curve wrapper for get function | DataRegistry.h | |
const T * GetCachedItem
(
const FDataRegistryId& ItemId |
Finds the cached item, using the request context to handle remapping | DataRegistry.h | |
virtual FDataRegistryCacheGetResult GetCachedItemRaw
(
const uint8*& OutItemMemory, |
Returns the raw cached data and struct type, useful for generic C++ calls | DataRegistry.h | |
virtual FDataRegistryCacheGetResult GetCachedItemRawFromLookup
(
const uint8*& OutItemMemory, |
Finds the cached item using a resolved lookup, this can be useful after a load has happened to ensure you get the exact item requested | DataRegistry.h | |
virtual FDataRegistryCacheGetResult GetCacheResultVersion() |
Returns the current cache version for a successful get, may change depending on stack-specific resolve settings | DataRegistry.h | |
virtual void GetChildRuntimeSources
(
UDataRegistrySource* ParentSource, |
Gets list of child runtime sources created by passed in source, in order registered | DataRegistry.h | |
const FDataRegistryIdFormat & GetIdFormat() |
Gets the formatting for this Id | DataRegistry.h | |
| Method to get all item names in teh registry | DataRegistry.h | ||
const UScriptStruct * GetItemStruct() |
Returns the struct used by this registry, everything returned will be this or a subclass | DataRegistry.h | |
virtual EDataRegistryAvailability GetLowestAvailability() |
Returns the worst availability for anything stored in this registry, if this is Precached then this registry is a wrapper around already loaded data | DataRegistry.h | |
virtual void GetPossibleRegistryIds
(
TArray< FDataRegistryId >& OutRegistryIds, |
Fills in a list of all item ids provided by this registry, sorted for display | DataRegistry.h | |
virtual FText GetRegistryDescription() |
Gets a human readable summary of registry, for UI usage | DataRegistry.h | |
const FName GetRegistryType() |
Returns the name for type exposed by this registry | DataRegistry.h | |
const FDataRegistryCachePolicy & GetRuntimeCachePolicy() |
Gets the current general cache policy | DataRegistry.h | |
int32 GetSourceIndex
(
const UDataRegistrySource* Source, |
Returns the index of a source in the source list | DataRegistry.h | |
virtual void HandleAcquireResult
(
const FDataRegistrySourceAcquireRequest& Request, |
Call to indicate that a item is available, will insert into cache | DataRegistry.h | |
virtual bool Initialize() |
Initialize for requests, called when subsystem starts up and should return true on success | DataRegistry.h | |
virtual void InvalidateCacheVersion() |
Bump the cache version from some external event like game-specific file loading | DataRegistry.h | |
virtual bool IsCacheGetResultValid
(
FDataRegistryCacheGetResult Result |
Checks if a previous cached get is still valid | DataRegistry.h | |
virtual bool IsInitialized() |
Returns true if this state has been initialized for use | DataRegistry.h | |
virtual UDataRegistrySource * LookupSource
(
FName& OutResolvedName, |
Find the source associated with a lookup index | DataRegistry.h | |
virtual void MarkRuntimeDirty() |
Marks this registry for needing a runtime refresh at next opportunity | DataRegistry.h | |
virtual FDataRegistryCacheVersionCallback & OnCacheVersionInvalidated() |
Accesses the delegate called when cache version changes | DataRegistry.h | |
virtual EDataRegistryRegisterAssetResult RegisterSpecificAsset
(
const FAssetData& AssetData, |
Attempt to register a specified asset with a source, returns an EDataRegistryRegisterAssetResult, indicating whether the asset was registered or not. | DataRegistry.h | |
virtual void ResetRuntimeState() |
Reset caches and state because gameplay finished due to PIE shutting down or the game registering a return to main menu, but stay initialized for future use | DataRegistry.h | |
virtual bool ResolveDataRegistryId
(
FDataRegistryLookup& OutLookup, |
Resolves an item id into a specific source and unique id, this can remap the names using game-specific rules. | DataRegistry.h | |
virtual void RuntimeRefreshIfNeeded() |
Conditionally refresh the runtime state if needed | DataRegistry.h | |
void SetRuntimeCachePolicy
(
const FDataRegistryCachePolicy& NewPolicy |
Sets the current cache policy, could cause items to get released | DataRegistry.h | |
virtual int32 UnregisterAssetsWithPriority
(
int32 AssetPriority |
Unregisters all previously registered assets in a specific registry with a specific priority, can be used as a batch reset. | DataRegistry.h | |
virtual bool UnregisterSpecificAsset
(
const FSoftObjectPath& AssetPath |
Removes references to a specific asset, returns bool if it was removed | DataRegistry.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
DataRegistry.h | ||
| DataRegistry.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool AcquireItemInternal
(
const FDataRegistryId& ItemId, |
Start an async request | DataRegistry.h | |
virtual void AddAllIdsForResolvedName
(
TSet< FDataRegistryId >& PossibleIds, |
Adds all possible source ids for resolved name to set, regardless of request context, default just uses the name | DataRegistry.h | |
virtual void DelayedHandleSuccessCallbacks
(
FDataRegistryLookup Lookup |
Frame-delayed callback to call success for already loaded items | DataRegistry.h | |
const FCachedDataRegistryItem * FindCachedData
(
const FDataRegistryId& ItemId, |
Returns internal cached data or raw memory ptr for precached data | DataRegistry.h | |
virtual void HandleAcquireCallbacks
(
const FDataRegistryLookup& Lookup, |
Handle sending completion/error callbacks | DataRegistry.h | |
virtual void HandleCacheEntryState
(
const FDataRegistryLookup& Lookup, |
Advances state machine for a cached entry | DataRegistry.h | |
virtual FName MapIdToResolvedName
(
const FDataRegistryId& ItemId, |
Maps from a type:name pair to a per-source resolved name, default just returns the name | DataRegistry.h | |
virtual void RefreshRuntimeSources() |
Refresh the RuntimeSources list | DataRegistry.h | |
virtual void TimerUpdate() |
Called on timer tick when initialized | DataRegistry.h | |
virtual void UpdateBatchRequest
(
const FDataRegistryRequestId& RequestId, |
Check on any batch requests that need processing, if filter is empty will process all | DataRegistry.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
DataRegistry.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void AddReferencedObjects
(
UObject* InThis, |
DataRegistry.h | ||
static float GetCurrentTime() |
Gets the current time | DataRegistry.h | |
static FTimerManager * GetTimerManager () |
Returns a timer manager that is safe to use for asset loading actions. | DataRegistry.h |