![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <LruCache.h>
Classes | |
| class | TBaseIterator |
| class | TConstIterator |
| class | TIterator |
Public Member Functions | |
| TLruCache () | |
| TLruCache (int32 InMaxNumElements) | |
| ~TLruCache () | |
| void | Add (const KeyType &Key, const ValueType &Value) |
| ValueType & | AddUninitialized_GetRef (const KeyType &Key) |
| UE_FORCEINLINE_HINT bool | Contains (const KeyType &Key) const |
| template<typename Predicate > | |
| bool | ContainsByPredicate (Predicate Pred) const |
| void | Empty (int32 InMaxNumElements=0) |
| template<typename Predicate > | |
| TArray< ValueType > | FilterByPredicate (Predicate Pred) const |
| const ValueType * | Find (const KeyType &Key) const |
| ValueType * | Find (const KeyType &Key) |
| const ValueType & | FindChecked (const KeyType &Key) const |
| ValueType & | FindChecked (const KeyType &Key) |
| ValueType | FindRef (const KeyType &Key) const |
| ValueType * | FindAndTouch (const KeyType &Key) |
| ValueType & | FindAndTouchChecked (const KeyType &Key) |
| ValueType | FindAndTouchRef (const KeyType &Key) |
| template<typename Predicate > | |
| const ValueType * | FindByPredicate (Predicate Pred) const |
| void | GetKeys (TArray< KeyType > &OutKeys) const |
| UE_FORCEINLINE_HINT int32 | Max () const |
| bool | IsEmpty () const |
| UE_FORCEINLINE_HINT int32 | Num () const |
| void | Remove (const KeyType &Key) |
| template<typename Predicate > | |
| int32 | RemoveByPredicate (Predicate Pred) |
| ValueType | RemoveLeastRecent () |
| KeyType | GetLeastRecentKey () const |
| TIterator | begin () |
| TConstIterator | begin () const |
| TIterator | end () |
| TConstIterator | end () const |
Protected Member Functions | |
| void | MarkAsRecent (FCacheEntry &Entry) |
| void | Remove (FCacheEntry *Entry) |
Implements a Least Recently Used (LRU) cache.
| KeyType | The type of cache entry keys. |
| ValueType | The type of cache entry values. |
| KeyFuncs | Optional functions for comparing keys in the lookup set (see BaseKeyFuncs in Set.h). |
|
inline |
Default constructor (empty cache that cannot hold any values).
|
inline |
Create and initialize a new instance.
| InMaxNumElements | The maximum number of elements this cache can hold. |
|
inline |
Add an entry to the cache.
If an entry with the specified key already exists in the cache, the value of the existing entry will be updated. The added or updated entry will be marked as the most recently used one.
| Key | The entry's lookup key. |
| Value | The entry's value. |
|
inline |
Add an entry to the cache.
If an entry with the specified key already exists in the cache, the value of the existing entry will be returned. The added or updated entry will be marked as the most recently used one.
| Key | The entry's lookup key. |
|
inline |
|
inline |
Check whether an entry with the specified key is in the cache.
| Key | The key of the entry to check. |
|
inline |
Check whether an entry for which a predicate returns true is in the cache.
| Pred | The predicate functor to apply to each entry. |
|
inline |
|
inline |
Filter the entries in the cache using a predicate.
| Pred | The predicate functor to apply to each entry. |
|
inline |
Find the value of the entry with the specified key and mark it as the most recently used.
| Key | The key of the entry to get. |
Find the value of the entry with the specified key and mark it as the most recently used.
| Key | The key of the entry to get. |
|
inline |
Find the value of an entry using a predicate.
| Pred | The predicate functor to apply to each entry. |
Find the value of the entry with the specified key.
| Key | The key of the entry to get. |
|
inline |
Find the value of the entry with the specified key.
| Key | The key of the entry to get. |
Find the value of the entry with the specified key.
| Key | The key of the entry to get. |
Return the least recent element key from the cache.
Returns true if the cache is empty and contains no elements.
Mark the given entry as recently used.
| Entry | The entry to mark. |
|
inline |
|
inline |
Remove all entries with the specified key from the cache.
| Key | The key of the entries to remove. |
Remove the specified entry from the cache.
| Entry | The entry to remove. |
|
inline |
Remove all entries using a predicate.
| Pred | The predicate function to apply to each entry. |
Remove and return the least recent element from the cache.