4#ifndef _Stroika_Foundation_Cache_SynchronizedCallerStalenessCache_h_
5#define _Stroika_Foundation_Cache_SynchronizedCallerStalenessCache_h_ 1
7#include "Stroika/Foundation/StroikaPreComp.h"
10#include <shared_mutex>
12#include "Stroika/Foundation/Cache/CallerStalenessCache.h"
34 template <
typename KEY,
typename VALUE,
typename TIME_TRAITS = CallerStalenessCache_Traits_DEFAULT>
60 bool fHoldWriteLockDuringCacheFill{
false};
72 using inherited::GetCurrentTimestamp;
90 nonvirtual
void Clear ();
91 template <
typename K1 = KEY>
104 template <
typename K = KEY>
114 template <
typename K = KEY>
119 template <
typename F,
typename K = KEY>
122 template <
typename K = KEY>
130 nonvirtual
void clear ();
133 mutable shared_timed_mutex fMutex_;
143#include "SynchronizedCallerStalenessCache.inl"
static TimeStampType Ago(TimeStampDifferenceType backThisTime)
LRUCache implements a simple least-recently-used caching strategy, with optional hashing (of keys) to...
simple wrapper on CallerStalenessCache (with the same API) - but internally synchronized in a way tha...
typename inherited::TimeStampType TimeStampType
nonvirtual void Add(Common::ArgByValueType< VALUE > v)
nonvirtual void ClearOlderThan(TimeStampType t)
nonvirtual optional< VALUE > Lookup(TimeStampType staleIfOlderThan) const
conditional_t<(sizeof(CHECK_T)<=2 *sizeof(void *)) and is_trivially_copyable_v< CHECK_T >, CHECK_T, const CHECK_T & > ArgByValueType
This is an alias for 'T' - but how we want to pass it on stack as formal parameter.
AddReplaceMode
Mode flag to say if Adding to a container replaces, or if the first addition wins.