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));
100template<
class K,
class V>
112template<
class K,
class V>
134template<
class K,
class V>
151template<
class K,
class V>
174template<
class K,
class V>
197template<
class K,
class V>
216template<
class K,
class V>
232template<
class K,
class V>
234 std::pair<K, V> result;
250template<
class K,
class V>
252 std::pair<K, V> result;
274template<
class K,
class V>
276 std::pair<K, V> result;
298template<
class K,
class V>
300 std::pair<K, V> result;
318template<
class K,
class V>
320 std::pair<K, V> result;
337template<
class K,
class V>
342 MDB_val mdbKey =
static_cast<Storage<K, V>*
>(storage)->keySerializer.setData(key);
343 int result =
static_cast<Storage<K, V>*
>(storage)->_mdbCursorSet(handle, mdbKey);
344 if (result == MDB_SUCCESS)
346 else if (result == MDB_NOTFOUND)
368template<
class K,
class V>
369void LMDBAL::Cursor<K, V>::operateCursorRead(
372 MDB_cursor_op operation,
373 const std::string& methodName,
374 const std::string& operationName
377 static_cast<Storage<K, V>*
>(storage)->throwCursorNotReady(methodName);
379 MDB_val mdbKey, mdbValue;
380 int result =
static_cast<Storage<K, V>*
>(storage)->_mdbCursorGet(handle, mdbKey, mdbValue, operation);
381 if (result != MDB_SUCCESS)
382 static_cast<Storage<K, V>*
>(storage)->throwNotFoundOrUnknown(result, operationName);
384 static_cast<Storage<K, V>*
>(storage)->keySerializer.deserialize(mdbKey, key);
385 static_cast<Storage<K, V>*
>(storage)->valueSerializer.deserialize(mdbValue, value);
387 if (state == openedPrivate)
388 static_cast<Storage<K, V>*
>(storage)->discoveredRecord(key, value);
390 static_cast<Storage<K, V>*
>(storage)->discoveredRecord(key, value,
static_cast<Storage<K, V>*
>(storage)->_mdbCursorTxn(handle));
static const std::string lastOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:88
bool empty() const
Returns true if the cursor is empty.
Definition cursorcommon.cpp:333
void reset()
A private method that turns cursor into an empty one.
Definition cursorcommon.cpp:113
static const std::string lastMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:81
@ closed
Definition cursorcommon.h:35
static const std::string currentOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:91
static const std::string prevMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:83
static const std::string currentMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:84
static const std::string nextOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:89
static const std::string firstMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:80
CursorCommon()
Creates a empty class.
Definition cursorcommon.cpp:41
void close()
Termiates a sequence of operations with the cursor.
Definition cursorcommon.cpp:161
static const std::string firstOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:87
static const std::string nextMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:82
static const std::string prevOperationName
member function name, just for exceptions in heir
Definition cursorcommon.h:90
static const std::string setMethodName
member function name, just for exceptions in heir
Definition cursorcommon.h:85
An object to iterate storages.
Definition cursor.h:32
std::pair< K, V > first()
Queries the first element in the storage.
Definition cursor.hpp:233
void drop()
Turns cursor into an empty one, releasing resources.
Definition cursor.hpp:113
~Cursor()
Destroys this cursor.
Definition cursor.hpp:101
std::pair< K, V > prev()
Queries the previous element from the storage.
Definition cursor.hpp:299
std::pair< K, V > last()
Queries the last element in the storage.
Definition cursor.hpp:251
std::pair< K, V > current() const
Returns current cursor element from the storage.
Definition cursor.hpp:319
bool set(const K &target)
Sets cursors to the defined position.
Definition cursor.hpp:338
Cursor()
Creates an empty cursor.
Definition cursor.hpp:62
std::pair< K, V > next()
Queries the next element from the storage.
Definition cursor.hpp:275
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