Files
nearby/cpp/platform_v2/impl/ios/atomic_reference.h
T
Alexey Polyudov bcc3f21da2 Roll forward to cl/334770381
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
Change-Id: I22b685b17c37357d6281cedfa7c228e304de8835
2020-10-01 02:31:10 -07:00

34 lines
702 B
C++

#ifndef PLATFORM_V2_IMPL_IOS_ATOMIC_REFERENCE_H_
#define PLATFORM_V2_IMPL_IOS_ATOMIC_REFERENCE_H_
#include <atomic>
#include <cstdint>
#include "platform_v2/api/atomic_reference.h"
namespace location {
namespace nearby {
namespace ios {
class AtomicUint32 : public api::AtomicUint32 {
public:
explicit AtomicUint32(std::int32_t value) : value_(value) {}
~AtomicUint32() override = default;
std::uint32_t Get() const override {
return value_;
}
void Set(std::uint32_t value) override {
value_ = value;
}
private:
std::atomic<std::uint32_t> value_;
};
} // namespace ios
} // namespace nearby
} // namespace location
#endif // PLATFORM_V2_IMPL_IOS_ATOMIC_REFERENCE_H_