UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRuntimeAssetCache Class Referencefinal

#include <RuntimeAssetCache.h>

+ Inheritance diagram for FRuntimeAssetCache:

Public Member Functions

virtual FVoidPtrParam GetSynchronous (IRuntimeAssetCacheBuilder *CacheBuilder) override
 
virtual int32 GetAsynchronous (IRuntimeAssetCacheBuilder *CacheBuilder, const FOnRuntimeAssetCacheAsyncComplete &OnCompletionDelegate) override
 
virtual int32 GetAsynchronous (IRuntimeAssetCacheBuilder *CacheBuilder) override
 
virtual int32 GetCacheSize (FName Bucket) const override
 
virtual bool ClearCache () override
 
virtual bool ClearCache (FName Bucket) override
 
virtual void WaitAsynchronousCompletion (int32 Handle) override
 
virtual FVoidPtrParam GetAsynchronousResults (int32 Handle) override
 
virtual bool PollAsynchronousCompletion (int32 Handle) override
 
virtual void AddToAsyncCompletionCounter (int32 Addend) override
 
virtual void Tick () override
 
 FRuntimeAssetCache ()
 
 ~FRuntimeAssetCache ()
 
- Public Member Functions inherited from FRuntimeAssetCacheInterface
virtual ~FRuntimeAssetCacheInterface ()
 

Detailed Description

Concrete class implementing FRuntimeAssetCacheInterface.

Constructor & Destructor Documentation

◆ FRuntimeAssetCache()

FRuntimeAssetCache::FRuntimeAssetCache ( )

End of FRuntimeAssetCacheInterface implementation Constructor

◆ ~FRuntimeAssetCache()

FRuntimeAssetCache::~FRuntimeAssetCache ( )

Destructor

Member Function Documentation

◆ AddToAsyncCompletionCounter()

void FRuntimeAssetCache::AddToAsyncCompletionCounter ( int32  Addend)
overridevirtual

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.

Implements FRuntimeAssetCacheInterface.

◆ ClearCache() [1/2]

bool FRuntimeAssetCache::ClearCache ( )
overridevirtual

Removes all cache entries.

Returns
true if cache was successfully cleaned.

Tell backend to clean itself up.

If backend is cleaned up, clean up all buckets.

Implements FRuntimeAssetCacheInterface.

◆ ClearCache() [2/2]

bool FRuntimeAssetCache::ClearCache ( FName  Bucket)
overridevirtual

Removes all cache from given bucket.

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

Tell backend to clean bucket up.

If backend is cleaned up, clean up all buckets.

Implements FRuntimeAssetCacheInterface.

◆ GetAsynchronous() [1/2]

int32 FRuntimeAssetCache::GetAsynchronous ( IRuntimeAssetCacheBuilder CacheBuilder)
overridevirtual

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.

Implements FRuntimeAssetCacheInterface.

◆ GetAsynchronous() [2/2]

int32 FRuntimeAssetCache::GetAsynchronous ( IRuntimeAssetCacheBuilder CacheBuilder,
const FOnRuntimeAssetCacheAsyncComplete OnCompletionDelegate 
)
overridevirtual

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.

Must return a valid handle

Make sure task isn't processed twice.

Implements FRuntimeAssetCacheInterface.

◆ GetAsynchronousResults()

FVoidPtrParam FRuntimeAssetCache::GetAsynchronousResults ( int32  Handle)
overridevirtual

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

Implements FRuntimeAssetCacheInterface.

◆ GetCacheSize()

int32 FRuntimeAssetCache::GetCacheSize ( FName  Bucket) const
overridevirtual

Gets cache size.

Parameters
Bucketto check.
Returns
Maximum allowed bucket size.

Implements FRuntimeAssetCacheInterface.

◆ GetSynchronous()

FVoidPtrParam FRuntimeAssetCache::GetSynchronous ( IRuntimeAssetCacheBuilder CacheBuilder)
overridevirtual

◆ PollAsynchronousCompletion()

bool FRuntimeAssetCache::PollAsynchronousCompletion ( int32  Handle)
overridevirtual

Checks if worker finished execution.

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

Implements FRuntimeAssetCacheInterface.

◆ Tick()

void FRuntimeAssetCache::Tick ( )
overridevirtual

Ticks async thread.

Implements FRuntimeAssetCacheInterface.

◆ WaitAsynchronousCompletion()

void FRuntimeAssetCache::WaitAsynchronousCompletion ( int32  Handle)
overridevirtual

Waits until worker finishes execution.

Parameters
HandleWorker handle to wait for.

Implements FRuntimeAssetCacheInterface.


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