summaryrefslogtreecommitdiffstats
path: root/common/resourceaccess.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/resourceaccess.h
parentf9379318d801df204cc50385c5eca1f28e91755e (diff)
parentce2fd2666f084eebe443598f6f3740a02913091e (diff)
downloadsink-3a3118e768e1447dc7524328e84b8d7faef81fe1.tar.gz
sink-3a3118e768e1447dc7524328e84b8d7faef81fe1.zip
Merge branch 'feature/notifications' into develop
Diffstat (limited to 'common/resourceaccess.h')
-rw-r--r--common/resourceaccess.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/common/resourceaccess.h b/common/resourceaccess.h
index 69d52b4..5d66246 100644
--- a/common/resourceaccess.h
+++ b/common/resourceaccess.h
@@ -29,6 +29,7 @@
29 29
30#include <flatbuffers/flatbuffers.h> 30#include <flatbuffers/flatbuffers.h>
31#include "notification.h" 31#include "notification.h"
32#include "log.h"
32 33
33namespace Sink { 34namespace Sink {
34 35
@@ -72,19 +73,28 @@ public:
72 return KAsync::null<void>(); 73 return KAsync::null<void>();
73 }; 74 };
74 75
76 int getResourceStatus() const
77 {
78 return mResourceStatus;
79 }
80
75signals: 81signals:
76 void ready(bool isReady); 82 void ready(bool isReady);
77 void revisionChanged(qint64 revision); 83 void revisionChanged(qint64 revision);
78 void notification(Notification revision); 84 void notification(Notification notification);
79 85
80public slots: 86public slots:
81 virtual void open() = 0; 87 virtual void open() = 0;
82 virtual void close() = 0; 88 virtual void close() = 0;
89
90protected:
91 int mResourceStatus;
83}; 92};
84 93
85class SINK_EXPORT ResourceAccess : public ResourceAccessInterface 94class SINK_EXPORT ResourceAccess : public ResourceAccessInterface
86{ 95{
87 Q_OBJECT 96 Q_OBJECT
97 SINK_DEBUG_AREA("communication")
88public: 98public:
89 typedef QSharedPointer<ResourceAccess> Ptr; 99 typedef QSharedPointer<ResourceAccess> Ptr;
90 100
@@ -130,6 +140,7 @@ private:
130 140
131 class Private; 141 class Private;
132 Private *const d; 142 Private *const d;
143 // SINK_DEBUG_COMPONENT(d->resourceInstanceIdentifier)
133}; 144};
134 145
135/** 146/**
@@ -137,8 +148,9 @@ private:
137 * 148 *
138 * This avoids constantly recreating connections, and should allow a single process to have one connection per resource. 149 * This avoids constantly recreating connections, and should allow a single process to have one connection per resource.
139 */ 150 */
140class ResourceAccessFactory 151class SINK_EXPORT ResourceAccessFactory
141{ 152{
153 SINK_DEBUG_AREA("ResourceAccessFactory")
142public: 154public:
143 static ResourceAccessFactory &instance(); 155 static ResourceAccessFactory &instance();
144 Sink::ResourceAccess::Ptr getAccess(const QByteArray &instanceIdentifier, const QByteArray resourceType); 156 Sink::ResourceAccess::Ptr getAccess(const QByteArray &instanceIdentifier, const QByteArray resourceType);