3#include <xrpl/basics/KeyCache.h>
4#include <xrpl/basics/TaggedCache.h>
5#include <xrpl/basics/base_uint.h>
6#include <xrpl/beast/insight/Collector.h>
7#include <xrpl/beast/utility/Journal.h>
84 return cache_.touchIfExists(key);
A generic endpoint for log messages.
std::shared_ptr< Collector > ptr
static std::shared_ptr< Collector > make()
beast::AbstractClock< std::chrono::steady_clock > clock_type
Remembers which tree keys have all descendants resident.
void sweep()
Remove expired cache items.
static constexpr auto kDefaultCacheTargetSize
bool touchIfExists(key_type const &key)
Refresh the last access time of an item, if it exists.
std::atomic< std::uint32_t > gen_
BasicFullBelowCache(std::string const &name, clock_type &clock, beast::Journal j, beast::insight::Collector::ptr const &collector=beast::insight::NullCollector::make(), std::size_t targetSize=kDefaultCacheTargetSize, std::chrono::seconds expiration=std::chrono::minutes{2})
Construct the cache.
std::size_t size() const
Return the number of elements in the cache.
CacheType::clock_type clock_type
void insert(key_type const &key)
Insert a key into the cache.
clock_type & clock()
Return the clock associated with the cache.
std::uint32_t getGeneration(void) const
generation determines whether cached entry is valid
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
detail::BasicFullBelowCache FullBelowCache
TaggedCache< uint256, int, true > KeyCache