OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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_SENSORS_PUBLIC_CPP_MOTION_DATA_H_ |
| 6 #define DEVICE_SENSORS_PUBLIC_CPP_MOTION_DATA_H_ |
| 7 |
| 8 namespace device { |
| 9 |
| 10 #pragma pack(push, 1) |
| 11 |
| 12 class MotionData { |
| 13 public: |
| 14 MotionData(); |
| 15 MotionData(const MotionData& other); |
| 16 ~MotionData() {} |
| 17 |
| 18 double accelerationX; |
| 19 double accelerationY; |
| 20 double accelerationZ; |
| 21 |
| 22 double accelerationIncludingGravityX; |
| 23 double accelerationIncludingGravityY; |
| 24 double accelerationIncludingGravityZ; |
| 25 |
| 26 double rotationRateAlpha; |
| 27 double rotationRateBeta; |
| 28 double rotationRateGamma; |
| 29 |
| 30 double interval; |
| 31 |
| 32 bool hasAccelerationX : 1; |
| 33 bool hasAccelerationY : 1; |
| 34 bool hasAccelerationZ : 1; |
| 35 |
| 36 bool hasAccelerationIncludingGravityX : 1; |
| 37 bool hasAccelerationIncludingGravityY : 1; |
| 38 bool hasAccelerationIncludingGravityZ : 1; |
| 39 |
| 40 bool hasRotationRateAlpha : 1; |
| 41 bool hasRotationRateBeta : 1; |
| 42 bool hasRotationRateGamma : 1; |
| 43 |
| 44 bool allAvailableSensorsAreActive : 1; |
| 45 }; |
| 46 |
| 47 static_assert(sizeof(MotionData) == (10 * sizeof(double) + 2 * sizeof(char)), |
| 48 "MotionData has wrong size"); |
| 49 |
| 50 #pragma pack(pop) |
| 51 |
| 52 } // namespace device |
| 53 |
| 54 #endif // DEVICE_SENSORS_PUBLIC_CPP_MOTION_DATA_H_ |
OLD | NEW |