BloombergLP::bdlcc::Cache::Cache

Constructors

Synopses

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...

Parameters

NameDescription
basicAllocatorallocator used to supply memory
evictionPolicypolicy used to select items for eviction
lowWatermarksize at which eviction stops
highWatermarksize at which eviction starts after an insert
hashFunctionhash functor applied to keys
equalFunctionequality functor applied to keys