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