AWS SDK for C++  1.9.104
AWS SDK for C++
ConcurrentCache.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 #include <aws/core/utils/Cache.h>
11 
12 namespace Aws
13 {
14  namespace Utils
15  {
16  template <typename TKey, typename TValue>
18  {
19  public:
20  explicit ConcurrentCache(size_t size = 1000) : m_cache(size) { }
21 
22  bool Get(const TKey& key, TValue& value) const
23  {
25  return m_cache.Get(key, value);
26  }
27 
28  template<typename UValue>
29  void Put(const TKey& key, UValue&& val, std::chrono::milliseconds duration)
30  {
32  m_cache.Put(key, std::forward<UValue>(val), duration);
33  }
34 
35  template<typename UValue>
36  void Put(TKey&& key, UValue&& val, std::chrono::milliseconds duration)
37  {
39  m_cache.Put(std::move(key), std::forward<UValue>(val), duration);
40  }
41 
42  private:
45  };
46  }
47 }
Cache.h
Aws::Utils::Cache
Definition: Cache.h:21
DateTime.h
Aws::Utils::ConcurrentCache::ConcurrentCache
ConcurrentCache(size_t size=1000)
Definition: ConcurrentCache.h:20
Aws::Utils::ConcurrentCache::Put
void Put(const TKey &key, UValue &&val, std::chrono::milliseconds duration)
Definition: ConcurrentCache.h:29
ReaderWriterLock.h
Aws::Utils::ConcurrentCache
Definition: ConcurrentCache.h:18
Aws::Utils::Threading::ReaderWriterLock
Definition: ReaderWriterLock.h:26
Aws::Utils::Threading::ReaderLockGuard
Definition: ReaderWriterLock.h:63
Aws::Utils::ConcurrentCache::Put
void Put(TKey &&key, UValue &&val, std::chrono::milliseconds duration)
Definition: ConcurrentCache.h:36
Aws
Definition: AccessManagementClient.h:15
Aws::Utils::ConcurrentCache::Get
bool Get(const TKey &key, TValue &value) const
Definition: ConcurrentCache.h:22
Aws::Utils::Threading::WriterLockGuard
Definition: ReaderWriterLock.h:97