14 call_lmdb_func(
"mdb_cursor_open", mdb_cursor_open, tx->underlying(), db->underlying(), &_cursor);
17LMDBCursor::~LMDBCursor()
22MDB_cursor* LMDBCursor::underlying()
const
27const MDB_dbi& LMDBCursor::underlying_db()
const
29 return _db->underlying();
32MDB_txn* LMDBCursor::underlying_tx()
const
34 return _tx->underlying();
37uint64_t LMDBCursor::id()
const
42bool LMDBCursor::set_at_key(
Key&
key)
const
45 return lmdb_queries::set_at_key(*
this,
key);
48bool LMDBCursor::set_at_key_gte(
Key&
key)
const
51 return lmdb_queries::set_at_key_gte(*
this,
key);
54bool LMDBCursor::set_at_start()
const
57 return lmdb_queries::set_at_start(*
this);
60bool LMDBCursor::set_at_end()
const
63 return lmdb_queries::set_at_end(*
this);
69 if (_db->duplicate_keys_permitted()) {
70 return lmdb_queries::read_next_dup(*
this, keyValuePairs, numKeysToRead);
72 return lmdb_queries::read_next(*
this, keyValuePairs, numKeysToRead);
78 if (_db->duplicate_keys_permitted()) {
79 return lmdb_queries::read_prev_dup(*
this, keyValuePairs, numKeysToRead);
81 return lmdb_queries::read_prev(*
this, keyValuePairs, numKeysToRead);
84bool LMDBCursor::count_until_next(
const Key&
key, uint64_t& count)
const
87 if (_db->duplicate_keys_permitted()) {
88 return lmdb_queries::count_until_next_dup(*
this,
key, count);
90 return lmdb_queries::count_until_next(*
this,
key, count);
93bool LMDBCursor::count_until_prev(
const Key&
key, uint64_t& count)
const
96 if (_db->duplicate_keys_permitted()) {
97 return lmdb_queries::count_until_prev_dup(*
this,
key, count);
99 return lmdb_queries::count_until_prev(*
this,
key, count);
LMDBCursor(std::shared_ptr< LMDBReadTransaction > tx, std::shared_ptr< LMDBDatabase > db, uint64_t id)
std::shared_ptr< LMDBDatabase > SharedPtr
std::shared_ptr< LMDBReadTransaction > SharedPtr
std::vector< uint8_t > Key
std::vector< KeyValuesPair > KeyDupValuesVector
bool call_lmdb_func(int(*f)(TArgs...), TArgs... args)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept