diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-10 01:18:34 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-08-10 01:18:55 +0200 |
commit | 51c4e476cdde1eedb73dd1e0f0aa89e3d76292fc (patch) | |
tree | 9782792dc6d90918311a038cb81dffbdb02822b1 | |
parent | bee6d7d793732d4ebbcb7f48b7622bd124f22f13 (diff) | |
download | sink-51c4e476cdde1eedb73dd1e0f0aa89e3d76292fc.tar.gz sink-51c4e476cdde1eedb73dd1e0f0aa89e3d76292fc.zip |
const scan and public default ctor
-rw-r--r-- | common/storage.h | 4 | ||||
-rw-r--r-- | common/storage_lmdb.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/common/storage.h b/common/storage.h index 77f11f9..fd35274 100644 --- a/common/storage.h +++ b/common/storage.h | |||
@@ -54,6 +54,7 @@ public: | |||
54 | class Transaction | 54 | class Transaction |
55 | { | 55 | { |
56 | public: | 56 | public: |
57 | Transaction(); | ||
57 | ~Transaction(); | 58 | ~Transaction(); |
58 | bool commit(const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>()); | 59 | bool commit(const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>()); |
59 | void abort(); | 60 | void abort(); |
@@ -79,7 +80,7 @@ public: | |||
79 | */ | 80 | */ |
80 | int scan(const QByteArray &k, | 81 | int scan(const QByteArray &k, |
81 | const std::function<bool(const QByteArray &key, const QByteArray &value)> &resultHandler, | 82 | const std::function<bool(const QByteArray &key, const QByteArray &value)> &resultHandler, |
82 | const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>()); | 83 | const std::function<void(const Storage::Error &error)> &errorHandler = std::function<void(const Storage::Error &error)>()) const; |
83 | 84 | ||
84 | Transaction(Transaction&& other) : d(other.d) | 85 | Transaction(Transaction&& other) : d(other.d) |
85 | { | 86 | { |
@@ -96,7 +97,6 @@ public: | |||
96 | Transaction& operator=(Transaction& other); | 97 | Transaction& operator=(Transaction& other); |
97 | friend Storage; | 98 | friend Storage; |
98 | class Private; | 99 | class Private; |
99 | Transaction(); | ||
100 | Transaction(Private*); | 100 | Transaction(Private*); |
101 | Private *d; | 101 | Private *d; |
102 | }; | 102 | }; |
diff --git a/common/storage_lmdb.cpp b/common/storage_lmdb.cpp index 230409f..d3c52b7 100644 --- a/common/storage_lmdb.cpp +++ b/common/storage_lmdb.cpp | |||
@@ -165,7 +165,7 @@ bool Storage::Transaction::write(const QByteArray &sKey, const QByteArray &sValu | |||
165 | 165 | ||
166 | int Storage::Transaction::scan(const QByteArray &k, | 166 | int Storage::Transaction::scan(const QByteArray &k, |
167 | const std::function<bool(const QByteArray &key, const QByteArray &value)> &resultHandler, | 167 | const std::function<bool(const QByteArray &key, const QByteArray &value)> &resultHandler, |
168 | const std::function<void(const Storage::Error &error)> &errorHandler) | 168 | const std::function<void(const Storage::Error &error)> &errorHandler) const |
169 | { | 169 | { |
170 | if (!d || !d->transaction) { | 170 | if (!d || !d->transaction) { |
171 | Error error(d->name.toLatin1(), ErrorCodes::NotOpen, "Not open"); | 171 | Error error(d->name.toLatin1(), ErrorCodes::NotOpen, "Not open"); |