summaryrefslogtreecommitdiffstats
path: root/common/resultset.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/resultset.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/resultset.h')
-rw-r--r--common/resultset.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/resultset.h b/common/resultset.h
index 88f7055..4e934fc 100644
--- a/common/resultset.h
+++ b/common/resultset.h
@@ -20,8 +20,8 @@
20 20
21#include <QVector> 21#include <QVector>
22#include <functional> 22#include <functional>
23#include "domain/applicationdomaintype.h"
24#include "metadata_generated.h" 23#include "metadata_generated.h"
24#include "entitybuffer.h"
25 25
26/* 26/*
27 * An iterator to a result set. 27 * An iterator to a result set.
@@ -31,7 +31,8 @@
31class ResultSet 31class ResultSet
32{ 32{
33public: 33public:
34 typedef std::function<bool(std::function<void(const Sink::ApplicationDomain::ApplicationDomainType::Ptr &, Sink::Operation)>)> ValueGenerator; 34 typedef std::function<void(const QByteArray &uid, const Sink::EntityBuffer &, Sink::Operation)> Callback;
35 typedef std::function<bool(Callback)> ValueGenerator;
35 typedef std::function<QByteArray()> IdGenerator; 36 typedef std::function<QByteArray()> IdGenerator;
36 typedef std::function<void()> SkipValue; 37 typedef std::function<void()> SkipValue;
37 38
@@ -42,7 +43,7 @@ public:
42 ResultSet(const ResultSet &other); 43 ResultSet(const ResultSet &other);
43 44
44 bool next(); 45 bool next();
45 bool next(std::function<bool(const Sink::ApplicationDomain::ApplicationDomainType::Ptr &value, Sink::Operation)> callback); 46 bool next(const Callback &callback);
46 47
47 void skip(int number); 48 void skip(int number);
48 49