-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrequestcontroller.h
More file actions
51 lines (48 loc) · 948 Bytes
/
Copy pathrequestcontroller.h
File metadata and controls
51 lines (48 loc) · 948 Bytes
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
51
#ifndef REQUESTCONTROLLER_H
#define REQUESTCONTROLLER_H
#include <QObject>
#include <QMutex>
#include <QList>
namespace DG{
class ClientSocket;
class MatrixStorage;
class UpdateThread;
}
namespace DG{
class RequestController: public QObject{
Q_OBJECT
private:
quint32 packetC;
quint32 ackC;
public:
static const quint8 maxQueueSize;
static const quint8 minQueueSize;
private:
bool paused;
private:
QList<UpdateThread*> threads;
private:
QMutex mutex;
private:
DG::ClientSocket* _socket;
DG::MatrixStorage* _storage;
public:
RequestController(DG::ClientSocket* socket, DG::MatrixStorage* storage);
private:
qint64 requestCount;
public:
void request();
private slots:
void rectAdded();
private:
int packetCount() const;
void _send();
public:
void addThread(DG::UpdateThread* thread);
void allThreadsAdded();
void acknowledged();
private:
void packetSent();
};
}
#endif // REQUESTCONTROLLER_H