#include <PsoLruCache.h>
◆ TPsoLruCache() [1/2]
Default constructor (empty cache that cannot hold any values).
◆ TPsoLruCache() [2/2]
Create and initialize a new instance.
- Parameters
-
| InMaxNumElements | The maximum number of elements this cache can hold. |
◆ ~TPsoLruCache()
◆ Add()
Add an entry to the cache.
The new entry must not exist in the cache, there must be space within the LRU for the new entry. The new entry will be marked as the most recently used one.
- Parameters
-
| Key | The entry's lookup key. |
| Value | The entry's value. |
- Returns
- FSetElementId of the entry, update recent status without requiring a find operation.
- See also
- Empty, Find, GetKeys, Remove
◆ Contains()
◆ ContainsByPredicate()
| bool TPsoLruCache< KeyType, ValueType >::ContainsByPredicate |
( |
Predicate |
Pred | ) |
const |
|
inline |
◆ Empty()
Empty the cache.
- Parameters
-
| InMaxNumElements | The maximum number of elements this cache can hold (default = 0). |
- See also
- Add, Find, GetKeys, Max, Num, Remove
◆ FilterByPredicate()
| TArray< ValueType > TPsoLruCache< KeyType, ValueType >::FilterByPredicate |
( |
Predicate |
Pred | ) |
const |
|
inline |
◆ Find()
| const ValueType * TPsoLruCache< KeyType, ValueType >::Find |
( |
const KeyType & |
Key | ) |
const |
|
inline |
Find the value of the entry with the specified key.
- Parameters
-
| Key | The key of the entry to get. |
- Returns
- Pointer to the value, or nullptr if not found.
- See also
- Add, Contains, Empty, FindAndTouch, GetKeys, Remove
◆ FindAndTouch()
| const ValueType * TPsoLruCache< KeyType, ValueType >::FindAndTouch |
( |
const KeyType & |
Key | ) |
|
|
inline |
Find the value of the entry with the specified key and mark it as the most recently used.
- Parameters
-
| Key | The key of the entry to get. |
- Returns
- Pointer to the value, or nullptr if not found.
- See also
- Add, Contains, Empty, Find, GetKeys, Remove
◆ FindByPredicate()
| const ValueType * TPsoLruCache< KeyType, ValueType >::FindByPredicate |
( |
Predicate |
Pred | ) |
const |
|
inline |
◆ GetKeys()
Find the keys of all cached entries.
- Parameters
-
| OutKeys | Will contain the collection of keys. |
- See also
- Add, Empty, Find
◆ GetLeastRecent()
| const ValueType TPsoLruCache< KeyType, ValueType >::GetLeastRecent |
( |
| ) |
const |
|
inline |
Return the least recent element from the cache.
- Returns
- Copy of the least recent value.
◆ MarkAsRecent() [1/2]
◆ MarkAsRecent() [2/2]
Mark the given entry as recently used.
- Parameters
-
◆ Max()
Get the maximum number of entries in the cache.
- Returns
- Maximum number of entries.
- See also
- Empty, Num
◆ Num()
Get the number of entries in the cache.
- Returns
- Number of entries.
- See also
- Empty, Max
◆ Remove() [1/3]
Remove all entries with the specified key from the cache.
- Parameters
-
| Key | The key of the entries to remove. |
- See also
- Add, Empty, Find, RemoveByPredicate
◆ Remove() [2/3]
| bool TPsoLruCache< KeyType, ValueType >::Remove |
( |
const KeyType & |
Key, |
|
|
ValueType & |
RemovedValue |
|
) |
| |
|
inline |
◆ Remove() [3/3]
Remove the specified entry from the cache.
- Parameters
-
| Entry | The entry to remove. |
◆ RemoveByPredicate()
◆ RemoveLeastRecent()
| ValueType TPsoLruCache< KeyType, ValueType >::RemoveLeastRecent |
( |
| ) |
|
|
inline |
Remove and return the least recent element from the cache.
- Returns
- Copy of removed value.
◆ RemoveMostRecent()
| ValueType TPsoLruCache< KeyType, ValueType >::RemoveMostRecent |
( |
| ) |
|
|
inline |
Remove and return the most recent element from the cache.
- Returns
- Copy of removed value.
◆ begin [1/2]
◆ begin [2/2]
◆ end [1/2]
◆ end [2/2]
The documentation for this class was generated from the following file: