diff options
Diffstat (limited to 'common/entityreader.cpp')
-rw-r--r-- | common/entityreader.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/entityreader.cpp b/common/entityreader.cpp index bd973d0..cca1511 100644 --- a/common/entityreader.cpp +++ b/common/entityreader.cpp | |||
@@ -145,14 +145,14 @@ template <class DomainType> | |||
145 | void EntityReader<DomainType>::query(const Sink::Query &query, const std::function<bool(const DomainType &)> &callback) | 145 | void EntityReader<DomainType>::query(const Sink::Query &query, const std::function<bool(const DomainType &)> &callback) |
146 | { | 146 | { |
147 | executeInitialQuery(query, 0, 0, | 147 | executeInitialQuery(query, 0, 0, |
148 | [&callback](const typename DomainType::Ptr &value, Sink::Operation operation) -> bool { | 148 | [&callback](const typename DomainType::Ptr &value, Sink::Operation operation, const QMap<QByteArray, QVariant> &) -> bool { |
149 | Q_ASSERT(operation == Sink::Operation_Creation); | 149 | Q_ASSERT(operation == Sink::Operation_Creation); |
150 | return callback(*value); | 150 | return callback(*value); |
151 | }); | 151 | }); |
152 | } | 152 | } |
153 | 153 | ||
154 | template <class DomainType> | 154 | template <class DomainType> |
155 | QPair<qint64, qint64> EntityReader<DomainType>::executeInitialQuery(const Sink::Query &query, int offset, int batchsize, const std::function<bool(const typename DomainType::Ptr &value, Sink::Operation operation)> &callback) | 155 | QPair<qint64, qint64> EntityReader<DomainType>::executeInitialQuery(const Sink::Query &query, int offset, int batchsize, const ResultCallback &callback) |
156 | { | 156 | { |
157 | QTime time; | 157 | QTime time; |
158 | time.start(); | 158 | time.start(); |
@@ -168,7 +168,7 @@ QPair<qint64, qint64> EntityReader<DomainType>::executeInitialQuery(const Sink:: | |||
168 | } | 168 | } |
169 | 169 | ||
170 | template <class DomainType> | 170 | template <class DomainType> |
171 | QPair<qint64, qint64> EntityReader<DomainType>::executeIncrementalQuery(const Sink::Query &query, qint64 lastRevision, const std::function<bool(const typename DomainType::Ptr &value, Sink::Operation operation)> &callback) | 171 | QPair<qint64, qint64> EntityReader<DomainType>::executeIncrementalQuery(const Sink::Query &query, qint64 lastRevision, const ResultCallback &callback) |
172 | { | 172 | { |
173 | QTime time; | 173 | QTime time; |
174 | time.start(); | 174 | time.start(); |
@@ -185,18 +185,18 @@ QPair<qint64, qint64> EntityReader<DomainType>::executeIncrementalQuery(const Si | |||
185 | } | 185 | } |
186 | 186 | ||
187 | template <class DomainType> | 187 | template <class DomainType> |
188 | qint64 EntityReader<DomainType>::replaySet(ResultSet &resultSet, int offset, int batchSize, const std::function<bool(const typename DomainType::Ptr &value, Sink::Operation operation)> &callback) | 188 | qint64 EntityReader<DomainType>::replaySet(ResultSet &resultSet, int offset, int batchSize, const ResultCallback &callback) |
189 | { | 189 | { |
190 | SinkTrace() << "Skipping over " << offset << " results"; | 190 | SinkTrace() << "Skipping over " << offset << " results"; |
191 | resultSet.skip(offset); | 191 | resultSet.skip(offset); |
192 | int counter = 0; | 192 | int counter = 0; |
193 | while (!batchSize || (counter < batchSize)) { | 193 | while (!batchSize || (counter < batchSize)) { |
194 | const bool ret = | 194 | const bool ret = |
195 | resultSet.next([this, &counter, callback](const QByteArray &uid, const Sink::EntityBuffer &value, Sink::Operation operation) -> bool { | 195 | resultSet.next([this, &counter, callback](const ResultSet::Result &result) -> bool { |
196 | counter++; | 196 | counter++; |
197 | auto adaptor = mDomainTypeAdaptorFactory.createAdaptor(value.entity()); | 197 | auto adaptor = mDomainTypeAdaptorFactory.createAdaptor(result.buffer.entity()); |
198 | Q_ASSERT(adaptor); | 198 | Q_ASSERT(adaptor); |
199 | return callback(QSharedPointer<DomainType>::create(mResourceInstanceIdentifier, uid, value.revision(), adaptor), operation); | 199 | return callback(QSharedPointer<DomainType>::create(mResourceInstanceIdentifier, result.uid, result.buffer.revision(), adaptor), result.operation, result.aggregateValues); |
200 | }); | 200 | }); |
201 | if (!ret) { | 201 | if (!ret) { |
202 | break; | 202 | break; |