Avionics
Core avionics package for CURE flight computers
Loading...
Searching...
No Matches
DataPoint.h
Go to the documentation of this file.
1#ifndef DATAPOINT_H
2#define DATAPOINT_H
3
4#include <cstdint>
5
11class DataPoint {
12public:
13 uint32_t timestamp_ms; // Will roll over every 49.7 days
14 float data; // Data size: 4 bytes
15
22 : timestamp_ms(0), data(0) {}
23
33
34 // Overload > operator
35 friend bool operator>(const DataPoint& lhs, const DataPoint& rhs) {
36 return lhs.data > rhs.data;
37 }
38
39 // Overload >= operator
40 friend bool operator>=(const DataPoint& lhs, const DataPoint& rhs) {
41 return lhs.data >= rhs.data;
42 }
43
44 // Overload < operator
45 friend bool operator<(const DataPoint& lhs, const DataPoint& rhs) {
46 return lhs.data < rhs.data;
47 }
48
49 // Overload <= operator
50 friend bool operator<=(const DataPoint& lhs, const DataPoint& rhs) {
51 return lhs.data <= rhs.data;
52 }
53};
54
55#endif
DataPoint()
Default construct an empty data point.
Definition DataPoint.h:21
float data
Definition DataPoint.h:14
friend bool operator>(const DataPoint &lhs, const DataPoint &rhs)
Definition DataPoint.h:35
uint32_t timestamp_ms
Definition DataPoint.h:13
friend bool operator>=(const DataPoint &lhs, const DataPoint &rhs)
Definition DataPoint.h:40
friend bool operator<=(const DataPoint &lhs, const DataPoint &rhs)
Definition DataPoint.h:50
DataPoint(uint32_t timestamp_ms, float data)
Construct a populated data point.
Definition DataPoint.h:31
friend bool operator<(const DataPoint &lhs, const DataPoint &rhs)
Definition DataPoint.h:45