-
Notifications
You must be signed in to change notification settings - Fork 0
/
databasehandler.h
50 lines (42 loc) · 1.07 KB
/
databasehandler.h
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
42
43
44
45
46
47
48
49
50
#ifndef DATABASEHANDLER_H
#define DATABASEHANDLER_H
#include <string>
#include <opencv2/opencv.hpp>
#include <QObject>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
#include <QFile>
#include <QDir>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlRecord>
#include <QVariant>
#include <QDebug>
#include <QVector>
#include "utilTypes.h"
#include "TSC/bubble/bubbleprocess.h"
class DatabaseHandler : public QObject
{
Q_OBJECT
public:
DatabaseHandler();
explicit DatabaseHandler(string conn_name);
bool openDB(string file);
bool createTables();
bool insertSSG(SSG& ssg);
bool insertFrame(FrameDesc frame_desc);
FrameDesc getFrame(int frame_nr);
vector<SSG> getAllSSGs();
vector<SSG> getAllSSGsNew();
bool isOpen();
void closeDB();
void setConnName(string conn_name);
vector<pair<NodeSig,int> > getNodeSigs(int ssg_id);
QByteArray mat2ByteArray(const Mat &image);
Mat byteArray2Mat(const QByteArray & byteArray);
private:
QString conn_name;
QSqlDatabase db;
signals:
public slots:
};
#endif // DATABASEHANDLER_H