|
DocWire SDK
DocWire SDK: Award-winning modern data processing in C++20. SourceForge Community Choice & Microsoft support. AI-driven processing. Supports nearly 100 data formats, including email boxes and OCR. Boost efficiency in text extraction, web data extraction, data mining, document analysis. Offline processing possible for security and confidentiality
|
Least Recently Used (LRU) cache with fixed memory size. More...
#include <lru_memory_cache.h>
Public Member Functions | |
| lru_memory_cache (size_t max_size=std::numeric_limits< size_t >::max()) | |
| Constructs LRU cache with specified maximum size. More... | |
| Value & | get_or_create (const Key &key, const std::function< Value(const Key &)> &producer) |
| Returns value for specified key. If key is not in the cache, it calls producer function to create value for the key. More... | |
Least Recently Used (LRU) cache with fixed memory size.
Cache stores key-value pairs. If cache reaches its maximum size, it evicts least recently used entry from the cache.
| Key | Key type |
| Value | Value type |
Definition at line 33 of file lru_memory_cache.h.
|
inlineexplicit |
Constructs LRU cache with specified maximum size.
| max_size | Maximum size of the cache. Default is std::numeric_limits<size_t>::max(), which means there is no limit. |
Definition at line 41 of file lru_memory_cache.h.
|
inline |
Returns value for specified key. If key is not in the cache, it calls producer function to create value for the key.
| key | Key for which value is requested |
| producer | Function that creates value for specified key if key is not in the cache |
Definition at line 52 of file lru_memory_cache.h.