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

Namespaces

namespace  lmdb_queries
 

Classes

struct  DBStats
 
class  LMDBCursor
 
class  LMDBDatabase
 
class  LMDBDatabaseCreationTransaction
 
class  LMDBEnvironment
 
class  LMDBReadTransaction
 
class  LMDBStore
 
class  LMDBStoreBase
 
class  LMDBTransaction
 
class  LMDBWriteTransaction
 

Typedefs

using Key = std::vector< uint8_t >
 
using Value = std::vector< uint8_t >
 
using KeysVector = std::vector< Key >
 
using ValuesVector = std::vector< Value >
 
using KeyValuesPair = std::pair< Key, ValuesVector >
 
using OptionalValues = std::optional< ValuesVector >
 
using OptionalValuesVector = std::vector< OptionalValues >
 
using KeyDupValuesVector = std::vector< KeyValuesPair >
 
using KeyOptionalValuesPair = std::pair< Key, OptionalValues >
 
using KeyOptionalValuesVector = std::vector< KeyOptionalValuesPair >
 

Enumerations

enum  TransactionState { OPEN , COMMITTED , ABORTED }
 

Functions

std::string random_string ()
 
std::string random_temp_directory ()
 
std::vector< uint8_t > serialise (std::string key)
 
Key get_key (int64_t keyCount)
 
Value get_value (int64_t keyCount, int64_t valueCount)
 
void throw_error (const std::string &errorString, int error)
 
std::vector< uint8_t > serialise_key (uint8_t key)
 
void deserialise_key (void *data, uint8_t &key)
 
std::vector< uint8_t > serialise_key (uint64_t key)
 
void deserialise_key (void *data, uint64_t &key)
 
std::vector< uint8_t > serialise_key (const uint256_t &key)
 
void deserialise_key (void *data, uint256_t &key)
 
int size_cmp (const MDB_val *a, const MDB_val *b)
 
std::vector< uint8_t > mdb_val_to_vector (const MDB_val &dbVal)
 
void copy_to_vector (const MDB_val &dbVal, std::vector< uint8_t > &target)
 
template<typename T >
int value_cmp (const MDB_val *a, const MDB_val *b)
 
template<typename... TArgs>
bool call_lmdb_func (int(*f)(TArgs...), TArgs... args)
 
template<typename... TArgs>
int call_lmdb_func_with_return (int(*f)(TArgs...), TArgs... args)
 
template<typename... TArgs>
void call_lmdb_func (const std::string &errorString, int(*f)(TArgs...), TArgs... args)
 
template<typename... TArgs>
void call_lmdb_func (void(*f)(TArgs...), TArgs... args)
 

Variables

const uint32_t NUM_VALUES = 1024
 
auto & engine = numeric::get_debug_randomness()
 
auto & random_engine = numeric::get_randomness()
 

Typedef Documentation

◆ Key

using bb::lmdblib::Key = typedef std::vector<uint8_t>

Definition at line 11 of file types.hpp.

◆ KeyDupValuesVector

using bb::lmdblib::KeyDupValuesVector = typedef std::vector<KeyValuesPair>

Definition at line 18 of file types.hpp.

◆ KeyOptionalValuesPair

Definition at line 19 of file types.hpp.

◆ KeyOptionalValuesVector

Definition at line 20 of file types.hpp.

◆ KeysVector

using bb::lmdblib::KeysVector = typedef std::vector<Key>

Definition at line 13 of file types.hpp.

◆ KeyValuesPair

using bb::lmdblib::KeyValuesPair = typedef std::pair<Key, ValuesVector>

Definition at line 15 of file types.hpp.

◆ OptionalValues

Definition at line 16 of file types.hpp.

◆ OptionalValuesVector

using bb::lmdblib::OptionalValuesVector = typedef std::vector<OptionalValues>

Definition at line 17 of file types.hpp.

◆ Value

using bb::lmdblib::Value = typedef std::vector<uint8_t>

Definition at line 12 of file types.hpp.

◆ ValuesVector

using bb::lmdblib::ValuesVector = typedef std::vector<Value>

Definition at line 14 of file types.hpp.

Enumeration Type Documentation

◆ TransactionState

Enumerator
OPEN 
COMMITTED 
ABORTED 

Definition at line 16 of file lmdb_transaction.hpp.

Function Documentation

◆ call_lmdb_func() [1/3]

template<typename... TArgs>
void bb::lmdblib::call_lmdb_func ( const std::string &  errorString,
int(*)(TArgs...)  f,
TArgs...  args 
)

Definition at line 49 of file lmdb_helpers.hpp.

◆ call_lmdb_func() [2/3]

template<typename... TArgs>
bool bb::lmdblib::call_lmdb_func ( int(*)(TArgs...)  f,
TArgs...  args 
)

Definition at line 38 of file lmdb_helpers.hpp.

◆ call_lmdb_func() [3/3]

template<typename... TArgs>
void bb::lmdblib::call_lmdb_func ( void(*)(TArgs...)  f,
TArgs...  args 
)

Definition at line 57 of file lmdb_helpers.hpp.

◆ call_lmdb_func_with_return()

template<typename... TArgs>
int bb::lmdblib::call_lmdb_func_with_return ( int(*)(TArgs...)  f,
TArgs...  args 
)

Definition at line 44 of file lmdb_helpers.hpp.

◆ copy_to_vector()

void bb::lmdblib::copy_to_vector ( const MDB_val &  dbVal,
std::vector< uint8_t > &  target 
)

Definition at line 78 of file lmdb_helpers.cpp.

◆ deserialise_key() [1/3]

void bb::lmdblib::deserialise_key ( void *  data,
uint256_t key 
)

Definition at line 59 of file lmdb_helpers.cpp.

◆ deserialise_key() [2/3]

void bb::lmdblib::deserialise_key ( void *  data,
uint64_t &  key 
)

Definition at line 45 of file lmdb_helpers.cpp.

◆ deserialise_key() [3/3]

void bb::lmdblib::deserialise_key ( void *  data,
uint8_t &  key 
)

Definition at line 31 of file lmdb_helpers.cpp.

◆ get_key()

Key bb::lmdblib::get_key ( int64_t  keyCount)
inline

Definition at line 30 of file fixtures.hpp.

◆ get_value()

Value bb::lmdblib::get_value ( int64_t  keyCount,
int64_t  valueCount 
)
inline

Definition at line 35 of file fixtures.hpp.

◆ mdb_val_to_vector()

std::vector< uint8_t > bb::lmdblib::mdb_val_to_vector ( const MDB_val &  dbVal)

Definition at line 72 of file lmdb_helpers.cpp.

◆ random_string()

std::string bb::lmdblib::random_string ( )
inline

Definition at line 10 of file fixtures.hpp.

◆ random_temp_directory()

std::string bb::lmdblib::random_temp_directory ( )
inline

Definition at line 17 of file fixtures.hpp.

◆ serialise()

std::vector< uint8_t > bb::lmdblib::serialise ( std::string  key)
inline

Definition at line 24 of file fixtures.hpp.

◆ serialise_key() [1/3]

std::vector< uint8_t > bb::lmdblib::serialise_key ( const uint256_t key)

Definition at line 52 of file lmdb_helpers.cpp.

◆ serialise_key() [2/3]

std::vector< uint8_t > bb::lmdblib::serialise_key ( uint64_t  key)

Definition at line 38 of file lmdb_helpers.cpp.

◆ serialise_key() [3/3]

std::vector< uint8_t > bb::lmdblib::serialise_key ( uint8_t  key)

Definition at line 26 of file lmdb_helpers.cpp.

◆ size_cmp()

int bb::lmdblib::size_cmp ( const MDB_val *  a,
const MDB_val *  b 
)

Definition at line 64 of file lmdb_helpers.cpp.

◆ throw_error()

void bb::lmdblib::throw_error ( const std::string &  errorString,
int  error 
)

Definition at line 19 of file lmdb_helpers.cpp.

◆ value_cmp()

template<typename T >
int bb::lmdblib::value_cmp ( const MDB_val *  a,
const MDB_val *  b 
)

Definition at line 20 of file lmdb_helpers.hpp.

Variable Documentation

◆ engine

auto& bb::lmdblib::engine = numeric::get_debug_randomness()
inline

Definition at line 7 of file fixtures.hpp.

◆ NUM_VALUES

const uint32_t bb::lmdblib::NUM_VALUES = 1024

Definition at line 6 of file fixtures.hpp.

◆ random_engine

auto& bb::lmdblib::random_engine = numeric::get_randomness()
inline

Definition at line 8 of file fixtures.hpp.