BloombergLP::bdlcc::Cache::tryGetValue

Load the value associated with the specified key into value.

Synopsis

Declared in <bdlcc_cache.h>

int
tryGetValue(
    bsl::shared_ptr<VALUE>* value,
    KEY const& key,
    bool modifyEvictionQueue = true);

Description

Load, into the specified value, the value associated with the specified key in this cache. If the optionally specified modifyEvictionQueue is true and the eviction policy is LRU, then move the cached item to the back of the eviction queue. Return 0 on success, and 1 if key does not exist in this cache. Note that a write lock is acquired only if this queue is modified.

Return Value

0 on success, and 1 if key does not exist in this cache

Parameters

NameDescription
valuereceives the value associated with key
keykey whose value is retrieved
modifyEvictionQueuewhether to update the LRU eviction queue