From 9b2257d680a5e4fa2fda8cf3302f25054a06710e Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 28 Dec 2014 14:44:50 +0100 Subject: Buffers wrapped into entity buffer, async command progress tracking. --- common/resourceaccess.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'common/resourceaccess.h') 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: QString resourceName() const; bool isReady() const; - void sendCommand(int commandId); - void sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb); + //TODO use jobs + void sendCommand(int commandId, const std::function &callback = std::function()); + void sendCommand(int commandId, flatbuffers::FlatBufferBuilder &fbb, const std::function &callback); void synchronizeResource(const std::function &resultHandler); public Q_SLOTS: @@ -51,6 +52,7 @@ public Q_SLOTS: Q_SIGNALS: void ready(bool isReady); void revisionChanged(unsigned long long revision); + void commandCompleted(); private Q_SLOTS: //TODO: move these to the Private class @@ -59,9 +61,11 @@ private Q_SLOTS: void connectionError(QLocalSocket::LocalSocketError error); void readResourceMessage(); bool processMessageBuffer(); + void callCallbacks(int id); private: void log(const QString &message); + void registerCallback(uint messageId, const std::function &callback); class Private; Private * const d; -- cgit v1.2.3