This class represents a simple in‐process key‐value store supporting a variety of eviction policies.
Synopsis
Declared in <bdlcc_cache.h>
template<
class KEY,
class VALUE,
class HASH = bsl::hash<KEY>,
class EQUAL = bsl::equal_to<KEY>>
class Cache;
Type Aliases
Name |
Description |
Value type of a bulk insert entry. |
|
Type of function to call after an item has been evicted from the cache. |
|
Shared pointer type pointing to value type. |
Member Functions
Name |
Description |
|
Constructors |
Remove all items from this cache. Do not invoke the post‐eviction callback. |
|
Return (a copy of) the key‐equality functor used by this cache that returns |
|
Remove the item having the specified |
|
|
|
Return the eviction policy used by this cache. |
|
Return (a copy of) the unary hash functor used by this cache to generate a hash value (of type |
|
Return the high watermark of this cache, which is the size at which eviction of existing items begins. |
|
|
|
|
|
Return the low watermark of this cache, which is the size at which eviction of existing items ends. |
|
Remove the item at the front of the eviction queue. Invoke the post‐eviction callback for the removed item. Return 0 on success, and 1 if this cache is empty. |
|
Set the post‐eviction callback to the specified |
|
Return the current size of this cache. |
|
Load, into the specified |
|
Call the specified |
Friends
Name |
Description |
This class implements a test utility that gives the test driver access to the lock / unlock method of the RW mutex. Its purpose is to allow testing that the locking actually happens as planned. |
Created with MrDocs