summaryrefslogtreecommitdiffstats
path: root/pica-client/nodes.h
blob: a24fed219a88726ff1370c64a64e88647efd71b0 (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