persistent-cache-cpp
|
Top-level namespace for core functionality. More...
Classes | |
struct | CacheCodec |
class | PersistentCache |
A persistent cache of key-value pairs and metadata of user-defined type. More... | |
class | PersistentCacheStats |
Class that provides (read-only) access to cache statistics and settings. More... | |
class | PersistentStringCache |
A cache of key-value pairs with persistent storage. More... | |
Typedefs | |
template<typename T > | |
using | Optional = boost::optional< T > |
Convenience typedef for nullable values. More... | |
Enumerations | |
enum | CacheDiscardPolicy { CacheDiscardPolicy::lru_ttl, CacheDiscardPolicy::lru_only } |
Indicates the discard policy to make room for entries when the cache is full. More... | |
enum | CacheEvent : uint32_t { CacheEvent::get = 1 << 0, CacheEvent::put = 1 << 1, CacheEvent::invalidate = 1 << 2, CacheEvent::touch = 1 << 3, CacheEvent::miss = 1 << 4, CacheEvent::evict_ttl = 1 << 5, CacheEvent::evict_lru = 1 << 6, CacheEvent::END_ = 1 << 7 } |
Event types that can be monitored. More... | |
Functions | |
CacheEvent | operator| (CacheEvent left, CacheEvent right) |
Returns the bitwise OR of two event types. More... | |
CacheEvent & | operator|= (CacheEvent &left, CacheEvent right) |
Assigns the bitwise OR of left and right to left . More... | |
CacheEvent | operator& (CacheEvent left, CacheEvent right) |
Returns the bitwise AND of two event types. More... | |
CacheEvent & | operator&= (CacheEvent &left, CacheEvent right) |
Assigns the bitwise AND of left and right to left . More... | |
CacheEvent | operator~ (CacheEvent ev) |
Returns the bitwise NOT of ev . Unused bits are set to zero. More... | |
Top-level namespace for core functionality.
using core::Optional = typedef boost::optional<T> |
Convenience typedef for nullable values.
core::Optional
in preference to boost::optional
in your code. This will ease an eventual transition to std::optional
.
|
strong |
Indicates the discard policy to make room for entries when the cache is full.
Once the cache is full and another entry is added, lru_ttl
unconditionally deletes all entries that have expired and then, if deleting these entries did not create sufficient free space, deletes entries in least-recently-used order until enough space is available.
If the discard policy is set to lru_only
, entries do not maintain an expiry time and are therefore discarded strictly in LRU order.
Enumerator | |
---|---|
lru_ttl | Evict expired entries first, followed by eviction in LRU order. |
lru_only | Evict in LRU order. |
|
strong |
Event types that can be monitored.
|
inline |
Returns the bitwise AND of two event types.
|
inline |
Assigns the bitwise AND of left
and right
to left
.
|
inline |
Returns the bitwise OR of two event types.
|
inline |
Assigns the bitwise OR of left
and right
to left
.
|
inline |
Returns the bitwise NOT of ev
. Unused bits are set to zero.