Files
HandyGames/workspace/sensors/SensorReadings.h
Frank Ebner c41200cb6a initial commit
-converter .txt -> MatLab matrices
2015-12-25 10:07:48 +01:00

30 lines
556 B
C++

#ifndef SENSORREADINGS_H
#define SENSORREADINGS_H
#include <vector>
template <typename T> class SensorReadings {
/** combine sensor-values with a timestamp */
struct TimedEntry {
uint64_t ts;
T val;
TimedEntry(const uint64_t ts, const T& val) : ts(ts), val(val) {;}
};
public:
/** all readings (with timestamp) for one sensor */
std::vector<TimedEntry> values;
public:
/** add a new sensor-reading with timestamp */
void add(const uint64_t ts, const T& val) {
values.push_back(TimedEntry(ts, val));
}
};
#endif // SENSORREADINGS_H