20 #ifndef RIPPLE_SHAMAP_FULLBELOWCACHE_H_INCLUDED
21 #define RIPPLE_SHAMAP_FULLBELOWCACHE_H_INCLUDED
23 #include <ripple/basics/KeyCache.h>
24 #include <ripple/basics/TaggedCache.h>
25 #include <ripple/basics/base_uint.h>
26 #include <ripple/beast/insight/Collector.h>
27 #include <ripple/beast/utility/Journal.h>
std::atomic< std::uint32_t > m_gen
std::size_t size() const
Return the number of elements in the cache.
Remembers which tree keys have all descendants resident.
clock_type & clock()
Return the clock associated with the cache.
typename CacheType::clock_type clock_type
TaggedCache< uint256, int, true > KeyCache
bool touch_if_exists(key_type const &key)
Refresh the last access time of an item, if it exists.
auto insert(key_type const &key, T const &value) -> std::enable_if_t<!IsKeyCache, ReturnType >
Insert the element into the container.
std::uint32_t getGeneration(void) const
generation determines whether cached entry is valid
void insert(key_type const &key)
Insert a key into the cache.
void sweep()
Remove expired cache items.
A generic endpoint for log messages.
BasicFullBelowCache(std::string const &name, clock_type &clock, beast::Journal j, 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.
std::size_t size() const
Returns the number of items in the container.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
beast::abstract_clock< std::chrono::steady_clock > clock_type
bool touch_if_exists(KeyComparable const &key)
Refresh the last access time on a key if present.
static std::shared_ptr< Collector > New()
clock_type & clock()
Return the clock associated with the cache.