mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 15:16:12 -04:00
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I4bf367877a986910bb03e1c54aa972b4bcd59942
34 lines
697 B
C++
34 lines
697 B
C++
#ifndef PLATFORM_V2_IMPL_G3_ATOMIC_REFERENCE_H_
|
|
#define PLATFORM_V2_IMPL_G3_ATOMIC_REFERENCE_H_
|
|
|
|
#include <atomic>
|
|
#include <cstdint>
|
|
|
|
#include "platform_v2/api/atomic_reference.h"
|
|
|
|
namespace location {
|
|
namespace nearby {
|
|
namespace g3 {
|
|
|
|
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 g3
|
|
} // namespace nearby
|
|
} // namespace location
|
|
|
|
#endif // PLATFORM_V2_IMPL_G3_ATOMIC_REFERENCE_H_
|