-
Notifications
You must be signed in to change notification settings - Fork 1
/
LirSQLiteWriter.hpp
41 lines (32 loc) · 1.04 KB
/
LirSQLiteWriter.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef LIRSQLITE3_HPP
#define LIRSQLITE3_HPP
#include "ISensor.hpp"
#include "ISensorListener.hpp"
#include "sqlite3.h"
#include <time.h>
#include "Spyder3ImageWriter.hpp"
#include <boost/thread.hpp>
class LirSQLiteWriter : public ISensorListener{
private:
boost::mutex pathMutex;
sqlite3 *db;
string outputFolder;
string dbPath;
Spyder3ImageWriter* camWriter; // Used to relate sensor readings to camera frames
ISensor* sensor;
string insertStmt;
vector<FieldDescriptor> fields;
time_t lastRowTimeLogged;
bool logging;
void initDatabase(string outputFolder);
public:
LirSQLiteWriter(Spyder3ImageWriter* _camWriter, ISensor* _sensor, string outputDirectory);
~LirSQLiteWriter();
virtual void sensorStarting();
void startLogging();
virtual void processReading(const SensorReadingSet& set);
void stopLogging();
virtual void sensorStopping();
void changeFolder(string outputFolder);
};
#endif