UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FRuntimeAssetCacheBucket Class Reference

#include <RuntimeAssetCacheBucket.h>

Public Member Functions

 FRuntimeAssetCacheBucket ()
 
 FRuntimeAssetCacheBucket (int32 InSize)
 
 ~FRuntimeAssetCacheBucket ()
 
int32 GetSize () const
 
void Reset ()
 
FCacheEntryMetadataGetMetadata (const FString &Key)
 
void RemoveMetadataEntry (const FString &Key, bool bBuildFailed=false)
 
void AddMetadataEntry (const FString &Key, FCacheEntryMetadata *Value, bool bUpdateSize)
 
int32 GetCurrentSize ()
 
void AddToCurrentSize (int32 Value)
 
FCacheEntryMetadataGetOldestEntry ()
 

Static Public Attributes

static const int32 DefaultBucketSize = 5 * 1024 * 1024
 

Friends

class FRuntimeAssetCacheBucketScopeLock
 

Detailed Description

Holds data about cache entries.

Constructor & Destructor Documentation

◆ FRuntimeAssetCacheBucket() [1/2]

FRuntimeAssetCacheBucket::FRuntimeAssetCacheBucket ( )
inline

Default constructor.

◆ FRuntimeAssetCacheBucket() [2/2]

FRuntimeAssetCacheBucket::FRuntimeAssetCacheBucket ( int32  InSize)
inline

Constructor

Parameters
InSizeSize of bucket in bytes.

◆ ~FRuntimeAssetCacheBucket()

FRuntimeAssetCacheBucket::~FRuntimeAssetCacheBucket ( )

Destructor.

Member Function Documentation

◆ AddMetadataEntry()

void FRuntimeAssetCacheBucket::AddMetadataEntry ( const FString &  Key,
FCacheEntryMetadata Value,
bool  bUpdateSize 
)

Adds metadata entry for given key.

Parameters
KeyKey to add metadata for.
ValueMetadata to add. If there is an entry for given key, it gets overwritten.
bUpdateSizeIf true, function will update current size of bucket. Otherwise, it's up to caller.

If overwriting, keep proper record of used cache size.

◆ AddToCurrentSize()

void FRuntimeAssetCacheBucket::AddToCurrentSize ( int32  Value)
inline

Adds to number of bytes used in cache so far.

Parameters
ValueNumber of bytes to add. Can be negative.

◆ GetCurrentSize()

int32 FRuntimeAssetCacheBucket::GetCurrentSize ( )
inline

Gets number of bytes used in cache so far.

◆ GetMetadata()

FCacheEntryMetadata * FRuntimeAssetCacheBucket::GetMetadata ( const FString &  Key)

Gets metadata entry for given key.

Parameters
KeyKey to get metadata for.
Returns
Metadata for given key. Default value if Key is not found.

◆ GetOldestEntry()

FCacheEntryMetadata * FRuntimeAssetCacheBucket::GetOldestEntry ( )

Gets oldest metadata entry in cache.

Returns
Oldest metadata entry.

◆ GetSize()

int32 FRuntimeAssetCacheBucket::GetSize ( ) const
inline

Gets size in bytes of the bucket.

◆ RemoveMetadataEntry()

void FRuntimeAssetCacheBucket::RemoveMetadataEntry ( const FString &  Key,
bool  bBuildFailed = false 
)

Removes metadata entry for given key.

Parameters
KeyKey to remove metadata for.
bBuildFailedIndicates that building cache entry failed and some checks should be skipped.

◆ Reset()

void FRuntimeAssetCacheBucket::Reset ( )

Cleans up all metadata entries.

Friends And Related Symbol Documentation

◆ FRuntimeAssetCacheBucketScopeLock

Helper friend class to guard critical sections on scope basis.

Member Data Documentation

◆ DefaultBucketSize

const int32 FRuntimeAssetCacheBucket::DefaultBucketSize = 5 * 1024 * 1024
static

Default size of bucket in case it wasn't specified in config.


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