UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRuntimeAssetCacheInterface Class Referenceabstract

#include <RuntimeAssetCacheInterface.h>

+ Inheritance diagram for FRuntimeAssetCacheInterface:

Public Member Functions

virtual ~FRuntimeAssetCacheInterface ()
 
virtual FVoidPtrParam GetSynchronous (IRuntimeAssetCacheBuilder *CacheBuilder)=0
 
virtual int32 GetAsynchronous (IRuntimeAssetCacheBuilder *CacheBuilder, const FOnRuntimeAssetCacheAsyncComplete &OnCompletionDelegate)=0
 
virtual int32 GetAsynchronous (IRuntimeAssetCacheBuilder *CacheBuilder)=0
 
virtual int32 GetCacheSize (FName Bucket) const =0
 
virtual bool ClearCache ()=0
 
virtual bool ClearCache (FName Bucket)=0
 
virtual void WaitAsynchronousCompletion (int32 Handle)=0
 
virtual FVoidPtrParam GetAsynchronousResults (int32 Handle)=0
 
virtual bool PollAsynchronousCompletion (int32 Handle)=0
 
virtual void AddToAsyncCompletionCounter (int32 Addend)=0
 
virtual void Tick ()=0
 

Detailed Description

Interface for the Runtime Asset Cache. Cache is split into buckets to cache various assets separately. Bucket names and maximum sizes are configure via Engine.ini config file using the following syntax [RuntimeAssetCache] +BucketConfigs=(Name="<Plugin name>", Size=<Maximum bucket size in bytes>) This API is fully thread safe.

Constructor & Destructor Documentation

◆ ~FRuntimeAssetCacheInterface()

virtual FRuntimeAssetCacheInterface::~FRuntimeAssetCacheInterface ( )
inlinevirtual

Member Function Documentation

◆ AddToAsyncCompletionCounter()

virtual void FRuntimeAssetCacheInterface::AddToAsyncCompletionCounter ( int32  Addend)
pure virtual

Adds a number from the thread safe counter which tracks outstanding async requests. This is used to ensure everything is complete prior to shutdown.

Parameters
Valueto add to counter. Can be negative.

Implemented in FRuntimeAssetCache.

◆ ClearCache() [1/2]

virtual bool FRuntimeAssetCacheInterface::ClearCache ( )
pure virtual

Removes all cache entries.

Returns
true if cache was successfully cleaned.

Implemented in FRuntimeAssetCache.

◆ ClearCache() [2/2]

virtual bool FRuntimeAssetCacheInterface::ClearCache ( FName  Bucket)
pure virtual

Removes all cache from given bucket.

Parameters
BucketBucket to clean.
Returns
true if cache was successfully cleaned.

Implemented in FRuntimeAssetCache.

◆ GetAsynchronous() [1/2]

virtual int32 FRuntimeAssetCacheInterface::GetAsynchronous ( IRuntimeAssetCacheBuilder CacheBuilder)
pure virtual

Asynchronously checks the cache. If value is not found, builds entry using CacheBuilder and updates cache.

Parameters
CacheBuilderBuilder to produce cache key and in the event of a miss, return the data.
Returns
Handle to worker.

Implemented in FRuntimeAssetCache.

◆ GetAsynchronous() [2/2]

virtual int32 FRuntimeAssetCacheInterface::GetAsynchronous ( IRuntimeAssetCacheBuilder CacheBuilder,
const FOnRuntimeAssetCacheAsyncComplete OnCompletionDelegate 
)
pure virtual

Asynchronously checks the cache. If value is not found, builds entry using CacheBuilder and updates cache.

Parameters
CacheBuilderBuilder to produce cache key and in the event of a miss, return the data.
OnCompletionDelegateDelegate to call when cache is ready. Delegate is called on main thread.
Returns
Handle to worker.

Implemented in FRuntimeAssetCache.

◆ GetAsynchronousResults()

virtual FVoidPtrParam FRuntimeAssetCacheInterface::GetAsynchronousResults ( int32  Handle)
pure virtual

Gets asynchronous query results.

Parameters
HandleWorker handle to check.
Returns
Pointer to retrieved cache entry, nullptr on fail. Fail occurs only when
  • there's no entry in cache and CacheBuilder is nullptr or
  • CacheBuilder returned nullptr

Implemented in FRuntimeAssetCache.

◆ GetCacheSize()

virtual int32 FRuntimeAssetCacheInterface::GetCacheSize ( FName  Bucket) const
pure virtual

Gets cache size.

Parameters
Bucketto check.
Returns
Maximum allowed bucket size.

Implemented in FRuntimeAssetCache.

◆ GetSynchronous()

virtual FVoidPtrParam FRuntimeAssetCacheInterface::GetSynchronous ( IRuntimeAssetCacheBuilder CacheBuilder)
pure virtual

Synchronously gets value from cache. If value is not found, builds entry using CacheBuilder and updates cache.

Parameters
CacheBuilderBuilder to produce cache key and in the event of a miss.
Returns
Pointer to retrieved cache entry, nullptr on fail. Fail occurs only when
  • there's no entry in cache and CacheBuilder is nullptr or
  • CacheBuilder returned nullptr

Implemented in FRuntimeAssetCache.

◆ PollAsynchronousCompletion()

virtual bool FRuntimeAssetCacheInterface::PollAsynchronousCompletion ( int32  Handle)
pure virtual

Checks if worker finished execution.

Parameters
HandleWorker handle to check.
Returns
True if execution finished, false otherwise.

Implemented in FRuntimeAssetCache.

◆ Tick()

virtual void FRuntimeAssetCacheInterface::Tick ( )
pure virtual

Ticks async thread.

Implemented in FRuntimeAssetCache.

◆ WaitAsynchronousCompletion()

virtual void FRuntimeAssetCacheInterface::WaitAsynchronousCompletion ( int32  Handle)
pure virtual

Waits until worker finishes execution.

Parameters
HandleWorker handle to wait for.

Implemented in FRuntimeAssetCache.


The documentation for this class was generated from the following file: