OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/generic_sensor/public/cpp/sensor_reading.h" | 5 #include "services/device/public/cpp/generic_sensor/sensor_reading.h" |
6 | 6 |
7 namespace device { | 7 namespace device { |
8 | 8 |
9 SensorReading::SensorReading() = default; | 9 SensorReading::SensorReading() = default; |
10 SensorReading::SensorReading(const SensorReading& other) = default; | 10 SensorReading::SensorReading(const SensorReading& other) = default; |
11 SensorReading::~SensorReading() = default; | 11 SensorReading::~SensorReading() = default; |
12 | 12 |
13 SensorReadingSharedBuffer::SensorReadingSharedBuffer() = default; | 13 SensorReadingSharedBuffer::SensorReadingSharedBuffer() = default; |
14 SensorReadingSharedBuffer::~SensorReadingSharedBuffer() = default; | 14 SensorReadingSharedBuffer::~SensorReadingSharedBuffer() = default; |
15 | 15 |
16 // static | 16 // static |
17 uint64_t SensorReadingSharedBuffer::GetOffset(mojom::SensorType type) { | 17 uint64_t SensorReadingSharedBuffer::GetOffset(mojom::SensorType type) { |
18 return (static_cast<uint64_t>(mojom::SensorType::LAST) - | 18 return (static_cast<uint64_t>(mojom::SensorType::LAST) - |
19 static_cast<uint64_t>(type)) * | 19 static_cast<uint64_t>(type)) * |
20 sizeof(SensorReadingSharedBuffer); | 20 sizeof(SensorReadingSharedBuffer); |
21 } | 21 } |
22 | 22 |
23 } // namespace device | 23 } // namespace device |
OLD | NEW |