49template<
class K,
class V>
61template<
class K,
class V>
69template<
class K,
class V>
82template<
class K,
class V>
84 if (!
empty() && other.empty())
87 CursorCommon::operator=(std::move(other));
101template<
class K,
class V>
102Cursor<K, V>::~Cursor() {
115template<
class K,
class V>
137template<
class K,
class V>
154template<
class K,
class V>
177template<
class K,
class V>
200template<
class K,
class V>
219template<
class K,
class V>
235template<
class K,
class V>
237 std::pair<K, V> result;
253template<
class K,
class V>
255 std::pair<K, V> result;
277template<
class K,
class V>
279 std::pair<K, V> result;
301template<
class K,
class V>
303 std::pair<K, V> result;
321template<
class K,
class V>
323 std::pair<K, V> result;
340template<
class K,
class V>
345 MDB_val mdbKey =
static_cast<Storage<K, V>*
>(storage)->keySerializer.setData(key);
346 int result =
static_cast<Storage<K, V>*
>(storage)->_mdbCursorSet(handle, mdbKey);
347 if (result == MDB_SUCCESS)
349 else if (result == MDB_NOTFOUND)
371template<
class K,
class V>
372void LMDBAL::Cursor<K, V>::operateCursorRead(
375 MDB_cursor_op operation,
376 std::string_view methodName,
377 std::string_view operationName
380 static_cast<Storage<K, V>*
>(storage)->throwCursorNotReady(methodName);
382 MDB_val mdbKey, mdbValue;
383 int result =
static_cast<Storage<K, V>*
>(storage)->_mdbCursorGet(handle, mdbKey, mdbValue, operation);
384 if (result != MDB_SUCCESS)
385 static_cast<Storage<K, V>*
>(storage)->throwNotFoundOrUnknown(result, operationName);
387 static_cast<Storage<K, V>*
>(storage)->keySerializer.deserialize(mdbKey, key);
388 static_cast<Storage<K, V>*
>(storage)->valueSerializer.deserialize(mdbValue, value);
390 if (state == openedPrivate)
391 static_cast<Storage<K, V>*
>(storage)->discoveredRecord(key, value);
393 static_cast<Storage<K, V>*
>(storage)->discoveredRecord(key, value,
static_cast<Storage<K, V>*
>(storage)->_mdbCursorTxn(handle));
bool empty() const
Returns true if the cursor is empty.
Definition cursorcommon.cpp:333
static constexpr std::string_view nextMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:83
void reset()
A private method that turns cursor into an empty one.
Definition cursorcommon.cpp:113
static constexpr std::string_view lastOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:89
@ closed
Definition cursorcommon.h:36
static constexpr std::string_view prevMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:84
static constexpr std::string_view nextOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:90
static constexpr std::string_view setMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:86
static constexpr std::string_view lastMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:82
static constexpr std::string_view firstOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:88
static constexpr std::string_view prevOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:91
CursorCommon()
Creates a empty class.
Definition cursorcommon.cpp:41
void close()
Termiates a sequence of operations with the cursor.
Definition cursorcommon.cpp:161
static constexpr std::string_view currentOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:92
static constexpr std::string_view firstMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:81
static constexpr std::string_view currentMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:85
An object to iterate storages.
Definition cursor.h:33
std::pair< K, V > first()
Queries the first element in the storage.
Definition cursor.hpp:236
void drop()
Turns cursor into an empty one, releasing resources.
Definition cursor.hpp:116
std::pair< K, V > prev()
Queries the previous element from the storage.
Definition cursor.hpp:302
std::pair< K, V > last()
Queries the last element in the storage.
Definition cursor.hpp:254
std::pair< K, V > current() const
Returns current cursor element from the storage.
Definition cursor.hpp:322
bool set(const K &target)
Sets cursors to the defined position.
Definition cursor.hpp:341
Cursor()
Creates an empty cursor.
Definition cursor.hpp:62
std::pair< K, V > next()
Queries the next element from the storage.
Definition cursor.hpp:278
This is a basic key value storage.
Definition storage.h:38
std::map< uint32_t, Cursor< K, V > * > cursors
a set of cursors that has been created under this storage
Definition storage.h:96
Destroys a cache.
Definition base.h:36