summaryrefslogtreecommitdiffstats
path: root/common/listener.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-11 11:55:29 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-07-11 11:55:29 +0200
commit3a3118e768e1447dc7524328e84b8d7faef81fe1 (patch)
treeaf5582170ed6164fffc9365f34b17bf449c0db40 /common/listener.h
parentf9379318d801df204cc50385c5eca1f28e91755e (diff)
parentce2fd2666f084eebe443598f6f3740a02913091e (diff)
downloadsink-3a3118e768e1447dc7524328e84b8d7faef81fe1.tar.gz
sink-3a3118e768e1447dc7524328e84b8d7faef81fe1.zip
Merge branch 'feature/notifications' into develop
Diffstat (limited to 'common/listener.h')
-rw-r--r--common/listener.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/common/listener.h b/common/listener.h
index 5e376c7..d6c537a 100644
--- a/common/listener.h
+++ b/common/listener.h
@@ -25,6 +25,7 @@
25#include <QPointer> 25#include <QPointer>
26#include <QLocalSocket> 26#include <QLocalSocket>
27#include <flatbuffers/flatbuffers.h> 27#include <flatbuffers/flatbuffers.h>
28#include <log.h>
28 29
29namespace Sink { 30namespace Sink {
30class Resource; 31class Resource;
@@ -54,6 +55,7 @@ public:
54class SINK_EXPORT Listener : public QObject 55class SINK_EXPORT Listener : public QObject
55{ 56{
56 Q_OBJECT 57 Q_OBJECT
58 SINK_DEBUG_AREA("communication")
57 59
58public: 60public:
59 Listener(const QByteArray &resourceName, const QByteArray &resourceType, QObject *parent = 0); 61 Listener(const QByteArray &resourceName, const QByteArray &resourceType, QObject *parent = 0);
@@ -81,17 +83,17 @@ private:
81 bool processClientBuffer(Client &client); 83 bool processClientBuffer(Client &client);
82 void sendCommandCompleted(QLocalSocket *socket, uint messageId, bool success); 84 void sendCommandCompleted(QLocalSocket *socket, uint messageId, bool success);
83 void updateClientsWithRevision(qint64); 85 void updateClientsWithRevision(qint64);
84 Sink::Resource *loadResource(); 86 Sink::Resource &loadResource();
85 void readFromSocket(QLocalSocket *socket); 87 void readFromSocket(QLocalSocket *socket);
86 qint64 lowerBoundRevision(); 88 qint64 lowerBoundRevision();
87 89
88 QLocalServer *m_server; 90 std::unique_ptr<QLocalServer> m_server;
89 QVector<Client> m_connections; 91 QVector<Client> m_connections;
90 flatbuffers::FlatBufferBuilder m_fbb; 92 flatbuffers::FlatBufferBuilder m_fbb;
91 const QByteArray m_resourceName; 93 const QByteArray m_resourceName;
92 const QByteArray m_resourceInstanceIdentifier; 94 const QByteArray m_resourceInstanceIdentifier;
93 Sink::Resource *m_resource; 95 std::unique_ptr<Sink::Resource> m_resource;
94 QTimer *m_clientBufferProcessesTimer; 96 std::unique_ptr<QTimer> m_clientBufferProcessesTimer;
95 QTimer *m_checkConnectionsTimer; 97 std::unique_ptr<QTimer> m_checkConnectionsTimer;
96 int m_messageId; 98 int m_messageId;
97}; 99};