Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: device/generic_sensor/public/cpp/sensor_reading.h

Issue 2726093003: [sensors][android] Add support for AbsoluteOrientation sensor (Closed)
Patch Set: Rebased to master, rename enum Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ 5 #ifndef DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_
6 #define DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ 6 #define DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_
7 7
8 #include "device/base/synchronization/one_writer_seqlock.h" 8 #include "device/base/synchronization/one_writer_seqlock.h"
9 #include "device/generic_sensor/public/cpp/generic_sensor_public_export.h" 9 #include "device/generic_sensor/public/cpp/generic_sensor_public_export.h"
10 #include "device/generic_sensor/public/interfaces/sensor.mojom.h" 10 #include "device/generic_sensor/public/interfaces/sensor.mojom.h"
(...skipping 21 matching lines...) Expand all
32 private: 32 private:
33 union Storage { 33 union Storage {
34 int64_t unused; 34 int64_t unused;
35 Data value; 35 Data value;
36 Storage() { new (&value) Data(); } 36 Storage() { new (&value) Data(); }
37 ~Storage() { value.~Data(); } 37 ~Storage() { value.~Data(); }
38 }; 38 };
39 Storage storage_; 39 Storage storage_;
40 }; 40 };
41 41
42 // This structure represents sensor reading data: timestamp and 3 values. 42 // This structure represents sensor reading data: timestamp and 4 values.
43 struct DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorReading { 43 struct DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorReading {
44 SensorReading(); 44 SensorReading();
45 ~SensorReading(); 45 ~SensorReading();
46 SensorReading(const SensorReading& other); 46 SensorReading(const SensorReading& other);
47 SensorReadingField<double> timestamp; 47 SensorReadingField<double> timestamp;
48 constexpr static int kValuesCount = 3; 48 constexpr static int kValuesCount = 4;
49 SensorReadingField<double> values[kValuesCount]; 49 SensorReadingField<double> values[kValuesCount];
50 }; 50 };
51 51
52 // This structure represents sensor reading buffer: sensor reading and seqlock 52 // This structure represents sensor reading buffer: sensor reading and seqlock
53 // for synchronization. 53 // for synchronization.
54 struct DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorReadingSharedBuffer { 54 struct DEVICE_GENERIC_SENSOR_PUBLIC_EXPORT SensorReadingSharedBuffer {
55 SensorReadingSharedBuffer(); 55 SensorReadingSharedBuffer();
56 ~SensorReadingSharedBuffer(); 56 ~SensorReadingSharedBuffer();
57 SensorReadingField<OneWriterSeqLock> seqlock; 57 SensorReadingField<OneWriterSeqLock> seqlock;
58 SensorReading reading; 58 SensorReading reading;
59 59
60 // Gets the shared reading buffer offset for the given sensor type. 60 // Gets the shared reading buffer offset for the given sensor type.
61 static uint64_t GetOffset(mojom::SensorType type); 61 static uint64_t GetOffset(mojom::SensorType type);
62 }; 62 };
63 63
64 } // namespace device 64 } // namespace device
65 65
66 #endif // DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_ 66 #endif // DEVICE_GENERIC_SENSOR_PUBLIC_CPP_SENSOR_READING_H_
OLDNEW
« no previous file with comments | « device/generic_sensor/platform_sensor_android.cc ('k') | device/generic_sensor/public/interfaces/sensor.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698