summaryrefslogtreecommitdiffstats
path: root/common/index.h
diff options
context:
space:
mode:
authorRémi Nicole <nicole@kolabsystems.com>2018-07-27 13:32:40 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-07-27 13:47:50 +0200
commit620c4f551d3de830a516475ad02965695cb25945 (patch)
tree5839f93daf4718113b8160248cb22db4f0810b15 /common/index.h
parentd1838e575baeb6cd08011645609516acbdabd6c8 (diff)
downloadsink-620c4f551d3de830a516475ad02965695cb25945.tar.gz
sink-620c4f551d3de830a516475ad02965695cb25945.zip
Use Key API in indexes
Summary: - Only in TypeIndex, not in Index (since we might want to store something other than identifiers as values) - We might want to do the same in the `SynchronizerStore` for localId ↔ remoteId indexes Depends on D13735 Some quick benchmarks (against develop and D13735): {F6022279} Reviewers: cmollekopf Reviewed By: cmollekopf Tags: #sink Differential Revision: https://phabricator.kde.org/D13902
Diffstat (limited to 'common/index.h')
-rw-r--r--common/index.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/index.h b/common/index.h
index 492319e..833701e 100644
--- a/common/index.h
+++ b/common/index.h
@@ -6,6 +6,7 @@
6#include <QString> 6#include <QString>
7#include "storage.h" 7#include "storage.h"
8#include "log.h" 8#include "log.h"
9#include "storage/key.h"
9 10
10/** 11/**
11 * An index for value pairs. 12 * An index for value pairs.
@@ -35,7 +36,9 @@ public:
35 Index(const QByteArray &name, Sink::Storage::DataStore::Transaction &); 36 Index(const QByteArray &name, Sink::Storage::DataStore::Transaction &);
36 37
37 void add(const QByteArray &key, const QByteArray &value); 38 void add(const QByteArray &key, const QByteArray &value);
39 void add(const Sink::Storage::Identifier &key, const QByteArray &value);
38 void remove(const QByteArray &key, const QByteArray &value); 40 void remove(const QByteArray &key, const QByteArray &value);
41 void remove(const Sink::Storage::Identifier &key, const QByteArray &value);
39 42
40 void lookup(const QByteArray &key, const std::function<void(const QByteArray &value)> &resultHandler, const std::function<void(const Error &error)> &errorHandler, 43 void lookup(const QByteArray &key, const std::function<void(const QByteArray &value)> &resultHandler, const std::function<void(const Error &error)> &errorHandler,
41 bool matchSubStringKeys = false); 44 bool matchSubStringKeys = false);