summaryrefslogtreecommitdiffstats
path: root/pica-client/nodes.h
blob: edbf5e07d082d23d815a221b8fa7b21c59d135b7 (plain) (blame)
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
#ifndef NODES_H
#define NODES_H

#include <QList>
#include <QString>
#include <QtSql>
#include <QSqlDatabase>

class Nodes
{
public:
	struct NodeRecord
	{
		QString address;
		quint16 port;
	};

	Nodes(QString storage);
	void Add(NodeRecord &n);
	QList<NodeRecord> GetNodes();
	void MakeClean();//remove old inactive node records
	void UpdateStatus(NodeRecord &n, bool alive);

private:
	QSqlDatabase dbconn;
	QSqlError lasterr;

};

#endif // NODES_H