Constructors
Declared in <bdlcc_cache.h>
Create an empty LRU cache having no size limit.
explicit
Cache(bslma::Allocator* basicAllocator = 0);
» more...
Create an empty cache with the specified eviction policy and watermarks.
Cache(
CacheEvictionPolicy::Enum evictionPolicy,
std::size_t lowWatermark,
std::size_t highWatermark,
bslma::Allocator* basicAllocator = 0);
» more...
Create an empty cache with custom hash and equality functors.
Cache(
CacheEvictionPolicy::Enum evictionPolicy,
std::size_t lowWatermark,
std::size_t highWatermark,
HASH const& hashFunction,
EQUAL const& equalFunction,
bslma::Allocator* basicAllocator = 0);
» more...
| Name | Description |
|---|---|
| basicAllocator | allocator used to supply memory |
| evictionPolicy | policy used to select items for eviction |
| lowWatermark | size at which eviction stops |
| highWatermark | size at which eviction starts after an insert |
| hashFunction | hash functor applied to keys |
| equalFunction | equality functor applied to keys |