Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Containers
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Containers/LruCache.h |
| Include | #include "Containers/LruCache.h" |
Syntax
template<typename KeyType, typename ValueType, typename KeyComp>
class TLruCache
Remarks
Implements a Least Recently Used (LRU) cache.
Constructors
| Type | Name | Description | |
|---|---|---|---|
TLruCache () |
Default constructor (empty cache that cannot hold any values). | ||
| Create and initialize a new instance. |
Destructors
| Type | Name | Description | |
|---|---|---|---|
~TLruCache () |
Destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | Add
(
const KeyType& Key, |
Add an entry to the cache. | |
| ValueType & | AddUninitialized_GetRef
(
const KeyType& Key |
Add an entry to the cache. | |
| TConstIterator | begin () |
||
| TIterator | begin () |
||
| 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. | ||
| TConstIterator | end () |
||
| TIterator | end () |
||
| TArray< ValueType > | FilterByPredicate
(
Predicate Pred |
Filter the entries in the cache using a predicate. | |
| ValueType * | Find
(
const KeyType& Key |
Find the value of the entry with the specified key. | |
| 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 & | FindAndTouchChecked
(
const KeyType& Key |
Find the value of the entry with the specified key and mark it as the most recently used. | |
| ValueType | FindAndTouchRef
(
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. | |
| const ValueType & | FindChecked
(
const KeyType& Key |
Find the value of the entry with the specified key. | |
| ValueType | FindRef
(
const KeyType& Key |
Find the value of the entry with the specified key. | |
| void | Find the keys of all cached entries. | ||
| bool | IsEmpty () |
Returns true if the cache is empty and contains no elements. | |
| void | MarkAsRecent
(
FCacheEntry& Entry |
Mark the given entry as recently used. | |
| 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. | |
| int32 | RemoveByPredicate
(
Predicate Pred |
Remove all entries using a predicate. | |
| ValueType | Remove and return the least 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. |