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