Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_SHARED_BUFFER_READER_H_ | |
| 6 #define DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_SHARED_BUFFER_READER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "device/generic_sensor/public/cpp/generic_sensor_public_export.h" | |
| 10 | |
| 11 namespace device { | |
| 12 | |
| 13 struct SensorReading; | |
| 14 struct SensorReadingSharedBuffer; | |
| 15 | |
| 16 class DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorSharedBufferReader { | |
|
Mikhail
2017/06/20 13:50:00
It's a good idea to export this functionality sinc
juncai
2017/06/20 19:50:55
Done.
| |
| 17 public: | |
| 18 explicit SensorSharedBufferReader(const SensorReadingSharedBuffer* buffer); | |
| 19 ~SensorSharedBufferReader(); | |
| 20 | |
| 21 // Get sensor reading from shared buffer. | |
| 22 bool GetSensorReading(SensorReading* result); | |
| 23 | |
| 24 private: | |
| 25 bool TryReadFromBuffer(SensorReading* result); | |
| 26 | |
| 27 const SensorReadingSharedBuffer* buffer_; | |
| 28 | |
| 29 DISALLOW_COPY_AND_ASSIGN(SensorSharedBufferReader); | |
| 30 }; | |
| 31 | |
| 32 } // namespace device | |
| 33 | |
| 34 #endif // DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_SHARED_BUFFER_READER_H_ | |
| OLD | NEW |