summaryrefslogtreecommitdiffstats
path: root/common/entitybuffer.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-19 18:55:21 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-09-19 18:55:21 +0200
commit4a14a6fade947aa830d3f21598a4a6ba7316b933 (patch)
treec6b340bf1c6284e5501d371f65b58e3a69391a26 /common/entitybuffer.h
parent1deac558af4b1c9f04352ede7f8e172f11a70a6b (diff)
downloadsink-4a14a6fade947aa830d3f21598a4a6ba7316b933.tar.gz
sink-4a14a6fade947aa830d3f21598a4a6ba7316b933.zip
Refactored the query part of the entity reader into DataStoreQuery.
DataStoreQuery now encapsulates the low-level query that operates directly on the storage. It no longer has access to the resource buffers, and is instantiated by the type implementation, so we can specialize the query alogorithm per type, but not per resource. This will allow us to implement the threading queries for the mailtype.
Diffstat (limited to 'common/entitybuffer.h')
-rw-r--r--common/entitybuffer.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/common/entitybuffer.h b/common/entitybuffer.h
index 866a7d0..4162605 100644
--- a/common/entitybuffer.h
+++ b/common/entitybuffer.h
@@ -3,6 +3,7 @@
3#include "sink_export.h" 3#include "sink_export.h"
4#include <functional> 4#include <functional>
5#include <flatbuffers/flatbuffers.h> 5#include <flatbuffers/flatbuffers.h>
6#include "metadata_generated.h"
6#include <QByteArray> 7#include <QByteArray>
7 8
8namespace Sink { 9namespace Sink {
@@ -16,9 +17,12 @@ public:
16 const uint8_t *resourceBuffer(); 17 const uint8_t *resourceBuffer();
17 const uint8_t *metadataBuffer(); 18 const uint8_t *metadataBuffer();
18 const uint8_t *localBuffer(); 19 const uint8_t *localBuffer();
19 const Entity &entity(); 20 const Entity &entity() const;
20 bool isValid() const; 21 bool isValid() const;
21 22
23 Sink::Operation operation() const;
24 qint64 revision() const;
25
22 static void extractResourceBuffer(void *dataValue, int dataSize, const std::function<void(const uint8_t *, size_t size)> &handler); 26 static void extractResourceBuffer(void *dataValue, int dataSize, const std::function<void(const uint8_t *, size_t size)> &handler);
23 /* 27 /*
24 * TODO: Ideally we would be passing references to vectors in the same bufferbuilder, to avoid needlessly copying data. 28 * TODO: Ideally we would be passing references to vectors in the same bufferbuilder, to avoid needlessly copying data.