diff options
author | wd28 <wd28@yandex-team.ru> | 2022-02-10 16:49:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:40 +0300 |
commit | 1b7466cb957659079ebebbb5d76e64e51f3306f0 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/cache/thread_safe_cache.h | |
parent | 23df4007b6ffbbdb0b25a214dded0c60538fb558 (diff) | |
download | ydb-1b7466cb957659079ebebbb5d76e64e51f3306f0.tar.gz |
Restoring authorship annotation for <wd28@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/cache/thread_safe_cache.h')
-rw-r--r-- | library/cpp/cache/thread_safe_cache.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/cache/thread_safe_cache.h b/library/cpp/cache/thread_safe_cache.h index baa39ec68f..71e1442717 100644 --- a/library/cpp/cache/thread_safe_cache.h +++ b/library/cpp/cache/thread_safe_cache.h @@ -15,8 +15,8 @@ namespace NPrivate { template <class Key, class Value, template <class, class> class List, EGettersPromotionPolicy GettersPromotionPolicy, class... TArgs> class TThreadSafeCache { public: - using TPtr = TAtomicSharedPtr<Value>; - + using TPtr = TAtomicSharedPtr<Value>; + class ICallbacks { public: using TKey = Key; @@ -30,9 +30,9 @@ namespace NPrivate { }; public: - TThreadSafeCache(const ICallbacks& callbacks, size_t maxSize = Max<size_t>()) + TThreadSafeCache(const ICallbacks& callbacks, size_t maxSize = Max<size_t>()) : Callbacks(callbacks) - , Cache(maxSize) + , Cache(maxSize) { } @@ -49,7 +49,7 @@ namespace NPrivate { Cache.Update(key, value); } - const TPtr Get(TArgs... args) const { + const TPtr Get(TArgs... args) const { return GetValue<true>(args...); } @@ -82,7 +82,7 @@ namespace NPrivate { } template <class TCallbacks> - static const TPtr Get(TArgs... args) { + static const TPtr Get(TArgs... args) { return TThreadSafeCacheSingleton<TCallbacks>::Get(args...); } @@ -140,7 +140,7 @@ namespace NPrivate { template <class TCallbacks> class TThreadSafeCacheSingleton { public: - static const TPtr Get(TArgs... args) { + static const TPtr Get(TArgs... args) { return Singleton<TThreadSafeCacheSingleton>()->Cache.Get(args...); } |