summaryrefslogtreecommitdiffstats
path: root/common/resourceaccess.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/resourceaccess.h')
-rw-r--r--common/resourceaccess.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/resourceaccess.h b/common/resourceaccess.h
index 7416b25..d79c993 100644
--- a/common/resourceaccess.h
+++ b/common/resourceaccess.h
@@ -40,8 +40,9 @@ public:
40 QString resourceName() const; 40 QString resourceName() const;
41 bool isReady() const; 41 bool isReady() const;
42 42
43 void sendCommand(int commandId); 43 //TODO use jobs
44 void sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb); 44 void sendCommand(int commandId, const std::function<void()> &callback = std::function<void()>());
45 void sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb, const std::function<void()> &callback);
45 void synchronizeResource(const std::function<void()> &resultHandler); 46 void synchronizeResource(const std::function<void()> &resultHandler);
46 47
47public Q_SLOTS: 48public Q_SLOTS:
@@ -51,6 +52,7 @@ public Q_SLOTS:
51Q_SIGNALS: 52Q_SIGNALS:
52 void ready(bool isReady); 53 void ready(bool isReady);
53 void revisionChanged(unsigned long long revision); 54 void revisionChanged(unsigned long long revision);
55 void commandCompleted();
54 56
55private Q_SLOTS: 57private Q_SLOTS:
56 //TODO: move these to the Private class 58 //TODO: move these to the Private class
@@ -59,9 +61,11 @@ private Q_SLOTS:
59 void connectionError(QLocalSocket::LocalSocketError error); 61 void connectionError(QLocalSocket::LocalSocketError error);
60 void readResourceMessage(); 62 void readResourceMessage();
61 bool processMessageBuffer(); 63 bool processMessageBuffer();
64 void callCallbacks(int id);
62 65
63private: 66private:
64 void log(const QString &message); 67 void log(const QString &message);
68 void registerCallback(uint messageId, const std::function<void()> &callback);
65 69
66 class Private; 70 class Private;
67 Private * const d; 71 Private * const d;