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: I9850950db8bd84f0904ea1a413151887f52098cf
34 lines
685 B
C++
34 lines
685 B
C++
#ifndef PLATFORM_IMPL_G3_ATOMIC_REFERENCE_H_
|
|
#define PLATFORM_IMPL_G3_ATOMIC_REFERENCE_H_
|
|
|
|
#include <atomic>
|
|
#include <cstdint>
|
|
|
|
#include "platform/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_IMPL_G3_ATOMIC_REFERENCE_H_
|