20 #ifndef RIPPLE_SHAMAP_FULLBELOWCACHE_H_INCLUDED
21 #define RIPPLE_SHAMAP_FULLBELOWCACHE_H_INCLUDED
23 #include <ripple/basics/base_uint.h>
24 #include <ripple/basics/KeyCache.h>
25 #include <ripple/beast/insight/Collector.h>
size_type size() const
Returns the number of items in the container.
Remembers which tree keys have all descendants resident.
beast::abstract_clock< std::chrono::steady_clock > clock_type
typename CacheType::clock_type clock_type
std::atomic< std::uint32_t > m_gen
bool touch_if_exists(KeyComparable const &key)
Refresh the last access time on a key if present.
bool touch_if_exists(key_type const &key)
Refresh the last access time of an item, if it exists.
bool insert(Key const &key)
Insert the specified key.
BasicFullBelowCache(std::string const &name, clock_type &clock, beast::insight::Collector::ptr const &collector=beast::insight::NullCollector::New(), std::size_t target_size=defaultCacheTargetSize, std::chrono::seconds expiration=std::chrono::minutes{2})
Construct the cache.
void sweep()
Remove expired cache items.
clock_type & clock()
Return the clock associated with the cache.
void sweep()
Remove stale entries from the cache.
void clear()
Empty the cache.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
std::uint32_t getGeneration(void) const
generation determines whether cached entry is valid
typename map_type::size_type size_type
typename CacheType::size_type size_type
size_type size() const
Return the number of elements in the cache.
void insert(key_type const &key)
Insert a key into the cache.
clock_type & clock()
Return the clock associated with the cache.
static std::shared_ptr< Collector > New()