Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2018-08-28 13:24:15 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2018-08-30 13:09:25 +0300
commitea8d54e7162ef1b754cad13ea01a77b93af7f695 (patch)
tree72ad2f382e0801b1c5bccfc6a1640cd46d2d6863 /base
parentd681afd8833c3986f577b3d02402edd63d22d915 (diff)
[eye] The eye is added.
Diffstat (limited to 'base')
-rw-r--r--base/atomic_shared_ptr.hpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/base/atomic_shared_ptr.hpp b/base/atomic_shared_ptr.hpp
index 8a346c6401..a4e5b51fb9 100644
--- a/base/atomic_shared_ptr.hpp
+++ b/base/atomic_shared_ptr.hpp
@@ -11,12 +11,17 @@ template <typename T>
class AtomicSharedPtr final
{
public:
+ using ContentType = T const;
+ using ValueType = std::shared_ptr<ContentType>;
+
AtomicSharedPtr() = default;
- void Set(std::shared_ptr<T const> value) noexcept { atomic_store(&m_wrapped, value); }
- std::shared_ptr<T const> Get() const noexcept { return atomic_load(&m_wrapped); }
+ void Set(ValueType value) noexcept { atomic_store(&m_wrapped, value); }
+ ValueType Get() const noexcept { return atomic_load(&m_wrapped); }
private:
- std::shared_ptr<T const> m_wrapped = std::make_shared<T const>();
+ ValueType m_wrapped = std::make_shared<ContentType>();
+
+ DISALLOW_COPY(AtomicSharedPtr);
};
} // namespace base