26#include "transaction.h"
30template <
class K,
class V>
60 std::pair<K, V>
first();
61 std::pair<K, V>
last();
62 std::pair<K, V>
next();
63 std::pair<K, V>
prev();
64 std::pair<K, V>
current()
const;
65 bool set(
const K& target);
67 void first(K& key, V& value);
68 void last(K& key, V& value);
69 void next(K& key, V& value);
70 void prev(K& key, V& value);
71 void current(K& key, V& value)
const;
77 void operateCursorRead(K& key, V& value, MDB_cursor_op operation,
const std::string& methodName,
const std::string& operationName)
const;
85 inline static const std::string openCursorMethodName =
"Cursor::open";
86 inline static const std::string closeCursorMethodName =
"Cursor::close";
87 inline static const std::string renewCursorMethodName =
"Cursor::renew";
89 inline static const std::string firstMethodName =
"first";
90 inline static const std::string lastMethodName =
"last";
91 inline static const std::string nextMethodName =
"next";
92 inline static const std::string prevMethodName =
"prev";
93 inline static const std::string currentMethodName =
"current";
94 inline static const std::string setMethodName =
"set";
96 inline static const std::string firstOperationName =
"Cursor::first";
97 inline static const std::string lastOperationName =
"Cursor::last";
98 inline static const std::string nextOperationName =
"Cursor::next";
99 inline static const std::string prevOperationName =
"Cursor::prev";
100 inline static const std::string currentOperationName =
"Cursor::current";
An object to iterate storages.
Definition cursor.h:31
std::pair< K, V > first()
Queries the first element in the storage.
Definition cursor.hpp:500
void drop()
Turns cursor into an empty one, releasing resources.
Definition cursor.hpp:138
bool empty() const
Returns true if the cursor is empty.
Definition cursor.hpp:178
void renew()
Renews a cursor.
Definition cursor.hpp:278
~Cursor()
Destroys a cursor.
Definition cursor.hpp:124
void close()
Termiates a sequence of operations with the cursor.
Definition cursor.hpp:361
bool opened() const
Tells if the cursor is open.
Definition cursor.hpp:385
void open()
Opens the cursor for operations.
Definition cursor.hpp:204
std::pair< K, V > prev()
Queries the previous element from the storage.
Definition cursor.hpp:566
std::pair< K, V > last()
Queries the last element in the storage.
Definition cursor.hpp:518
std::pair< K, V > current() const
Returns current cursor element from the storage.
Definition cursor.hpp:586
bool set(const K &target)
Sets cursors to the defined position.
Definition cursor.hpp:605
Cursor()
Creates an empty cursor.
Definition cursor.hpp:66
std::pair< K, V > next()
Queries the next element from the storage.
Definition cursor.hpp:542
This is a basic key value storage.
Definition storage.h:134
Public read only transaction.
Definition transaction.h:26