Navigation
API > API/Runtime > API/Runtime/RHI
Implements a Least Recently Used (LRU) cache.
| Name | TPsoLruCache |
| Type | class |
| Header File | /Engine/Source/Runtime/RHI/Public/PsoLruCache.h |
| Include Path | #include "PsoLruCache.h" |
Syntax
template<typename KeyType, typename ValueType>
class TPsoLruCache
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TPsoLruCache () |
Default constructor (empty cache that cannot hold any values). | PsoLruCache.h | |
TPsoLruCache
(
int32 InMaxNumElements |
Create and initialize a new instance. | PsoLruCache.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TPsoLruCache() |
Destructor. | PsoLruCache.h |
Classes
| Name | Remarks |
|---|---|
| TBaseIterator | Base class for cache iterators.Iteration begins at the most recent entry. |
| TConstIterator | Cache iterator (const). |
| TIterator | Cache iterator. |
Structs
| Name | Remarks |
|---|---|
| FCacheEntry | An entry in the LRU cache. |
| FKeyFuncs | Lookup set key functions. |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| LeastRecent | FCacheEntry * | Least recent item in the cache. | PsoLruCache.h | |
| LookupSet | TSet< FCacheEntry *, FKeyFuncs > | Set of entries for fast lookup. | PsoLruCache.h | |
| MaxNumElements | int32 | Maximum number of elements in the cache. | PsoLruCache.h | |
| MostRecent | FCacheEntry * | Most recent item in the cache. | PsoLruCache.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FSetElementId Add
(
const KeyType& Key, |
Add an entry to the cache. | PsoLruCache.h | |
bool Contains
(
const KeyType& Key |
Check whether an entry with the specified key is in the cache. | PsoLruCache.h | |
bool ContainsByPredicate
(
Predicate Pred |
Check whether an entry for which a predicate returns true is in the cache. | PsoLruCache.h | |
void Empty
(
int32 InMaxNumElements |
Empty the cache. | PsoLruCache.h | |
TArray< ValueType > FilterByPredicate
(
Predicate Pred |
Filter the entries in the cache using a predicate. | PsoLruCache.h | |
const ValueType * Find
(
const KeyType& Key |
Find the value of the entry with the specified key. | PsoLruCache.h | |
const ValueType * FindAndTouch
(
const KeyType& Key |
Find the value of the entry with the specified key and mark it as the most recently used. | PsoLruCache.h | |
const ValueType * FindByPredicate
(
Predicate Pred |
Find the value of an entry using a predicate. | PsoLruCache.h | |
void GetKeys
(
TArray< KeyType >& OutKeys |
Find the keys of all cached entries. | PsoLruCache.h | |
const ValueType GetLeastRecent() |
Return the least recent element from the cache. | PsoLruCache.h | |
void MarkAsRecent
(
const FSetElementId& LRUNode |
PsoLruCache.h | ||
int32 Max () |
Get the maximum number of entries in the cache. | PsoLruCache.h | |
int32 Num () |
Get the number of entries in the cache. | PsoLruCache.h | |
void Remove
(
const KeyType& Key |
Remove all entries with the specified key from the cache. | PsoLruCache.h | |
bool Remove
(
const KeyType& Key, |
PsoLruCache.h | ||
int32 RemoveByPredicate
(
Predicate Pred |
Remove all entries using a predicate. | PsoLruCache.h | |
ValueType RemoveLeastRecent() |
Remove and return the least recent element from the cache. | PsoLruCache.h | |
ValueType RemoveMostRecent() |
Remove and return the most recent element from the cache. | PsoLruCache.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void MarkAsRecent
(
FCacheEntry& Entry |
Mark the given entry as recently used. | PsoLruCache.h | |
void Remove
(
FCacheEntry* Entry |
Remove the specified entry from the cache. | PsoLruCache.h |