Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::lmdblib::LMDBCursor Class Reference

#include <lmdb_cursor.hpp>

Public Types

using Ptr = std::unique_ptr< LMDBCursor >
 
using SharedPtr = std::shared_ptr< LMDBCursor >
 

Public Member Functions

 LMDBCursor (std::shared_ptr< LMDBReadTransaction > tx, std::shared_ptr< LMDBDatabase > db, uint64_t id)
 
 LMDBCursor (const LMDBCursor &other)=delete
 
 LMDBCursor (LMDBCursor &&other)=delete
 
LMDBCursoroperator= (const LMDBCursor &other)=delete
 
LMDBCursoroperator= (LMDBCursor &&other)=delete
 
 ~LMDBCursor ()
 
MDB_cursor * underlying () const
 
const MDB_dbi & underlying_db () const
 
MDB_txn * underlying_tx () const
 
uint64_t id () const
 
bool set_at_key (Key &key) const
 
bool set_at_key_gte (Key &key) const
 
bool set_at_start () const
 
bool set_at_end () const
 
bool read_next (uint64_t numKeysToRead, KeyDupValuesVector &keyValuePairs) const
 
bool read_prev (uint64_t numKeysToRead, KeyDupValuesVector &keyValuePairs) const
 
bool count_until_next (const Key &key, uint64_t &count) const
 
bool count_until_prev (const Key &key, uint64_t &count) const
 

Private Attributes

std::mutex _mtx
 
std::shared_ptr< LMDBReadTransaction_tx
 
std::shared_ptr< LMDBDatabase_db
 
uint64_t _id
 
MDB_cursor * _cursor
 

Detailed Description

Definition at line 10 of file lmdb_cursor.hpp.

Member Typedef Documentation

◆ Ptr

using bb::lmdblib::LMDBCursor::Ptr = std::unique_ptr<LMDBCursor>

Definition at line 12 of file lmdb_cursor.hpp.

◆ SharedPtr

Definition at line 13 of file lmdb_cursor.hpp.

Constructor & Destructor Documentation

◆ LMDBCursor() [1/3]

bb::lmdblib::LMDBCursor::LMDBCursor ( std::shared_ptr< LMDBReadTransaction tx,
std::shared_ptr< LMDBDatabase db,
uint64_t  id 
)

◆ LMDBCursor() [2/3]

bb::lmdblib::LMDBCursor::LMDBCursor ( const LMDBCursor other)
delete

◆ LMDBCursor() [3/3]

bb::lmdblib::LMDBCursor::LMDBCursor ( LMDBCursor &&  other)
delete

◆ ~LMDBCursor()

bb::lmdblib::LMDBCursor::~LMDBCursor ( )

Definition at line 17 of file lmdb_cursor.cpp.

Member Function Documentation

◆ count_until_next()

bool bb::lmdblib::LMDBCursor::count_until_next ( const Key key,
uint64_t &  count 
) const

Definition at line 84 of file lmdb_cursor.cpp.

◆ count_until_prev()

bool bb::lmdblib::LMDBCursor::count_until_prev ( const Key key,
uint64_t &  count 
) const

Definition at line 93 of file lmdb_cursor.cpp.

◆ id()

uint64_t bb::lmdblib::LMDBCursor::id ( ) const

Definition at line 37 of file lmdb_cursor.cpp.

◆ operator=() [1/2]

LMDBCursor & bb::lmdblib::LMDBCursor::operator= ( const LMDBCursor other)
delete

◆ operator=() [2/2]

LMDBCursor & bb::lmdblib::LMDBCursor::operator= ( LMDBCursor &&  other)
delete

◆ read_next()

bool bb::lmdblib::LMDBCursor::read_next ( uint64_t  numKeysToRead,
KeyDupValuesVector keyValuePairs 
) const

Definition at line 66 of file lmdb_cursor.cpp.

◆ read_prev()

bool bb::lmdblib::LMDBCursor::read_prev ( uint64_t  numKeysToRead,
KeyDupValuesVector keyValuePairs 
) const

Definition at line 75 of file lmdb_cursor.cpp.

◆ set_at_end()

bool bb::lmdblib::LMDBCursor::set_at_end ( ) const

Definition at line 60 of file lmdb_cursor.cpp.

◆ set_at_key()

bool bb::lmdblib::LMDBCursor::set_at_key ( Key key) const

Definition at line 42 of file lmdb_cursor.cpp.

◆ set_at_key_gte()

bool bb::lmdblib::LMDBCursor::set_at_key_gte ( Key key) const

Definition at line 48 of file lmdb_cursor.cpp.

◆ set_at_start()

bool bb::lmdblib::LMDBCursor::set_at_start ( ) const

Definition at line 54 of file lmdb_cursor.cpp.

◆ underlying()

MDB_cursor * bb::lmdblib::LMDBCursor::underlying ( ) const

Definition at line 22 of file lmdb_cursor.cpp.

◆ underlying_db()

const MDB_dbi & bb::lmdblib::LMDBCursor::underlying_db ( ) const

Definition at line 27 of file lmdb_cursor.cpp.

◆ underlying_tx()

MDB_txn * bb::lmdblib::LMDBCursor::underlying_tx ( ) const

Definition at line 32 of file lmdb_cursor.cpp.

Member Data Documentation

◆ _cursor

MDB_cursor* bb::lmdblib::LMDBCursor::_cursor
private

Definition at line 42 of file lmdb_cursor.hpp.

◆ _db

std::shared_ptr<LMDBDatabase> bb::lmdblib::LMDBCursor::_db
private

Definition at line 40 of file lmdb_cursor.hpp.

◆ _id

uint64_t bb::lmdblib::LMDBCursor::_id
private

Definition at line 41 of file lmdb_cursor.hpp.

◆ _mtx

std::mutex bb::lmdblib::LMDBCursor::_mtx
mutableprivate

Definition at line 38 of file lmdb_cursor.hpp.

◆ _tx

std::shared_ptr<LMDBReadTransaction> bb::lmdblib::LMDBCursor::_tx
private

Definition at line 39 of file lmdb_cursor.hpp.


The documentation for this class was generated from the following files: