| 
    rippled
    
   | 
 
Remembers which tree keys have all descendants resident. More...
#include <FullBelowCache.h>

Public Types | |
| enum | { defaultCacheTargetSize = 0 } | 
| using | key_type = uint256 | 
| using | clock_type = typename CacheType::clock_type | 
Public Member Functions | |
| 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.   | |
| clock_type & | clock () | 
| Return the clock associated with the cache.   | |
| std::size_t | size () const | 
| Return the number of elements in the cache.   | |
| void | sweep () | 
| Remove expired cache items.   | |
| bool | touch_if_exists (key_type const &key) | 
| Refresh the last access time of an item, if it exists.   | |
| void | insert (key_type const &key) | 
| Insert a key into the cache.   | |
| std::uint32_t | getGeneration (void) const | 
| generation determines whether cached entry is valid   | |
| void | clear () | 
| void | reset () | 
Private Types | |
| using | CacheType = KeyCache | 
Private Attributes | |
| CacheType | m_cache | 
| std::atomic< std::uint32_t > | m_gen | 
Remembers which tree keys have all descendants resident.
This optimizes the process of acquiring a complete tree.
Definition at line 39 of file FullBelowCache.h.
      
  | 
  private | 
Definition at line 42 of file FullBelowCache.h.
Definition at line 47 of file FullBelowCache.h.
| using ripple::detail::BasicFullBelowCache::clock_type = typename CacheType::clock_type | 
Definition at line 48 of file FullBelowCache.h.
| anonymous enum | 
| Enumerator | |
|---|---|
| defaultCacheTargetSize | |
Definition at line 45 of file FullBelowCache.h.
| ripple::detail::BasicFullBelowCache::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.
| name | A label for diagnostics and stats reporting. | 
| collector | The collector to use for reporting stats. | 
| targetSize | The cache target size. | 
| targetExpirationSeconds | The expiration time for items. | 
Definition at line 57 of file FullBelowCache.h.
| clock_type & ripple::detail::BasicFullBelowCache::clock | ( | ) | 
Return the clock associated with the cache.
Definition at line 71 of file FullBelowCache.h.
| std::size_t ripple::detail::BasicFullBelowCache::size | ( | ) | const | 
Return the number of elements in the cache.
Thread safety: Safe to call from any thread.
Definition at line 81 of file FullBelowCache.h.
| void ripple::detail::BasicFullBelowCache::sweep | ( | ) | 
Remove expired cache items.
Thread safety: Safe to call from any thread.
Definition at line 91 of file FullBelowCache.h.
| bool ripple::detail::BasicFullBelowCache::touch_if_exists | ( | key_type const & | key | ) | 
Refresh the last access time of an item, if it exists.
Thread safety: Safe to call from any thread.
| key | The key to refresh. | 
true If the key exists. Definition at line 103 of file FullBelowCache.h.
| void ripple::detail::BasicFullBelowCache::insert | ( | key_type const & | key | ) | 
Insert a key into the cache.
If the key already exists, the last access time will still be refreshed. Thread safety: Safe to call from any thread.
| key | The key to insert. | 
Definition at line 116 of file FullBelowCache.h.
| std::uint32_t ripple::detail::BasicFullBelowCache::getGeneration | ( | void | ) | const | 
generation determines whether cached entry is valid
Definition at line 123 of file FullBelowCache.h.
| void ripple::detail::BasicFullBelowCache::clear | ( | ) | 
Definition at line 129 of file FullBelowCache.h.
| void ripple::detail::BasicFullBelowCache::reset | ( | ) | 
Definition at line 136 of file FullBelowCache.h.
      
  | 
  private | 
Definition at line 143 of file FullBelowCache.h.
      
  | 
  private | 
Definition at line 144 of file FullBelowCache.h.