8#include <aws/core/utils/DateTime.h>
9#include <aws/core/utils/Cache.h>
10#include <aws/core/utils/threading/ReaderWriterLock.h>
16 template <
typename TKey,
typename TValue>
22 bool Get(
const TKey& key, TValue& value)
const
25 return m_cache.Get(key, value);
28 template<
typename UValue>
29 void Put(
const TKey& key, UValue&& val, std::chrono::milliseconds duration)
32 m_cache.Put(key, std::forward<UValue>(val), duration);
35 template<
typename UValue>
36 void Put(TKey&& key, UValue&& val, std::chrono::milliseconds duration)
39 m_cache.Put(std::move(key), std::forward<UValue>(val), duration);
42 using TransformFunction = std::function<typename Aws::Utils::Cache<TKey, TValue>::Value(
const TKey &,
47 m_cache.Transform(function);
55 m_cache.Filter(function);
void Filter(FilterFunction function)
std::function< typename Aws::Utils::Cache< TKey, TValue >::Value(const TKey &, const typename Aws::Utils::Cache< TKey, TValue >::Value &)> TransformFunction
std::function< bool(const TKey &, const typename Aws::Utils::Cache< TKey, TValue >::Value &)> FilterFunction
bool Get(const TKey &key, TValue &value) const
void Put(TKey &&key, UValue &&val, std::chrono::milliseconds duration)
ConcurrentCache(size_t size=1000)
void Transform(TransformFunction function)
void Put(const TKey &key, UValue &&val, std::chrono::milliseconds duration)