It has been a while since I last worked on Aesalon proper.
[aesalon.git] / common / include / renderer / DataCoord.h
blobf861cd05ec75df2cd77e1401255fd51dbdef51d9
1 #ifndef DataCoord_H
2 #define DataCoord_H
4 #include "DataTypes.h"
6 class DataCoord {
7 public:
8 DataCoord(Timestamp time = 0, double data = 0.0) : m_time(time), m_data(data) {}
9 ~DataCoord() {}
10 private:
11 Timestamp m_time;
12 double m_data;
13 public:
14 Timestamp &time() { return m_time; }
15 const Timestamp &time() const { return m_time; }
16 void setTime(Timestamp time) { m_time = time; }
18 double &data() { return m_data; }
19 const double &data() const { return m_data; }
20 void setData(double data) { m_data = data; }
22 DataCoord operator+(const DataCoord &other) const {
23 return DataCoord(m_time + other.m_time, m_data + other.m_data);
25 DataCoord operator-(const DataCoord &other) const {
26 return DataCoord(m_time - other.m_time, m_data - other.m_data);
29 DataCoord &operator+=(const DataCoord &other) {
30 m_time += other.m_time;
31 m_data += other.m_data;
32 return *this;
36 #endif