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. | |
Enumerations | |
enum class | CacheDiscardPolicy { lru_ttl , lru_only } |
Indicates the discard policy to make room for entries when the cache is full. More... | |
enum class | CacheEvent : uint32_t { get = 1 << 0 , put = 1 << 1 , invalidate = 1 << 2 , touch = 1 << 3 , miss = 1 << 4 , evict_ttl = 1 << 5 , evict_lru = 1 << 6 , 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. | |
CacheEvent & | operator|= (CacheEvent &left, CacheEvent right) |
Assigns the bitwise OR of left and right to left . | |
CacheEvent | operator& (CacheEvent left, CacheEvent right) |
Returns the bitwise AND of two event types. | |
CacheEvent & | operator&= (CacheEvent &left, CacheEvent right) |
Assigns the bitwise AND of left and right to left . | |
CacheEvent | operator~ (CacheEvent ev) |
Returns the bitwise NOT of ev . Unused bits are set to zero. | |
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.
Enumerator | |
---|---|
get | An entry was returned by a call to |
put | An entry was added by a call to |
invalidate | An entry was removed by a call to |
touch | An entry was refreshed by a call to |
miss | A call to |
evict_ttl | An expired entry was evicted due to a call to |
evict_lru | The oldest entry was evicted due to a call to |
END_ | End marker. |
|
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.