Modules | |
exceptions and errors | |
slices and buffers | |
Classes | |
class | mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > |
The chunk of data stored inside the buffer or located outside it. More... | |
struct | mdbx::map_handle |
A handle for an individual database (key-value spaces) in the environment. More... | |
class | mdbx::env |
Unmanaged database environment. More... | |
class | mdbx::env_managed |
Managed database environment. More... | |
class | mdbx::txn |
Unmanaged database transaction. More... | |
class | mdbx::txn_managed |
Managed database transaction. More... | |
class | mdbx::cursor |
Unmanaged cursor. More... | |
class | mdbx::cursor_managed |
Managed cursor. More... | |
struct | std::hash<::mdbx::slice > |
Macros | |
#define | MDBX_STD_FILESYSTEM_PATH ::mdbx::filesystem::path |
Defined if mdbx::filesystem::path is available. More... | |
Typedefs | |
using | mdbx::byte = char8_t |
using | mdbx::version_info = ::MDBX_version_info |
libmdbx version information More... | |
using | mdbx::build_info = ::MDBX_build_info |
libmdbx build information More... | |
using | mdbx::legacy_allocator = ::std::string::allocator_type |
Legacy default allocator but it is recommended to use polymorphic_allocator. More... | |
using | mdbx::polymorphic_allocator = ::std::pmr::string::allocator_type |
Default polymorphic allocator for modern code. More... | |
using | mdbx::default_allocator = polymorphic_allocator |
using | mdbx::default_buffer = buffer< default_allocator, default_capacity_policy > |
Default buffer. More... | |
template<class ALLOCATOR = default_allocator> | |
using | mdbx::string = ::std::basic_string< char, ::std::char_traits< char >, ALLOCATOR > |
Default single-byte string. More... | |
using | mdbx::filehandle = ::mdbx_filehandle_t |
using | mdbx::path = ::mdbx::filesystem::path |
using | mdbx::duration = ::std::chrono::duration< unsigned, ::std::ratio< 1, 65536 > > |
Duration in 1/65536 units of second. More... | |
using | mdbx::comparator = ::MDBX_cmp_func * |
Enumerations | |
enum | mdbx::loop_control { mdbx::continue_loop = 0 , mdbx::exit_loop = INT32_MIN } |
Loop control constants for readers enumeration functor and other cases. More... | |
enum class | mdbx::key_mode { mdbx::usual = MDBX_DB_DEFAULTS , mdbx::reverse = MDBX_REVERSEKEY , mdbx::ordinal = MDBX_INTEGERKEY , mdbx::msgpack = -1 } |
Kinds of the keys and corresponding modes of comparing it. More... | |
enum class | mdbx::value_mode { mdbx::single = MDBX_DB_DEFAULTS , mdbx::multi , mdbx::multi_reverse , mdbx::multi_samelength , mdbx::multi_ordinal , mdbx::multi_reverse_samelength , mdbx::msgpack = -1 } |
Kind of the values and sorted multi-values with corresponding comparison. More... | |
enum | mdbx::put_mode { mdbx::insert_unique = MDBX_NOOVERWRITE , mdbx::upsert = MDBX_UPSERT , mdbx::update = MDBX_CURRENT } |
Key-value pairs put mode. More... | |
Functions | |
constexpr const version_info & | mdbx::get_version () noexcept |
Returns libmdbx version information. More... | |
constexpr const build_info & | mdbx::get_build () noexcept |
Returns libmdbx build information. More... | |
comparator | mdbx::default_comparator (key_mode mode) noexcept |
comparator | mdbx::default_comparator (value_mode mode) noexcept |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const slice &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const pair &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const pair_result &) |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
inline ::std::ostream & | mdbx::operator<< (::std::ostream &out, const buffer< ALLOCATOR, CAPACITY_POLICY > &it) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::geometry::size &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::geometry &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::operate_parameters &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::mode &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::durability &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::reclaiming_options &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env::operate_options &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const env_managed::create_parameters &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const MDBX_log_level_t &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const MDBX_debug_flags_t &) |
LIBMDBX_API ::std::ostream & | mdbx::operator<< (::std::ostream &, const error &) |
inline ::std::ostream & | mdbx::operator<< (::std::ostream &out, const MDBX_error_t &errcode) |
constexpr bool | mdbx::operator== (const error &a, const error &b) noexcept |
constexpr bool | mdbx::operator!= (const error &a, const error &b) noexcept |
constexpr bool | mdbx::operator== (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator< (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator> (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator<= (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator>= (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator!= (const slice &a, const slice &b) noexcept |
constexpr bool | mdbx::operator== (const env &a, const env &b) noexcept |
constexpr bool | mdbx::operator!= (const env &a, const env &b) noexcept |
constexpr bool | mdbx::operator== (const txn &a, const txn &b) noexcept |
constexpr bool | mdbx::operator!= (const txn &a, const txn &b) noexcept |
constexpr bool | mdbx::operator== (const cursor &a, const cursor &b) noexcept |
constexpr bool | mdbx::operator!= (const cursor &a, const cursor &b) noexcept |
ptrdiff_t | mdbx::estimate (const cursor &from, const cursor &to) |
string | std::to_string (const ::mdbx::slice &value) |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
string | std::to_string (const ::mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > &buffer) |
string | std::to_string (const ::mdbx::pair &value) |
string | std::to_string (const ::mdbx::env::geometry &value) |
string | std::to_string (const ::mdbx::env::operate_parameters &value) |
string | std::to_string (const ::mdbx::env::mode &value) |
string | std::to_string (const ::mdbx::env::durability &value) |
string | std::to_string (const ::mdbx::env::reclaiming_options &value) |
string | std::to_string (const ::mdbx::env::operate_options &value) |
string | std::to_string (const ::mdbx::env_managed::create_parameters &value) |
string | std::to_string (const ::MDBX_log_level_t &value) |
string | std::to_string (const ::MDBX_debug_flags_t &value) |
string | std::to_string (const ::mdbx::error &value) |
string | std::to_string (const ::MDBX_error_t &errcode) |
bool | mdbx::exception_thunk::is_clean () const noexcept |
void | mdbx::exception_thunk::capture () noexcept |
void | mdbx::exception_thunk::rethrow_captured () const |
constexpr | mdbx::error::error (MDBX_error_t error_code) noexcept |
constexpr bool | mdbx::error::is_success () const noexcept |
constexpr bool | mdbx::error::is_result_true () const noexcept |
constexpr bool | mdbx::error::is_result_false () const noexcept |
constexpr bool | mdbx::error::is_failure () const noexcept |
constexpr MDBX_error_t | mdbx::error::code () const noexcept |
Returns error code. More... | |
constexpr bool | mdbx::error::is_mdbx_error () const noexcept |
Returns true for MDBX's errors. More... | |
static void | mdbx::error::throw_exception (int error_code) |
void | mdbx::error::throw_on_failure () const |
void | mdbx::error::success_or_throw () const |
void | mdbx::error::success_or_throw (const exception_thunk &) const |
void | mdbx::error::panic_on_failure (const char *context_where, const char *func_who) const noexcept |
void | mdbx::error::success_or_panic (const char *context_where, const char *func_who) const noexcept |
static void | mdbx::error::throw_on_nullptr (const void *ptr, MDBX_error_t error_code) |
static void | mdbx::error::throw_on_failure (int error_code) |
static void | mdbx::error::success_or_throw (MDBX_error_t error_code) |
static bool | mdbx::error::boolean_or_throw (int error_code) |
static void | mdbx::error::success_or_throw (int error_code, const exception_thunk &) |
static void | mdbx::error::panic_on_failure (int error_code, const char *context_where, const char *func_who) noexcept |
static void | mdbx::error::success_or_panic (int error_code, const char *context_where, const char *func_who) noexcept |
constexpr | mdbx::slice::slice () noexcept |
Create an empty slice. More... | |
constexpr | mdbx::slice::slice (const void *ptr, size_t bytes) |
Create a slice that refers to [0,bytes-1] of memory bytes pointed by ptr. More... | |
constexpr | mdbx::slice::slice (const void *begin, const void *end) |
Create a slice that refers to [begin,end] of memory bytes. More... | |
constexpr | mdbx::slice::slice (const char *c_str) |
Create a slice that refers to c_str[0,strlen(c_str)-1]. More... | |
constexpr | mdbx::slice::slice (const MDBX_val &src) |
constexpr | mdbx::slice::slice (MDBX_val &&src) |
constexpr | mdbx::slice::slice (slice &&src) noexcept |
slice & | mdbx::slice::assign (const void *ptr, size_t bytes) |
slice & | mdbx::slice::assign (const slice &src) noexcept |
slice & | mdbx::slice::assign (const ::MDBX_val &src) |
slice & | mdbx::slice::assign (slice &&src) noexcept |
slice & | mdbx::slice::assign (::MDBX_val &&src) |
slice & | mdbx::slice::assign (const void *begin, const void *end) |
slice & | mdbx::slice::assign (const char *c_str) |
slice & | mdbx::slice::operator= (slice &&src) noexcept |
slice & | mdbx::slice::operator= (::MDBX_val &&src) |
void | mdbx::slice::swap (slice &other) noexcept |
constexpr const byte * | mdbx::slice::byte_ptr () const noexcept |
Returns casted to pointer to byte an address of data. More... | |
constexpr const byte * | mdbx::slice::end_byte_ptr () const noexcept |
Returns casted to pointer to byte an end of data. More... | |
constexpr byte * | mdbx::slice::byte_ptr () noexcept |
constexpr byte * | mdbx::slice::end_byte_ptr () noexcept |
constexpr const char * | mdbx::slice::char_ptr () const noexcept |
Returns casted to pointer to char an address of data. More... | |
constexpr const char * | mdbx::slice::end_char_ptr () const noexcept |
Returns casted to pointer to char an end of data. More... | |
constexpr char * | mdbx::slice::char_ptr () noexcept |
constexpr char * | mdbx::slice::end_char_ptr () noexcept |
constexpr const void * | mdbx::slice::data () const noexcept |
Return a pointer to the beginning of the referenced data. More... | |
constexpr const void * | mdbx::slice::end () const noexcept |
Return a pointer to the ending of the referenced data. More... | |
constexpr void * | mdbx::slice::data () noexcept |
constexpr void * | mdbx::slice::end () noexcept |
constexpr size_t | mdbx::slice::length () const noexcept |
Returns the number of bytes. More... | |
constexpr slice & | mdbx::slice::set_length (size_t bytes) |
Set slice length. More... | |
constexpr slice & | mdbx::slice::set_end (const void *ptr) |
Sets the length by specifying the end of the slice data. More... | |
constexpr bool | mdbx::slice::empty () const noexcept |
Checks whether the slice is empty. More... | |
constexpr bool | mdbx::slice::is_null () const noexcept |
Checks whether the slice data pointer is nullptr. More... | |
constexpr size_t | mdbx::slice::size () const noexcept |
Returns the number of bytes. More... | |
constexpr void | mdbx::slice::invalidate () noexcept |
Depletes content of slice and make it invalid. More... | |
constexpr void | mdbx::slice::clear () noexcept |
Makes the slice empty and referencing to nothing. More... | |
void | mdbx::slice::remove_prefix (size_t n) noexcept |
Drops the first "n" bytes from this slice. More... | |
void | mdbx::slice::safe_remove_prefix (size_t n) |
Drops the first "n" bytes from this slice. More... | |
void | mdbx::slice::remove_suffix (size_t n) noexcept |
Drops the last "n" bytes from this slice. More... | |
void | mdbx::slice::safe_remove_suffix (size_t n) |
Drops the last "n" bytes from this slice. More... | |
constexpr bool | mdbx::slice::starts_with (const slice &prefix) const noexcept |
Checks if the data starts with the given prefix. More... | |
constexpr bool | mdbx::slice::ends_with (const slice &suffix) const noexcept |
Checks if the data ends with the given suffix. More... | |
constexpr size_t | mdbx::slice::hash_value () const noexcept |
Returns the hash value of referenced data. More... | |
constexpr byte | mdbx::slice::operator[] (size_t n) const noexcept |
Returns the nth byte in the referenced data. More... | |
constexpr byte | mdbx::slice::at (size_t n) const |
Returns the nth byte in the referenced data with bounds checking. More... | |
constexpr slice | mdbx::slice::head (size_t n) const noexcept |
Returns the first "n" bytes of the slice. More... | |
constexpr slice | mdbx::slice::tail (size_t n) const noexcept |
Returns the last "n" bytes of the slice. More... | |
constexpr slice | mdbx::slice::middle (size_t from, size_t n) const noexcept |
Returns the middle "n" bytes of the slice. More... | |
constexpr slice | mdbx::slice::safe_head (size_t n) const |
Returns the first "n" bytes of the slice. More... | |
constexpr slice | mdbx::slice::safe_tail (size_t n) const |
Returns the last "n" bytes of the slice. More... | |
constexpr slice | mdbx::slice::safe_middle (size_t from, size_t n) const |
Returns the middle "n" bytes of the slice. More... | |
static constexpr intptr_t | mdbx::slice::compare_fast (const slice &a, const slice &b) noexcept |
Three-way fast non-lexicographically length-based comparison. More... | |
static constexpr intptr_t | mdbx::slice::compare_lexicographically (const slice &a, const slice &b) noexcept |
Three-way lexicographically comparison. More... | |
template<class ALLOCATOR = legacy_allocator> | |
string< ALLOCATOR > | mdbx::slice::as_hex_string (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const |
Returns a string with a hexadecimal dump of the slice content. More... | |
template<class ALLOCATOR = legacy_allocator> | |
string< ALLOCATOR > | mdbx::slice::as_base58_string (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const |
Returns a string with a Base58 dump of the slice content. More... | |
template<class ALLOCATOR = legacy_allocator> | |
string< ALLOCATOR > | mdbx::slice::as_base64_string (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const |
Returns a string with a Base58 dump of the slice content. More... | |
template<class ALLOCATOR = legacy_allocator, class CAPACITY_POLICY = default_capacity_policy> | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::slice::encode_hex (bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const |
Returns a buffer with a hexadecimal dump of the slice content. More... | |
template<class ALLOCATOR = legacy_allocator, class CAPACITY_POLICY = default_capacity_policy> | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::slice::encode_base58 (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const |
Returns a buffer with a Base58 dump of the slice content. More... | |
template<class ALLOCATOR = legacy_allocator, class CAPACITY_POLICY = default_capacity_policy> | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::slice::encode_base64 (unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const |
Returns a buffer with a Base64 dump of the slice content. More... | |
template<class ALLOCATOR = legacy_allocator, class CAPACITY_POLICY = default_capacity_policy> | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::slice::hex_decode (bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const |
Decodes hexadecimal dump from the slice content to returned buffer. More... | |
template<class ALLOCATOR = legacy_allocator, class CAPACITY_POLICY = default_capacity_policy> | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::slice::base58_decode (bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const |
Decodes Base58 dump from the slice content to returned buffer. More... | |
template<class ALLOCATOR = legacy_allocator, class CAPACITY_POLICY = default_capacity_policy> | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::slice::base64_decode (bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const |
Decodes Base64 dump from the slice content to returned buffer. More... | |
bool | mdbx::slice::is_hex (bool ignore_spaces=false) const noexcept |
Checks whether the content of the slice is a hexadecimal dump. More... | |
bool | mdbx::slice::is_base58 (bool ignore_spaces=false) const noexcept |
Checks whether the content of the slice is a Base58 dump. More... | |
bool | mdbx::slice::is_base64 (bool ignore_spaces=false) const noexcept |
Checks whether the content of the slice is a Base64 dump. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::buffer (const txn &txn, const struct slice &src, const allocator_type &allocator) | |
constexpr | mdbx::map_handle::info::info (map_handle::flags flags, map_handle::state state) noexcept |
constexpr ::mdbx::key_mode | mdbx::map_handle::info::key_mode () const noexcept |
constexpr ::mdbx::value_mode | mdbx::map_handle::info::value_mode () const noexcept |
constexpr | mdbx::env::env (MDBX_env *ptr) noexcept |
env & | mdbx::env::operator= (env &&other) noexcept |
mdbx::env::env (env &&other) noexcept | |
mdbx::env::~env () noexcept | |
constexpr | mdbx::env::operator const MDBX_env * () const |
constexpr | mdbx::env::operator MDBX_env * () |
geometry & | mdbx::env::geometry::make_fixed (intptr_t size) noexcept |
geometry & | mdbx::env::geometry::make_dynamic (intptr_t lower=minimal_value, intptr_t upper=maximal_value) noexcept |
static env::reclaiming_options | mdbx::env::operate_parameters::reclaiming_from_flags (MDBX_env_flags_t flags) noexcept |
static env::operate_options | mdbx::env::operate_parameters::options_from_flags (MDBX_env_flags_t flags) noexcept |
static size_t | mdbx::env::limits::pagesize_min () noexcept |
Returns the minimal database page size in bytes. More... | |
static size_t | mdbx::env::limits::pagesize_max () noexcept |
Returns the maximal database page size in bytes. More... | |
static size_t | mdbx::env::limits::dbsize_min (intptr_t pagesize) |
Returns the minimal database size in bytes for specified page size. More... | |
static size_t | mdbx::env::limits::dbsize_max (intptr_t pagesize) |
Returns the maximal database size in bytes for specified page size. More... | |
static size_t | mdbx::env::limits::key_min (MDBX_db_flags_t flags) noexcept |
Returns the minimal key size in bytes for specified database flags. More... | |
static size_t | mdbx::env::limits::key_min (key_mode mode) noexcept |
Returns the minimal key size in bytes for specified keys mode. More... | |
static size_t | mdbx::env::limits::key_max (intptr_t pagesize, MDBX_db_flags_t flags) |
Returns the maximal key size in bytes for specified page size and database flags. More... | |
static size_t | mdbx::env::limits::key_max (intptr_t pagesize, key_mode mode) |
Returns the maximal key size in bytes for specified page size and keys mode. More... | |
static size_t | mdbx::env::limits::key_max (const env &, MDBX_db_flags_t flags) |
Returns the maximal key size in bytes for given environment and database flags. More... | |
static size_t | mdbx::env::limits::key_max (const env &, key_mode mode) |
Returns the maximal key size in bytes for given environment and keys mode. More... | |
static size_t | mdbx::env::limits::value_min (MDBX_db_flags_t flags) noexcept |
Returns the minimal values size in bytes for specified database flags. More... | |
static size_t | mdbx::env::limits::value_min (value_mode) noexcept |
Returns the minimal values size in bytes for specified values mode. More... | |
static size_t | mdbx::env::limits::value_max (intptr_t pagesize, MDBX_db_flags_t flags) |
Returns the maximal value size in bytes for specified page size and database flags. More... | |
static size_t | mdbx::env::limits::value_max (intptr_t pagesize, value_mode) |
Returns the maximal value size in bytes for specified page size and values mode. More... | |
static size_t | mdbx::env::limits::value_max (const env &, MDBX_db_flags_t flags) |
Returns the maximal value size in bytes for given environment and database flags. More... | |
static size_t | mdbx::env::limits::value_max (const env &, value_mode) |
Returns the maximal value size in bytes for specified page size and values mode. More... | |
static size_t | mdbx::env::limits::pairsize4page_max (intptr_t pagesize, MDBX_db_flags_t flags) |
Returns maximal size of key-value pair to fit in a single page for specified size and database flags. More... | |
static size_t | mdbx::env::limits::pairsize4page_max (intptr_t pagesize, value_mode) |
Returns maximal size of key-value pair to fit in a single page for specified page size and values mode. More... | |
static size_t | mdbx::env::limits::pairsize4page_max (const env &, MDBX_db_flags_t flags) |
Returns maximal size of key-value pair to fit in a single page for given environment and database flags. More... | |
static size_t | mdbx::env::limits::pairsize4page_max (const env &, value_mode) |
Returns maximal size of key-value pair to fit in a single page for specified page size and values mode. More... | |
static size_t | mdbx::env::limits::valsize4page_max (intptr_t pagesize, MDBX_db_flags_t flags) |
Returns maximal data size in bytes to fit in a leaf-page or single overflow/large-page for specified size and database flags. More... | |
static size_t | mdbx::env::limits::valsize4page_max (intptr_t pagesize, value_mode) |
Returns maximal data size in bytes to fit in a leaf-page or single overflow/large-page for specified page size and values mode. More... | |
static size_t | mdbx::env::limits::valsize4page_max (const env &, MDBX_db_flags_t flags) |
Returns maximal data size in bytes to fit in a leaf-page or single overflow/large-page for given environment and database flags. More... | |
static size_t | mdbx::env::limits::valsize4page_max (const env &, value_mode) |
Returns maximal data size in bytes to fit in a leaf-page or single overflow/large-page for specified page size and values mode. More... | |
static size_t | mdbx::env::limits::transaction_size_max (intptr_t pagesize) |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for specified page size. More... | |
env::operate_parameters | mdbx::env::get_operation_parameters () const |
Returns current operation parameters. More... | |
env::mode | mdbx::env::get_mode () const |
Returns current operation mode. More... | |
env::durability | mdbx::env::get_durability () const |
Returns current durability mode. More... | |
env::reclaiming_options | mdbx::env::get_reclaiming () const |
Returns current reclaiming options. More... | |
env::operate_options | mdbx::env::get_options () const |
Returns current operate options. More... | |
stat | mdbx::env::get_stat () const |
Returns snapshot statistics about the MDBX environment. More... | |
stat | mdbx::env::get_stat (const txn &) const |
Return statistics about the MDBX environment accordingly to the specified transaction. More... | |
info | mdbx::env::get_info () const |
Return snapshot information about the MDBX environment. More... | |
info | mdbx::env::get_info (const txn &) const |
Return information about the MDBX environment accordingly to the specified transaction. More... | |
filehandle | mdbx::env::get_filehandle () const |
Returns the file descriptor for the DXB file of MDBX environment. More... | |
MDBX_env_flags_t | mdbx::env::get_flags () const |
Returns environment flags. More... | |
unsigned | mdbx::env::max_readers () const |
Returns the maximum number of threads/reader slots for the environment. More... | |
unsigned | mdbx::env::max_maps () const |
Returns the maximum number of named databases for the environment. More... | |
void * | mdbx::env::get_context () const noexcept |
Returns the application context associated with the environment. More... | |
env & | mdbx::env::set_context (void *your_context) |
Sets the application context associated with the environment. More... | |
env & | mdbx::env::set_sync_threshold (size_t bytes) |
Sets threshold to force flush the data buffers to disk, for non-sync durability modes. More... | |
size_t | mdbx::env::sync_threshold () const |
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | mdbx::env::set_sync_period__seconds_16dot16 (unsigned seconds_16dot16) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
unsigned | mdbx::env::sync_period__seconds_16dot16 () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | mdbx::env::set_sync_period__seconds_double (double seconds) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
double | mdbx::env::sync_period__seconds_double () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | mdbx::env::set_extra_option (extra_runtime_option option, uint64_t value) |
Sets the value of a extra runtime options for an environment. More... | |
uint64_t | mdbx::env::extra_option (extra_runtime_option option) const |
Gets the value of extra runtime options from an environment. More... | |
env & | mdbx::env::alter_flags (MDBX_env_flags_t flags, bool on_off) |
Alter environment flags. More... | |
env & | mdbx::env::set_geometry (const geometry &size) |
Set all size-related parameters of environment. More... | |
bool | mdbx::env::sync_to_disk (bool force=true, bool nonblock=false) |
Flush the environment data buffers. More... | |
void | mdbx::env::close_map (const map_handle &) |
Close a key-value map (aka sub-database) handle. Normally unnecessary. More... | |
constexpr | mdbx::env::reader_info::reader_info (int slot, mdbx_pid_t pid, mdbx_tid_t thread, uint64_t txnid, uint64_t lag, size_t used, size_t retained) noexcept |
template<typename VISITOR > | |
int | mdbx::env::enumerate_readers (VISITOR &visitor) |
Enumerate readers. More... | |
unsigned | mdbx::env::check_readers () |
Checks for stale readers in the lock table and return number of cleared slots. More... | |
env & | mdbx::env::set_HandleSlowReaders (MDBX_hsr_func *) |
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled. More... | |
MDBX_hsr_func * | mdbx::env::get_HandleSlowReaders () const noexcept |
Returns the current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled. More... | |
txn_managed | mdbx::env::start_read () const |
Starts read (read-only) transaction. More... | |
txn_managed | mdbx::env::prepare_read () const |
Creates but not start read transaction. More... | |
txn_managed | mdbx::env::start_write (bool dont_wait=false) |
Starts write (read-write) transaction. More... | |
txn_managed | mdbx::env::try_start_write () |
Tries to start write (read-write) transaction without blocking. More... | |
constexpr | mdbx::txn::txn (MDBX_txn *ptr) noexcept |
txn & | mdbx::txn::operator= (txn &&other) noexcept |
mdbx::txn::txn (txn &&other) noexcept | |
mdbx::txn::~txn () noexcept | |
constexpr | mdbx::txn::operator const MDBX_txn * () const |
constexpr | mdbx::txn::operator MDBX_txn * () |
void * | mdbx::txn::get_context () const noexcept |
Returns the application context associated with the transaction. More... | |
txn & | mdbx::txn::set_context (void *your_context) |
Sets the application context associated with the transaction. More... | |
bool | mdbx::txn::is_dirty (const void *ptr) const |
Checks whether the given data is on a dirty page. More... | |
inline ::mdbx::env | mdbx::txn::env () const noexcept |
Returns the transaction's environment. More... | |
MDBX_txn_flags_t | mdbx::txn::flags () const |
Returns transaction's flags. More... | |
uint64_t | mdbx::txn::id () const |
Return the transaction's ID. More... | |
void | mdbx::txn::reset_reading () |
Reset a read-only transaction. More... | |
void | mdbx::txn::renew_reading () |
Renew a read-only transaction. More... | |
info | mdbx::txn::get_info (bool scan_reader_lock_table=false) const |
Returns information about the MDBX transaction. More... | |
cursor_managed | mdbx::txn::open_cursor (map_handle map) const |
Opens cursor for specified key-value map handle. More... | |
map_handle | mdbx::txn::open_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const |
Open existing key-value map. More... | |
map_handle | mdbx::txn::open_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const |
Open existing key-value map. More... | |
map_handle | mdbx::txn::create_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) |
Create new or open existing key-value map. More... | |
map_handle | mdbx::txn::create_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) |
Create new or open existing key-value map. More... | |
void | mdbx::txn::drop_map (map_handle map) |
Drops key-value map using handle. More... | |
bool | mdbx::txn::drop_map (const ::std::string &name, bool throw_if_absent=false) |
Drop key-value map. More... | |
void | mdbx::txn::clear_map (map_handle map) |
Clear key-value map. More... | |
bool | mdbx::txn::clear_map (const ::std::string &name, bool throw_if_absent=false) |
map_stat | mdbx::txn::get_map_stat (map_handle map) const |
Returns statistics for a sub-database. More... | |
uint32_t | mdbx::txn::get_tree_deepmask (map_handle map) const |
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given database. More... | |
map_handle::info | mdbx::txn::get_handle_info (map_handle map) const |
Returns information about key-value map (aka sub-database) handle. More... | |
txn & | mdbx::txn::put_canary (const canary &) |
Set integers markers (aka "canary") associated with the environment. More... | |
canary | mdbx::txn::get_canary () const |
Returns fours integers markers (aka "canary") associated with the environment. More... | |
uint64_t | mdbx::txn::sequence (map_handle map) const |
uint64_t | mdbx::txn::sequence (map_handle map, uint64_t increment) |
Reads and increment sequence generator associated with a key-value map (aka sub-database). More... | |
int | mdbx::txn::compare_keys (map_handle map, const slice &a, const slice &b) const noexcept |
Compare two keys according to a particular key-value map (aka sub-database). More... | |
int | mdbx::txn::compare_values (map_handle map, const slice &a, const slice &b) const noexcept |
Compare two values according to a particular key-value map (aka sub-database). More... | |
int | mdbx::txn::compare_keys (map_handle map, const pair &a, const pair &b) const noexcept |
Compare keys of two pairs according to a particular key-value map (aka sub-database). More... | |
int | mdbx::txn::compare_values (map_handle map, const pair &a, const pair &b) const noexcept |
Compare values of two pairs according to a particular key-value map (aka sub-database). More... | |
slice | mdbx::txn::get (map_handle map, const slice &key) const |
Get value by key from a key-value map (aka sub-database). More... | |
slice | mdbx::txn::get (map_handle map, slice key, size_t &values_count) const |
Get first of multi-value and values count by key from a key-value multimap (aka sub-database). More... | |
slice | mdbx::txn::get (map_handle map, const slice &key, const slice &value_at_absence) const |
Get value by key from a key-value map (aka sub-database). More... | |
slice | mdbx::txn::get (map_handle map, slice key, size_t &values_count, const slice &value_at_absence) const |
Get first of multi-value and values count by key from a key-value multimap (aka sub-database). More... | |
pair_result | mdbx::txn::get_equal_or_great (map_handle map, const slice &key) const |
Get value for equal or great key from a database. More... | |
pair_result | mdbx::txn::get_equal_or_great (map_handle map, const slice &key, const slice &value_at_absence) const |
Get value for equal or great key from a database. More... | |
MDBX_error_t | mdbx::txn::put (map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | mdbx::txn::put (map_handle map, const slice &key, slice value, put_mode mode) |
void | mdbx::txn::insert (map_handle map, const slice &key, slice value) |
value_result | mdbx::txn::try_insert (map_handle map, const slice &key, slice value) |
slice | mdbx::txn::insert_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | mdbx::txn::try_insert_reserve (map_handle map, const slice &key, size_t value_length) |
void | mdbx::txn::upsert (map_handle map, const slice &key, const slice &value) |
slice | mdbx::txn::upsert_reserve (map_handle map, const slice &key, size_t value_length) |
void | mdbx::txn::update (map_handle map, const slice &key, const slice &value) |
bool | mdbx::txn::try_update (map_handle map, const slice &key, const slice &value) |
slice | mdbx::txn::update_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | mdbx::txn::try_update_reserve (map_handle map, const slice &key, size_t value_length) |
bool | mdbx::txn::erase (map_handle map, const slice &key) |
Removes all values for given key. More... | |
bool | mdbx::txn::erase (map_handle map, const slice &key, const slice &value) |
Removes the particular multi-value entry of the key. More... | |
void | mdbx::txn::replace (map_handle map, const slice &key, slice old_value, const slice &new_value) |
Replaces the particular multi-value of the key with a new value. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::txn::extract (map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Removes and return a value of the key. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::txn::replace (map_handle map, const slice &key, const slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Replaces and returns a value of the key with new one. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | mdbx::txn::replace_reserve (map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
void | mdbx::txn::append (map_handle map, const slice &key, const slice &value, bool multivalue_order_preserved=true) |
Adding a key-value pair, provided that ascending order of the keys and (optionally) values are preserved. More... | |
size_t | mdbx::txn::put_multiple (map_handle map, const slice &key, const size_t value_length, const void *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
ptrdiff_t | mdbx::txn::estimate (map_handle map, const pair &from, const pair &to) const |
ptrdiff_t | mdbx::txn::estimate (map_handle map, const slice &from, const slice &to) const |
ptrdiff_t | mdbx::txn::estimate_from_first (map_handle map, const slice &to) const |
ptrdiff_t | mdbx::txn::estimate_to_last (map_handle map, const slice &from) const |
constexpr | mdbx::cursor::cursor (MDBX_cursor *ptr) noexcept |
cursor_managed | mdbx::cursor::clone (void *your_context=nullptr) const |
void * | mdbx::cursor::get_context () const noexcept |
Returns the application context associated with the cursor. More... | |
cursor & | mdbx::cursor::set_context (void *your_context) |
Sets the application context associated with the cursor. More... | |
cursor & | mdbx::cursor::operator= (cursor &&other) noexcept |
mdbx::cursor::cursor (cursor &&other) noexcept | |
mdbx::cursor::~cursor () noexcept | |
constexpr | mdbx::cursor::operator const MDBX_cursor * () const |
constexpr | mdbx::cursor::operator MDBX_cursor * () |
mdbx::cursor::move_result::move_result (const cursor &cursor, bool throw_notfound) | |
mdbx::cursor::move_result::move_result (cursor &cursor, move_operation operation, const slice &key, const slice &value, bool throw_notfound) | |
bool | mdbx::cursor::move (move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const |
mdbx::cursor::estimate_result::estimate_result (const cursor &cursor, move_operation operation, const slice &key, const slice &value) | |
ptrdiff_t | mdbx::cursor::estimate (move_operation operation, MDBX_val *key, MDBX_val *value) const |
move_result | mdbx::cursor::move (move_operation operation, bool throw_notfound) |
move_result | mdbx::cursor::to_first (bool throw_notfound=true) |
move_result | mdbx::cursor::to_previous (bool throw_notfound=true) |
move_result | mdbx::cursor::to_previous_last_multi (bool throw_notfound=true) |
move_result | mdbx::cursor::to_current_first_multi (bool throw_notfound=true) |
move_result | mdbx::cursor::to_current_prev_multi (bool throw_notfound=true) |
move_result | mdbx::cursor::current (bool throw_notfound=true) const |
move_result | mdbx::cursor::to_current_next_multi (bool throw_notfound=true) |
move_result | mdbx::cursor::to_current_last_multi (bool throw_notfound=true) |
move_result | mdbx::cursor::to_next_first_multi (bool throw_notfound=true) |
move_result | mdbx::cursor::to_next (bool throw_notfound=true) |
move_result | mdbx::cursor::to_last (bool throw_notfound=true) |
move_result | mdbx::cursor::move (move_operation operation, const slice &key, bool throw_notfound) |
move_result | mdbx::cursor::find (const slice &key, bool throw_notfound=true) |
move_result | mdbx::cursor::lower_bound (const slice &key, bool throw_notfound=true) |
move_result | mdbx::cursor::move (move_operation operation, const slice &key, const slice &value, bool throw_notfound) |
move_result | mdbx::cursor::find_multivalue (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | mdbx::cursor::lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
bool | mdbx::cursor::seek (const slice &key) |
bool | mdbx::cursor::move (move_operation operation, slice &key, slice &value, bool throw_notfound) |
size_t | mdbx::cursor::count_multivalue () const |
Return count of duplicates for current key. More... | |
bool | mdbx::cursor::eof () const |
bool | mdbx::cursor::on_first () const |
bool | mdbx::cursor::on_last () const |
estimate_result | mdbx::cursor::estimate (const slice &key, const slice &value) const |
estimate_result | mdbx::cursor::estimate (const slice &key) const |
estimate_result | mdbx::cursor::estimate (move_operation operation) const |
void | mdbx::cursor::renew (const ::mdbx::txn &txn) |
Renew/bind a cursor with a new transaction and previously used key-value map handle. More... | |
void | mdbx::cursor::bind (const ::mdbx::txn &txn, ::mdbx::map_handle map_handle) |
Bind/renew a cursor with a new transaction and specified key-value map handle. More... | |
inline ::mdbx::txn | mdbx::cursor::txn () const |
Returns the cursor's transaction. More... | |
map_handle | mdbx::cursor::map () const |
MDBX_error_t | mdbx::cursor::put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | mdbx::cursor::insert (const slice &key, slice value) |
value_result | mdbx::cursor::try_insert (const slice &key, slice value) |
slice | mdbx::cursor::insert_reserve (const slice &key, size_t value_length) |
value_result | mdbx::cursor::try_insert_reserve (const slice &key, size_t value_length) |
void | mdbx::cursor::upsert (const slice &key, const slice &value) |
slice | mdbx::cursor::upsert_reserve (const slice &key, size_t value_length) |
void | mdbx::cursor::update (const slice &key, const slice &value) |
bool | mdbx::cursor::try_update (const slice &key, const slice &value) |
slice | mdbx::cursor::update_reserve (const slice &key, size_t value_length) |
value_result | mdbx::cursor::try_update_reserve (const slice &key, size_t value_length) |
bool | mdbx::cursor::erase (bool whole_multivalue=false) |
Removes single key-value pair or all multi-values at the current cursor position. More... | |
bool | mdbx::cursor::erase (const slice &key, bool whole_multivalue=true) |
Seeks and removes first value or whole multi-value of the given key. More... | |
bool | mdbx::cursor::erase (const slice &key, const slice &value) |
Seeks and removes the particular multi-value entry of the key. More... | |
class mdbx::buffer |
The chunk of data stored inside the buffer or located outside it.
Public Types | |
enum | : size_t { max_length = MDBX_MAXDATASIZE , max_capacity = (max_length / 3u * 4u + 1023u) & ~size_t(1023) , extra_inplace_storage = reservation_policy::extra_inplace_storage , pettiness_threshold = reservation_policy::pettiness_threshold } |
using | allocator_type = typename ::std::allocator_traits< ALLOCATOR >::template rebind_alloc< uint64_t > |
using | allocator_traits = ::std::allocator_traits< allocator_type > |
using | reservation_policy = CAPACITY_POLICY |
using | move_assign_alloc = allocation_aware_details::move_assign_alloc< silo, allocator_type > |
using | copy_assign_alloc = allocation_aware_details::copy_assign_alloc< silo, allocator_type > |
Public Member Functions | |
constexpr allocator_type | get_allocator () const |
Returns the associated allocator. More... | |
constexpr bool | is_freestanding () const noexcept |
Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer. More... | |
constexpr bool | is_reference () const noexcept |
Checks whether the buffer just refers to data located outside the buffer, rather than stores it. More... | |
constexpr size_t | capacity () const noexcept |
Returns the number of bytes that can be held in currently allocated storage. More... | |
constexpr size_t | headroom () const noexcept |
Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data. More... | |
constexpr size_t | tailroom () const noexcept |
Returns the number of bytes that available in currently allocated storage after the currently data end. More... | |
constexpr const byte * | byte_ptr () const noexcept |
Returns casted to const pointer to byte an address of data. More... | |
constexpr const byte * | end_byte_ptr () const noexcept |
Returns casted to const pointer to byte an end of data. More... | |
constexpr byte * | byte_ptr () noexcept |
Returns casted to pointer to byte an address of data. More... | |
constexpr byte * | end_byte_ptr () noexcept |
Returns casted to pointer to byte an end of data. More... | |
constexpr const char * | char_ptr () const noexcept |
Returns casted to const pointer to char an address of data. More... | |
constexpr const char * | end_char_ptr () const noexcept |
Returns casted to const pointer to char an end of data. More... | |
constexpr char * | char_ptr () noexcept |
Returns casted to pointer to char an address of data. More... | |
constexpr char * | end_char_ptr () noexcept |
Returns casted to pointer to char an end of data. More... | |
constexpr const void * | data () const noexcept |
Return a const pointer to the beginning of the referenced data. More... | |
constexpr const void * | end () const noexcept |
Return a const pointer to the end of the referenced data. More... | |
constexpr void * | data () noexcept |
Return a pointer to the beginning of the referenced data. More... | |
constexpr void * | end () noexcept |
Return a pointer to the end of the referenced data. More... | |
constexpr size_t | length () const noexcept |
Returns the number of bytes. More... | |
constexpr buffer & | set_length (size_t bytes) |
Set length of data. More... | |
constexpr buffer & | set_end (const void *ptr) |
Sets the length by specifying the end of the data. More... | |
void | make_freestanding () |
Makes buffer owning the data. More... | |
constexpr | buffer () noexcept=default |
constexpr | buffer (const allocator_type &allocator) noexcept |
buffer (const struct slice &src, bool make_reference, const allocator_type &allocator=allocator_type()) | |
buffer (const buffer &src, bool make_reference, const allocator_type &allocator=allocator_type()) | |
buffer (const void *ptr, size_t bytes, bool make_reference, const allocator_type &allocator=allocator_type()) | |
template<class CHAR , class T , class A > | |
buffer (const ::std::basic_string< CHAR, T, A > &)=delete | |
template<class CHAR , class T , class A > | |
buffer (const ::std::basic_string< CHAR, T, A > &&)=delete | |
buffer (const char *c_str, bool make_reference, const allocator_type &allocator=allocator_type()) | |
template<class CHAR , class T > | |
buffer (const ::std::basic_string_view< CHAR, T > &view, bool make_reference, const allocator_type &allocator=allocator_type()) | |
constexpr | buffer (const struct slice &src, const allocator_type &allocator=allocator_type()) |
constexpr | buffer (const buffer &src, const allocator_type &allocator=allocator_type()) |
constexpr | buffer (const void *ptr, size_t bytes, const allocator_type &allocator=allocator_type()) |
template<class CHAR , class T , class A > | |
constexpr | buffer (const ::std::basic_string< CHAR, T, A > &str, const allocator_type &allocator=allocator_type()) |
constexpr | buffer (const char *c_str, const allocator_type &allocator=allocator_type()) |
template<class CHAR , class T > | |
constexpr | buffer (const ::std::basic_string_view< CHAR, T > &view, const allocator_type &allocator=allocator_type()) |
buffer (size_t head_room, size_t tail_room, const allocator_type &allocator=allocator_type()) | |
buffer (size_t capacity, const allocator_type &allocator=allocator_type()) | |
buffer (size_t head_room, const struct slice &src, size_t tail_room, const allocator_type &allocator=allocator_type()) | |
buffer (size_t head_room, const buffer &src, size_t tail_room, const allocator_type &allocator=allocator_type()) | |
buffer (const ::mdbx::txn &txn, const struct slice &src, const allocator_type &allocator=allocator_type()) | |
buffer (buffer &&src) noexcept(move_assign_alloc::is_nothrow()) | |
constexpr const struct slice & | slice () const noexcept |
constexpr | operator const struct slice & () const noexcept |
template<typename POD > | |
constexpr POD | as_pod () const |
buffer | encode_hex (bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const |
Returns a new buffer with a hexadecimal dump of the slice content. More... | |
buffer | encode_base58 (unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const |
Returns a new buffer with a Base58 dump of the slice content. More... | |
buffer | encode_base64 (unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const |
Returns a new buffer with a Base64 dump of the slice content. More... | |
buffer | hex_decode (bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) const |
Decodes hexadecimal dump from the buffer content to new returned buffer. More... | |
buffer | base58_decode (bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) const |
Decodes Base58 dump from the buffer content to new returned buffer. More... | |
buffer | base64_decode (bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) const |
Decodes Base64 dump from the buffer content to new returned buffer. More... | |
void | reserve (size_t wanna_headroom, size_t wanna_tailroom) |
Reserves storage space. More... | |
void | reserve_headroom (size_t wanna_headroom) |
Reserves space before the payload. More... | |
void | reserve_tailroom (size_t wanna_tailroom) |
Reserves space after the payload. More... | |
buffer & | assign_reference (const void *ptr, size_t bytes) |
buffer & | assign_freestanding (const void *ptr, size_t bytes) |
constexpr void | swap (buffer &other) noexcept(swap_alloc::is_nothrow()) |
buffer & | assign (const buffer &src, bool make_reference=false) |
buffer & | assign (const void *ptr, size_t bytes, bool make_reference=false) |
buffer & | assign (const struct slice &src, bool make_reference=false) |
buffer & | assign (const ::MDBX_val &src, bool make_reference=false) |
buffer & | assign (struct slice &&src, bool make_reference=false) |
buffer & | assign (::MDBX_val &&src, bool make_reference=false) |
buffer & | assign (const void *begin, const void *end, bool make_reference=false) |
template<class CHAR , class T , class A > | |
buffer & | assign (const ::std::basic_string< CHAR, T, A > &str, bool make_reference=false) |
buffer & | assign (const char *c_str, bool make_reference=false) |
buffer & | operator= (const buffer &src) |
buffer & | operator= (buffer &&src) noexcept(move_assign_alloc::is_nothrow()) |
buffer & | operator= (const struct slice &src) |
buffer & | operator= (struct slice &&src) |
template<class CHAR , class T > | |
buffer & | operator= (const ::std::basic_string_view< CHAR, T > &view) noexcept |
template<class CHAR = char, class T = ::std::char_traits<CHAR>> | |
::std::basic_string_view< CHAR, T > | string_view () const noexcept |
Return a string_view that references the data of this buffer. More... | |
template<class CHAR , class T > | |
operator::std::basic_string_view () const noexcept | |
Return a string_view that references the data of this buffer. More... | |
constexpr bool | empty () const noexcept |
Checks whether the string is empty. More... | |
constexpr bool | is_null () const noexcept |
Checks whether the data pointer of the buffer is nullptr. More... | |
constexpr size_t | size () const noexcept |
Returns the number of bytes. More... | |
constexpr size_t | hash_value () const noexcept |
Returns the hash value of the data. More... | |
template<class CHAR = char, class T = ::std::char_traits<CHAR>, class A = legacy_allocator> | |
constexpr ::std::basic_string< CHAR, T, A > | as_string (const A &allocator=A()) const |
template<class CHAR , class T , class A > | |
constexpr | operator::std::basic_string () const |
bool | starts_with (const struct slice &prefix) const noexcept |
Checks if the data starts with the given prefix. More... | |
bool | ends_with (const struct slice &suffix) const noexcept |
Checks if the data ends with the given suffix. More... | |
void | clear () noexcept |
Clears the contents and storage. More... | |
void | shrink_to_fit () |
Reduces memory usage by freeing unused storage space. More... | |
void | remove_prefix (size_t n) noexcept |
Drops the first "n" bytes from the data chunk. More... | |
void | remove_suffix (size_t n) noexcept |
Drops the last "n" bytes from the data chunk. More... | |
void | safe_remove_prefix (size_t n) |
Drops the first "n" bytes from the data chunk. More... | |
void | safe_remove_suffix (size_t n) |
Drops the last "n" bytes from the data chunk. More... | |
constexpr byte | operator[] (size_t n) const noexcept |
Accesses the specified byte of data chunk. More... | |
constexpr byte & | operator[] (size_t n) noexcept |
Accesses the specified byte of data chunk. More... | |
constexpr byte | at (size_t n) const |
Accesses the specified byte of data chunk with bounds checking. More... | |
constexpr byte & | at (size_t n) |
Accesses the specified byte of data chunk with bounds checking. More... | |
constexpr struct slice | head (size_t n) const noexcept |
Returns the first "n" bytes of the data chunk. More... | |
constexpr struct slice | tail (size_t n) const noexcept |
Returns the last "n" bytes of the data chunk. More... | |
constexpr struct slice | middle (size_t from, size_t n) const noexcept |
Returns the middle "n" bytes of the data chunk. More... | |
constexpr struct slice | safe_head (size_t n) const |
Returns the first "n" bytes of the data chunk. More... | |
constexpr struct slice | safe_tail (size_t n) const |
Returns the last "n" bytes of the data chunk. More... | |
constexpr struct slice | safe_middle (size_t from, size_t n) const |
Returns the middle "n" bytes of the data chunk. More... | |
buffer & | append (const void *src, size_t bytes) |
buffer & | append (const struct slice &chunk) |
buffer & | add_header (const void *src, size_t bytes) |
buffer & | add_header (const struct slice &chunk) |
template<MutableByteProducer PRODUCER> | |
buffer & | append_producer (PRODUCER &producer) |
template<ImmutableByteProducer PRODUCER> | |
buffer & | append_producer (const PRODUCER &producer) |
buffer & | append_hex (const struct slice &data, bool uppercase=false, unsigned wrap_width=0) |
buffer & | append_base58 (const struct slice &data, unsigned wrap_width=0) |
buffer & | append_base64 (const struct slice &data, unsigned wrap_width=0) |
buffer & | append_decoded_hex (const struct slice &data, bool ignore_spaces=false) |
buffer & | append_decoded_base58 (const struct slice &data, bool ignore_spaces=false) |
buffer & | append_decoded_base64 (const struct slice &data, bool ignore_spaces=false) |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer (const txn &txn, const struct slice &src, const allocator_type &allocator) | |
Static Public Member Functions | |
template<typename POD > | |
static buffer | wrap (const POD &pod, bool make_reference=false, const allocator_type &allocator=allocator_type()) |
static buffer | hex (const ::mdbx::slice &source, bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) |
Returns a new buffer with a hexadecimal dump of the slice content. More... | |
static buffer | base58 (const ::mdbx::slice &source, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) |
Returns a new buffer with a Base58 dump of the slice content. More... | |
static buffer | base64 (const ::mdbx::slice &source, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) |
Returns a new buffer with a Base64 dump of the slice content. More... | |
template<typename POD > | |
static buffer | hex (const POD &pod, bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) |
Returns a new buffer with a hexadecimal dump of the given pod. More... | |
template<typename POD > | |
static buffer | base58 (const POD &pod, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) |
Returns a new buffer with a Base58 dump of the given pod. More... | |
template<typename POD > | |
static buffer | base64 (const POD &pod, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) |
Returns a new buffer with a Base64 dump of the given pod. More... | |
static buffer | hex_decode (const ::mdbx::slice &source, bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) |
Decodes hexadecimal dump from the slice content to returned buffer. More... | |
static buffer | base58_decode (const ::mdbx::slice &source, bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) |
Decodes Base58 dump from the slice content to returned buffer. More... | |
static buffer | base64_decode (const ::mdbx::slice &source, bool ignore_spaces=false, const allocator_type &allocator=allocator_type()) |
Decodes Base64 dump from the slice content to returned buffer. More... | |
static buffer | clone (const buffer &src, const allocator_type &allocator=allocator_type()) |
template<size_t SIZE> | |
static buffer | key_from (const char(&text)[SIZE], bool make_reference=true) |
template<class CHAR , class T > | |
static buffer | key_from (const ::std::basic_string_view< CHAR, T > &src, bool make_reference=false) |
static buffer | key_from (const char *src, bool make_reference=false) |
template<class CHAR , class T , class A > | |
static buffer | key_from (const ::std::basic_string< CHAR, T, A > &src, bool make_reference=false) |
static buffer | key_from (silo &&src) noexcept |
static buffer | key_from_double (const double ieee754_64bit) |
static buffer | key_from (const double ieee754_64bit) |
static buffer | key_from (const double *ieee754_64bit) |
static buffer | key_from_u64 (const uint64_t unsigned_int64) |
static buffer | key_from (const uint64_t unsigned_int64) |
static buffer | key_from_i64 (const int64_t signed_int64) |
static buffer | key_from (const int64_t signed_int64) |
static buffer | key_from_jsonInteger (const int64_t json_integer) |
static buffer | key_from_float (const float ieee754_32bit) |
static buffer | key_from (const float ieee754_32bit) |
static buffer | key_from (const float *ieee754_32bit) |
static buffer | key_from_u32 (const uint32_t unsigned_int32) |
static buffer | key_from (const uint32_t unsigned_int32) |
static buffer | key_from_i32 (const int32_t signed_int32) |
static buffer | key_from (const int32_t signed_int32) |
Friends | |
class | txn |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_traits = ::std::allocator_traits<allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type = typename ::std::allocator_traits< ALLOCATOR>::template rebind_alloc<uint64_t> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::copy_assign_alloc = allocation_aware_details::copy_assign_alloc<silo, allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::move_assign_alloc = allocation_aware_details::move_assign_alloc<silo, allocator_type> |
using mdbx::buffer< ALLOCATOR, CAPACITY_POLICY >::reservation_policy = CAPACITY_POLICY |
anonymous enum : size_t |
|
constexprdefaultnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
inline |
|
inline |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineconstexpr |
Accesses the specified byte of data chunk with bounds checking.
std::out_of_range | if n >= size() |
|
inlineconstexpr |
Accesses the specified byte of data chunk with bounds checking.
std::out_of_range | if n >= size() |
|
inlinestatic |
Returns a new buffer with a Base58 dump of the slice content.
|
inlinestatic |
Returns a new buffer with a Base58 dump of the given pod.
|
inline |
Decodes Base58 dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes Base58 dump from the slice content to returned buffer.
|
inlinestatic |
Returns a new buffer with a Base64 dump of the slice content.
|
inlinestatic |
Returns a new buffer with a Base64 dump of the given pod.
|
inline |
Decodes Base64 dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes Base64 dump from the slice content to returned buffer.
|
inlineconstexprnoexcept |
Returns casted to const pointer to byte an address of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to byte an address of data.
|
inlineconstexprnoexcept |
Returns the number of bytes that can be held in currently allocated storage.
|
inlineconstexprnoexcept |
Returns casted to const pointer to char an address of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to char an address of data.
|
inlinenoexcept |
Clears the contents and storage.
|
inlinestatic |
|
inlineconstexprnoexcept |
Return a const pointer to the beginning of the referenced data.
|
inlineconstexprnoexcept |
Return a pointer to the beginning of the referenced data.
|
inlineconstexprnoexcept |
Checks whether the string is empty.
|
inline |
Returns a new buffer with a Base58 dump of the slice content.
|
inline |
Returns a new buffer with a Base64 dump of the slice content.
|
inline |
Returns a new buffer with a hexadecimal dump of the slice content.
|
inlineconstexprnoexcept |
Return a const pointer to the end of the referenced data.
|
inlineconstexprnoexcept |
Return a pointer to the end of the referenced data.
|
inlineconstexprnoexcept |
Returns casted to const pointer to byte an end of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to byte an end of data.
|
inlineconstexprnoexcept |
Returns casted to const pointer to char an end of data.
|
inlineconstexprnoexcept |
Returns casted to pointer to char an end of data.
|
inlinenoexcept |
Checks if the data ends with the given suffix.
|
inlineconstexpr |
Returns the associated allocator.
|
inlineconstexprnoexcept |
Returns the hash value of the data.
|
inlinenoexcept |
Returns the first "n" bytes of the data chunk.
n <= size()
|
inlineconstexprnoexcept |
Returns the number of bytes that available in currently allocated storage ahead the currently beginning of data.
|
inlinestatic |
Returns a new buffer with a hexadecimal dump of the slice content.
|
inlinestatic |
Returns a new buffer with a hexadecimal dump of the given pod.
|
inline |
Decodes hexadecimal dump from the buffer content to new returned buffer.
|
inlinestatic |
Decodes hexadecimal dump from the slice content to returned buffer.
|
inlineconstexprnoexcept |
Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outside the buffer.
|
inlineconstexprnoexcept |
Checks whether the data pointer of the buffer is nullptr.
|
inlineconstexprnoexcept |
Checks whether the buffer just refers to data located outside the buffer, rather than stores it.
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticnoexcept |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlineconstexprnoexcept |
Returns the number of bytes.
|
inline |
Makes buffer owning the data.
If buffer refers to an external data, then makes it the owner of clone by allocating storage and copying the data.
|
inlinenoexcept |
Returns the middle "n" bytes of the data chunk.
from + n <= size()
|
inlineconstexprnoexcept |
|
inlineexplicitconstexpr |
|
inlinenoexcept |
Return a string_view that references the data of this buffer.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inlineconstexprnoexcept |
Accesses the specified byte of data chunk.
n < size()
|
inlineconstexprnoexcept |
Accesses the specified byte of data chunk.
n < size()
|
inlinenoexcept |
Drops the first "n" bytes from the data chunk.
n <= size()
|
inlinenoexcept |
Drops the last "n" bytes from the data chunk.
n <= size()
|
inline |
Reserves storage space.
|
inline |
Reserves space before the payload.
|
inline |
Reserves space after the payload.
|
inline |
Returns the first "n" bytes of the data chunk.
std::out_of_range | if n >= size() |
|
inline |
Returns the middle "n" bytes of the data chunk.
std::out_of_range | if from + n >= size() |
|
inline |
Drops the first "n" bytes from the data chunk.
std::out_of_range | if n > size() |
|
inline |
Drops the last "n" bytes from the data chunk.
std::out_of_range | if n > size() |
|
inline |
Returns the last "n" bytes of the data chunk.
std::out_of_range | if n >= size() |
|
inlineconstexpr |
Sets the length by specifying the end of the data.
|
inlineconstexpr |
Set length of data.
|
inline |
Reduces memory usage by freeing unused storage space.
|
inlineconstexprnoexcept |
Returns the number of bytes.
|
inlinenoexcept |
|
inlinenoexcept |
Checks if the data starts with the given prefix.
|
inlinenoexcept |
Return a string_view that references the data of this buffer.
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Returns the last "n" bytes of the data chunk.
n <= size()
|
inlineconstexprnoexcept |
Returns the number of bytes that available in currently allocated storage after the currently data end.
|
inlinestatic |
|
friend |
struct mdbx::map_handle |
A handle for an individual database (key-value spaces) in the environment.
Public Types | |
using | flags = ::MDBX_db_flags_t |
using | state = ::MDBX_dbi_state_t |
Public Member Functions | |
constexpr | map_handle () noexcept |
constexpr | map_handle (MDBX_dbi dbi) noexcept |
map_handle (const map_handle &) noexcept=default | |
map_handle & | operator= (const map_handle &) noexcept=default |
operator MDBX_dbi () const | |
Public Attributes | |
MDBX_dbi | dbi {0} |
using mdbx::map_handle::flags = ::MDBX_db_flags_t |
using mdbx::map_handle::state = ::MDBX_dbi_state_t |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
defaultnoexcept |
|
inline |
|
defaultnoexcept |
MDBX_dbi mdbx::map_handle::dbi {0} |
class mdbx::env |
Unmanaged database environment.
Like other unmanaged classes, env
allows copying and assignment for instances, but does not destroys the represented underlying object from the own class destructor.
An environment supports multiple key-value sub-databases (aka key-value spaces or tables), all residing in the same shared-memory map.
Inherited by mdbx::env_managed.
Public Types | |
enum | mode { readonly , write_file_io , write_mapped_io } |
Operation mode. More... | |
enum | durability { robust_synchronous , half_synchronous_weak_last , lazy_weak_tail , whole_fragile } |
Durability level. More... | |
enum | remove_mode { just_remove = MDBX_ENV_JUST_DELETE , ensure_unused = MDBX_ENV_ENSURE_UNUSED , wait_for_unused = MDBX_ENV_WAIT_FOR_UNUSED } |
Deletion modes for remove(). More... | |
enum class | extra_runtime_option { max_maps = MDBX_opt_max_db , max_readers = MDBX_opt_max_readers , sync_bytes = MDBX_opt_sync_bytes , sync_period = MDBX_opt_sync_period , rp_augment_limit = MDBX_opt_rp_augment_limit , loose_limit = MDBX_opt_loose_limit , dp_reserve_limit = MDBX_opt_dp_reserve_limit , dp_limit = MDBX_opt_txn_dp_limit , dp_initial = MDBX_opt_txn_dp_initial , spill_max_denominator = MDBX_opt_spill_max_denominator , spill_min_denominator = MDBX_opt_spill_min_denominator , spill_parent4child_denominator = MDBX_opt_spill_parent4child_denominator , merge_threshold_16dot16_percent = MDBX_opt_merge_threshold_16dot16_percent , writethrough_threshold = MDBX_opt_writethrough_threshold , prefault_write_enable = MDBX_opt_prefault_write_enable } |
using | stat = ::MDBX_stat |
Statistics for a database in the MDBX environment. More... | |
using | info = ::MDBX_envinfo |
Information about the environment. More... | |
Public Member Functions | |
constexpr | env () noexcept=default |
env (const env &) noexcept=default | |
env & | operator= (env &&other) noexcept |
env (env &&other) noexcept | |
~env () noexcept | |
constexpr | operator const MDBX_env * () const |
constexpr | operator MDBX_env * () |
env::operate_parameters | get_operation_parameters () const |
Returns current operation parameters. More... | |
env::mode | get_mode () const |
Returns current operation mode. More... | |
env::durability | get_durability () const |
Returns current durability mode. More... | |
env::reclaiming_options | get_reclaiming () const |
Returns current reclaiming options. More... | |
env::operate_options | get_options () const |
Returns current operate options. More... | |
bool | is_pristine () const |
Returns true for a freshly created database, but false if at least one transaction was committed. More... | |
bool | is_empty () const |
Checks whether the database is empty. More... | |
size_t | dbsize_min () const |
Returns the minimal database size in bytes for the environment. More... | |
size_t | dbsize_max () const |
Returns the maximal database size in bytes for the environment. More... | |
size_t | key_min (key_mode mode) const noexcept |
Returns the minimal key size in bytes for specified keys mode. More... | |
size_t | key_max (key_mode mode) const |
Returns the maximal key size in bytes for specified keys mode. More... | |
size_t | value_min (value_mode mode) const noexcept |
Returns the minimal value size in bytes for specified values mode. More... | |
size_t | value_max (value_mode mode) const |
Returns the maximal value size in bytes for specified values mode. More... | |
size_t | transaction_size_max () const |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. More... | |
env & | copy (const ::mdbx::filesystem::path &destination, bool compactify, bool force_dynamic_size=false) |
Make a copy (backup) of an existing environment to the specified path. More... | |
env & | copy (const ::std::wstring &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const wchar_t *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const ::std::string &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const char *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (filehandle fd, bool compactify, bool force_dynamic_size=false) |
Copy an environment to the specified file descriptor. More... | |
stat | get_stat () const |
Returns snapshot statistics about the MDBX environment. More... | |
size_t | get_pagesize () const |
Returns pagesize of this MDBX environment. More... | |
info | get_info () const |
Return snapshot information about the MDBX environment. More... | |
stat | get_stat (const txn &) const |
Return statistics about the MDBX environment accordingly to the specified transaction. More... | |
info | get_info (const txn &) const |
Return information about the MDBX environment accordingly to the specified transaction. More... | |
filehandle | get_filehandle () const |
Returns the file descriptor for the DXB file of MDBX environment. More... | |
path | get_path () const |
Return the path that was used for opening the environment. More... | |
MDBX_env_flags_t | get_flags () const |
Returns environment flags. More... | |
unsigned | max_readers () const |
Returns the maximum number of threads/reader slots for the environment. More... | |
unsigned | max_maps () const |
Returns the maximum number of named databases for the environment. More... | |
void * | get_context () const noexcept |
Returns the application context associated with the environment. More... | |
env & | set_context (void *your_context) |
Sets the application context associated with the environment. More... | |
env & | set_sync_threshold (size_t bytes) |
Sets threshold to force flush the data buffers to disk, for non-sync durability modes. More... | |
size_t | sync_threshold () const |
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_sync_period (const duration &period) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
duration | sync_period () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_sync_period__seconds_16dot16 (unsigned seconds_16dot16) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
unsigned | sync_period__seconds_16dot16 () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_sync_period__seconds_double (double seconds) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
double | sync_period__seconds_double () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_extra_option (extra_runtime_option option, uint64_t value) |
Sets the value of a extra runtime options for an environment. More... | |
uint64_t | extra_option (extra_runtime_option option) const |
Gets the value of extra runtime options from an environment. More... | |
env & | alter_flags (MDBX_env_flags_t flags, bool on_off) |
Alter environment flags. More... | |
env & | set_geometry (const geometry &size) |
Set all size-related parameters of environment. More... | |
bool | sync_to_disk (bool force=true, bool nonblock=false) |
Flush the environment data buffers. More... | |
bool | poll_sync_to_disk () |
Performs non-blocking polling of sync-to-disk thresholds. More... | |
void | close_map (const map_handle &) |
Close a key-value map (aka sub-database) handle. Normally unnecessary. More... | |
template<typename VISITOR > | |
int | enumerate_readers (VISITOR &visitor) |
Enumerate readers. More... | |
unsigned | check_readers () |
Checks for stale readers in the lock table and return number of cleared slots. More... | |
env & | set_HandleSlowReaders (MDBX_hsr_func *) |
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled. More... | |
MDBX_hsr_func * | get_HandleSlowReaders () const noexcept |
Returns the current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled. More... | |
txn_managed | start_read () const |
Starts read (read-only) transaction. More... | |
txn_managed | prepare_read () const |
Creates but not start read transaction. More... | |
txn_managed | start_write (bool dont_wait=false) |
Starts write (read-write) transaction. More... | |
txn_managed | try_start_write () |
Tries to start write (read-write) transaction without blocking. More... | |
Static Public Member Functions | |
static size_t | default_pagesize () noexcept |
Returns default page size for current system/platform. More... | |
static bool | remove (const ::mdbx::filesystem::path &pathname, const remove_mode mode=just_remove) |
Removes the environment's files in a proper and multiprocess-safe way. More... | |
static bool | remove (const ::std::wstring &pathname, const remove_mode mode=just_remove) |
static bool | remove (const wchar_t *pathname, const remove_mode mode=just_remove) |
static bool | remove (const ::std::string &pathname, const remove_mode mode=just_remove) |
static bool | remove (const char *pathname, const remove_mode mode=just_remove) |
Protected Member Functions | |
constexpr | env (MDBX_env *ptr) noexcept |
Protected Attributes | |
MDBX_env * | handle_ {nullptr} |
Friends | |
class | txn |
constexpr friend bool | operator== (const env &a, const env &b) noexcept |
constexpr friend bool | operator!= (const env &a, const env &b) noexcept |
using mdbx::env::info = ::MDBX_envinfo |
Information about the environment.
using mdbx::env::stat = ::MDBX_stat |
Statistics for a database in the MDBX environment.
Durability level.
Enumerator | |
---|---|
robust_synchronous | Default robust and durable sync mode. Metadata is written and flushed to disk after a data is written and flushed, which guarantees the integrity of the database in the event of a crash at any time.
|
half_synchronous_weak_last | Don't sync the meta-page after commit. Flush system buffers to disk only once per transaction commit, omit the metadata flush. Defer that until the system flushes files to disk, or next non-MDBX_RDONLY commit or mdbx_env_sync(). Depending on the platform and hardware, with MDBX_NOMETASYNC you may get a doubling of write performance. This trade-off maintains database integrity, but a system crash may undo the last committed transaction. I.e. it preserves the ACI (atomicity, consistency, isolation) but not D (durability) database property.
|
lazy_weak_tail | Don't sync anything but keep previous steady commits. Like MDBX_UTTERLY_NOSYNC the With MDBX_WRITEMAP the Depending on the platform and hardware, with In contrast to MDBX_UTTERLY_NOSYNC mode, with
In other words, with The number and volume of of disk IOPs with MDBX_SAFE_NOSYNC flag will exactly the as without any no-sync flags. However, you should expect a larger process's work set and significantly worse a locality of reference, due to the more intensive allocation of previously unused pages and increase the size of the database.
|
whole_fragile | Don't sync anything and wipe previous steady commits. Don't flush system buffers to disk when committing a transaction. This optimization means a system crash can corrupt the database, if buffers are not yet flushed to disk. Depending on the platform and hardware, with If the filesystem preserves write order (which is rare and never provided unless explicitly noted) and the MDBX_WRITEMAP and MDBX_LIFORECLAIM flags are not used, then a system crash can't corrupt the database, but you can lose the last transactions, if at least one buffer is not yet flushed to disk. The risk is governed by how often the system flushes dirty buffers to disk and how often mdbx_env_sync() is called. So, transactions exhibit ACI (atomicity, consistency, isolation) properties and only lose Otherwise, if the filesystem not preserves write order (which is typically) or MDBX_WRITEMAP or MDBX_LIFORECLAIM flags are used, you should expect the corrupted database after a system crash. So, most important thing about
Nevertheless,
|
|
strong |
Enumerator | |
---|---|
max_maps | Controls the maximum number of named databases for the environment. By default only unnamed key-value database could used and appropriate value should set by |
max_readers | Defines the maximum number of threads/reader slots for all processes interacting with the database. This defines the number of slots in the lock table that is used to track readers in the the environment. The default is about 100 for 4K system page size. Starting a read-only transaction normally ties a lock table slot to the current thread until the environment closes or the thread exits. If MDBX_NOTLS is in use, mdbx_txn_begin() instead ties the slot to the MDBX_txn object until it or the MDBX_env object is destroyed. This option may only set after mdbx_env_create() and before mdbx_env_open(), and has an effect only when the database is opened by the first process interacts with the database. |
sync_bytes | Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. |
sync_period | Controls interprocess/shared relative period since the last unsteady commit to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC is used. |
rp_augment_limit | Controls the in-process limit to grow a list of reclaimed/recycled page's numbers for finding a sequence of contiguous pages for large data items. A long values requires allocation of contiguous database pages. To find such sequences, it may be necessary to accumulate very large lists, especially when placing very long values (more than a megabyte) in a large databases (several tens of gigabytes), which is much expensive in extreme cases. This threshold allows you to avoid such costs by allocating new pages at the end of the database (with its possible growth on disk), instead of further accumulating/reclaiming Garbage Collection records. On the other hand, too small threshold will lead to unreasonable database growth, or/and to the inability of put long values. The |
loose_limit | Controls the in-process limit to grow a cache of dirty pages for reuse in the current transaction. A 'dirty page' refers to a page that has been updated in memory only, the changes to a dirty page are not yet stored on disk. To reduce overhead, it is reasonable to release not all such pages immediately, but to leave some ones in cache for reuse in the current transaction. The |
dp_reserve_limit | Controls the in-process limit of a pre-allocated memory items for dirty pages. A 'dirty page' refers to a page that has been updated in memory only, the changes to a dirty page are not yet stored on disk. Without MDBX_WRITEMAP dirty pages are allocated from memory and released when a transaction is committed. To reduce overhead, it is reasonable to release not all ones, but to leave some allocations in reserve for reuse in the next transaction(s). The |
dp_limit | Controls the in-process limit of dirty pages for a write transaction. A 'dirty page' refers to a page that has been updated in memory only, the changes to a dirty page are not yet stored on disk. Without MDBX_WRITEMAP dirty pages are allocated from memory and will be busy until are written to disk. Therefore for a large transactions is reasonable to limit dirty pages collecting above an some threshold but spill to disk instead. The |
dp_initial | Controls the in-process initial allocation size for dirty pages list of a write transaction. Default is 1024. |
spill_max_denominator | Controls the in-process how maximal part of the dirty pages may be spilled when necessary. The Should be in the range 0..255, where zero means no limit, i.e. all dirty pages could be spilled. Default is 8, i.e. no more than 7/8 of the current dirty pages may be spilled when reached the condition described above. |
spill_min_denominator | Controls the in-process how minimal part of the dirty pages should be spilled when necessary. The Should be in the range 0..255, where zero means no restriction at the bottom. Default is 8, i.e. at least the 1/8 of the current dirty pages should be spilled when reached the condition described above. |
spill_parent4child_denominator | Controls the in-process how much of the parent transaction dirty pages will be spilled while start each child transaction. The For a stack of nested transactions each dirty page could be spilled only once, and parent's dirty pages couldn't be spilled while child transaction(s) are running. Therefore a child transaction could reach MDBX_TXN_FULL when parent(s) transaction has spilled too less (and child reach the limit of dirty pages), either when parent(s) has spilled too more (since child can't spill already spilled pages). So there is no universal golden ratio. Should be in the range 0..255, where zero means no explicit spilling will be performed during starting nested transactions. Default is 0, i.e. by default no spilling performed during starting nested transactions, that correspond historically behaviour. |
merge_threshold_16dot16_percent | Controls the in-process threshold of semi-empty pages merge.
This option controls the in-process threshold of minimum page fill, as used space of percentage of a page. Neighbour pages emptier than this value are candidates for merging. The threshold value is specified in 1/65536 of percent, which is equivalent to the 16-dot-16 fixed point format. The specified value must be in the range from 12.5% (almost empty) to 50% (half empty) which corresponds to the range from 8192 and to 32768 in units respectively. |
writethrough_threshold | Controls the choosing between use write-through disk writes and usual ones with followed flush by the Depending on the operating system, storage subsystem characteristics and the use case, higher performance can be achieved by either using write-through or a serie of usual/lazy writes followed by the flush-to-disk. Basically for N chunks the latency/cost of write-through is: latency = N * (emit + round-trip-to-storage + storage-execution); And for serie of lazy writes with flush is: latency = N * (emit + storage-execution) + flush + round-trip-to-storage. So, for large N and/or noteable round-trip-to-storage the write+flush approach is win. But for small N and/or near-zero NVMe-like latency the write-through is better. To solve this issue libmdbx provide
|
prefault_write_enable | Controls prevention of page-faults of reclaimed and allocated pages in the MDBX_WRITEMAP mode by clearing ones through file handle before touching. |
enum mdbx::env::mode |
Operation mode.
Enumerator | |
---|---|
readonly | Read only mode. Open the environment in read-only mode. No write operations will be allowed. MDBX will still modify the lock file - except on read-only filesystems, where MDBX does not use locks.
This flag affects only at environment opening but can't be changed after. |
write_file_io | |
write_mapped_io | Map data into memory with write permission. Use a writeable memory map unless MDBX_RDONLY is set. This uses fewer mallocs and requires much less work for tracking database pages, but loses protection from application bugs like wild pointer writes and other bad updates into the database. This may be slightly faster for DBs that fit entirely in RAM, but is slower for DBs larger than RAM. Also adds the possibility for stray application writes thru pointers to silently corrupt the database.
This flag affects only at environment opening but can't be changed after. |
Deletion modes for remove().
|
constexprdefaultnoexcept |
|
defaultnoexcept |
env& mdbx::env::copy | ( | const ::mdbx::filesystem::path & | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
Make a copy (backup) of an existing environment to the specified path.
env& mdbx::env::copy | ( | const ::std::string & | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env& mdbx::env::copy | ( | const ::std::wstring & | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env& mdbx::env::copy | ( | const char * | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env& mdbx::env::copy | ( | const wchar_t * | destination, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
env& mdbx::env::copy | ( | filehandle | fd, |
bool | compactify, | ||
bool | force_dynamic_size = false |
||
) |
Copy an environment to the specified file descriptor.
|
inline |
Returns the maximal database size in bytes for the environment.
|
inline |
Returns the minimal database size in bytes for the environment.
|
inlinestaticnoexcept |
Returns default page size for current system/platform.
|
inline |
Returns pagesize of this MDBX environment.
path mdbx::env::get_path | ( | ) | const |
Return the path that was used for opening the environment.
bool mdbx::env::is_empty | ( | ) | const |
Checks whether the database is empty.
bool mdbx::env::is_pristine | ( | ) | const |
Returns true
for a freshly created database, but false
if at least one transaction was committed.
|
inline |
Returns the maximal key size in bytes for specified keys mode.
|
inlinenoexcept |
Returns the minimal key size in bytes for specified keys mode.
|
inline |
Performs non-blocking polling of sync-to-disk thresholds.
True
if sync done or no data to sync, or false
if the environment is busy by other thread or none of the thresholds are reached.
|
static |
Removes the environment's files in a proper and multiprocess-safe way.
|
static |
|
static |
|
static |
|
static |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes.
The relative period value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last. Settled period don't checked asynchronously, but only by the txn_managed::commit() and env::sync_to_disk() functions. Therefore, in cases where transactions are committed infrequently and/or irregularly, polling by env::poll_sync_to_disk() may be a reasonable solution to timeout enforcement.
The default is 0, than mean no any timeout checked, and no additional flush will be made.
|
inline |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes.
The relative period value affects all processes which operates with given environment until the last process close environment or a new value will be settled. Data is always written to disk when txn_managed::commit() is called, but the operating system may keep it buffered. MDBX always flushes the OS buffers upon commit as well, unless the environment was opened with whole_fragile, lazy_weak_tail or in part half_synchronous_weak_last. Settled period don't checked asynchronously, but only by the txn_managed::commit() and env::sync_to_disk() functions. Therefore, in cases where transactions are committed infrequently and/or irregularly, polling by env::poll_sync_to_disk() may be a reasonable solution to timeout enforcement.
The default is 0, than mean no any timeout checked, and no additional flush will be made.
|
inline |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
|
inline |
Returns the maximal value size in bytes for specified values mode.
|
inlinenoexcept |
Returns the minimal value size in bytes for specified values mode.
|
friend |
|
protected |
class mdbx::env_managed |
Managed database environment.
As other managed classes, env_managed
destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.
An environment supports multiple key-value databases (aka key-value spaces or tables), all residing in the same shared-memory map.
Inherits mdbx::env.
Public Member Functions | |
constexpr | env_managed () noexcept=default |
env_managed (const ::mdbx::filesystem::path &pathname, const operate_parameters &, bool accede=true) | |
Open existing database. More... | |
env_managed (const ::std::wstring &pathname, const operate_parameters &, bool accede=true) | |
env_managed (const wchar_t *pathname, const operate_parameters &, bool accede=true) | |
env_managed (const ::std::string &pathname, const operate_parameters &, bool accede=true) | |
env_managed (const char *pathname, const operate_parameters &, bool accede=true) | |
env_managed (const ::mdbx::filesystem::path &pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
Create new or open existing database. More... | |
env_managed (const ::std::wstring &pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
env_managed (const wchar_t *pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
env_managed (const ::std::string &pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
env_managed (const char *pathname, const create_parameters &, const operate_parameters &, bool accede=true) | |
void | close (bool dont_sync=false) |
Explicitly closes the environment and release the memory map. More... | |
env_managed (env_managed &&)=default | |
env_managed & | operator= (env_managed &&other) noexcept |
env_managed (const env_managed &)=delete | |
env_managed & | operator= (const env_managed &)=delete |
virtual | ~env_managed () noexcept |
![]() | |
constexpr | env () noexcept=default |
env (const env &) noexcept=default | |
env & | operator= (env &&other) noexcept |
env (env &&other) noexcept | |
~env () noexcept | |
constexpr | operator const MDBX_env * () const |
constexpr | operator MDBX_env * () |
env::operate_parameters | get_operation_parameters () const |
Returns current operation parameters. More... | |
env::mode | get_mode () const |
Returns current operation mode. More... | |
env::durability | get_durability () const |
Returns current durability mode. More... | |
env::reclaiming_options | get_reclaiming () const |
Returns current reclaiming options. More... | |
env::operate_options | get_options () const |
Returns current operate options. More... | |
bool | is_pristine () const |
Returns true for a freshly created database, but false if at least one transaction was committed. More... | |
bool | is_empty () const |
Checks whether the database is empty. More... | |
size_t | dbsize_min () const |
Returns the minimal database size in bytes for the environment. More... | |
size_t | dbsize_max () const |
Returns the maximal database size in bytes for the environment. More... | |
size_t | key_min (key_mode mode) const noexcept |
Returns the minimal key size in bytes for specified keys mode. More... | |
size_t | key_max (key_mode mode) const |
Returns the maximal key size in bytes for specified keys mode. More... | |
size_t | value_min (value_mode mode) const noexcept |
Returns the minimal value size in bytes for specified values mode. More... | |
size_t | value_max (value_mode mode) const |
Returns the maximal value size in bytes for specified values mode. More... | |
size_t | transaction_size_max () const |
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. More... | |
env & | copy (const ::mdbx::filesystem::path &destination, bool compactify, bool force_dynamic_size=false) |
Make a copy (backup) of an existing environment to the specified path. More... | |
env & | copy (const ::std::wstring &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const wchar_t *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const ::std::string &destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (const char *destination, bool compactify, bool force_dynamic_size=false) |
env & | copy (filehandle fd, bool compactify, bool force_dynamic_size=false) |
Copy an environment to the specified file descriptor. More... | |
stat | get_stat () const |
Returns snapshot statistics about the MDBX environment. More... | |
size_t | get_pagesize () const |
Returns pagesize of this MDBX environment. More... | |
info | get_info () const |
Return snapshot information about the MDBX environment. More... | |
stat | get_stat (const txn &) const |
Return statistics about the MDBX environment accordingly to the specified transaction. More... | |
info | get_info (const txn &) const |
Return information about the MDBX environment accordingly to the specified transaction. More... | |
filehandle | get_filehandle () const |
Returns the file descriptor for the DXB file of MDBX environment. More... | |
path | get_path () const |
Return the path that was used for opening the environment. More... | |
MDBX_env_flags_t | get_flags () const |
Returns environment flags. More... | |
unsigned | max_readers () const |
Returns the maximum number of threads/reader slots for the environment. More... | |
unsigned | max_maps () const |
Returns the maximum number of named databases for the environment. More... | |
void * | get_context () const noexcept |
Returns the application context associated with the environment. More... | |
env & | set_context (void *your_context) |
Sets the application context associated with the environment. More... | |
env & | set_sync_threshold (size_t bytes) |
Sets threshold to force flush the data buffers to disk, for non-sync durability modes. More... | |
size_t | sync_threshold () const |
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_sync_period (const duration &period) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
duration | sync_period () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_sync_period__seconds_16dot16 (unsigned seconds_16dot16) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
unsigned | sync_period__seconds_16dot16 () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_sync_period__seconds_double (double seconds) |
Sets relative period since the last unsteady commit to force flush the data buffers to disk, for non-sync durability modes. More... | |
double | sync_period__seconds_double () const |
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk, for non-sync durability modes. More... | |
env & | set_extra_option (extra_runtime_option option, uint64_t value) |
Sets the value of a extra runtime options for an environment. More... | |
uint64_t | extra_option (extra_runtime_option option) const |
Gets the value of extra runtime options from an environment. More... | |
env & | alter_flags (MDBX_env_flags_t flags, bool on_off) |
Alter environment flags. More... | |
env & | set_geometry (const geometry &size) |
Set all size-related parameters of environment. More... | |
bool | sync_to_disk (bool force=true, bool nonblock=false) |
Flush the environment data buffers. More... | |
bool | poll_sync_to_disk () |
Performs non-blocking polling of sync-to-disk thresholds. More... | |
void | close_map (const map_handle &) |
Close a key-value map (aka sub-database) handle. Normally unnecessary. More... | |
template<typename VISITOR > | |
int | enumerate_readers (VISITOR &visitor) |
Enumerate readers. More... | |
unsigned | check_readers () |
Checks for stale readers in the lock table and return number of cleared slots. More... | |
env & | set_HandleSlowReaders (MDBX_hsr_func *) |
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled. More... | |
MDBX_hsr_func * | get_HandleSlowReaders () const noexcept |
Returns the current Handle-Slow-Readers callback used to resolve database full/overflow issue due to a reader(s) which prevents the old data from being recycled. More... | |
txn_managed | start_read () const |
Starts read (read-only) transaction. More... | |
txn_managed | prepare_read () const |
Creates but not start read transaction. More... | |
txn_managed | start_write (bool dont_wait=false) |
Starts write (read-write) transaction. More... | |
txn_managed | try_start_write () |
Tries to start write (read-write) transaction without blocking. More... | |
Additional Inherited Members | |
![]() | |
enum | mode { readonly , write_file_io , write_mapped_io } |
Operation mode. More... | |
enum | durability { robust_synchronous , half_synchronous_weak_last , lazy_weak_tail , whole_fragile } |
Durability level. More... | |
enum | remove_mode { just_remove = MDBX_ENV_JUST_DELETE , ensure_unused = MDBX_ENV_ENSURE_UNUSED , wait_for_unused = MDBX_ENV_WAIT_FOR_UNUSED } |
Deletion modes for remove(). More... | |
enum class | extra_runtime_option { max_maps = MDBX_opt_max_db , max_readers = MDBX_opt_max_readers , sync_bytes = MDBX_opt_sync_bytes , sync_period = MDBX_opt_sync_period , rp_augment_limit = MDBX_opt_rp_augment_limit , loose_limit = MDBX_opt_loose_limit , dp_reserve_limit = MDBX_opt_dp_reserve_limit , dp_limit = MDBX_opt_txn_dp_limit , dp_initial = MDBX_opt_txn_dp_initial , spill_max_denominator = MDBX_opt_spill_max_denominator , spill_min_denominator = MDBX_opt_spill_min_denominator , spill_parent4child_denominator = MDBX_opt_spill_parent4child_denominator , merge_threshold_16dot16_percent = MDBX_opt_merge_threshold_16dot16_percent , writethrough_threshold = MDBX_opt_writethrough_threshold , prefault_write_enable = MDBX_opt_prefault_write_enable } |
using | stat = ::MDBX_stat |
Statistics for a database in the MDBX environment. More... | |
using | info = ::MDBX_envinfo |
Information about the environment. More... | |
![]() | |
static size_t | default_pagesize () noexcept |
Returns default page size for current system/platform. More... | |
static bool | remove (const ::mdbx::filesystem::path &pathname, const remove_mode mode=just_remove) |
Removes the environment's files in a proper and multiprocess-safe way. More... | |
static bool | remove (const ::std::wstring &pathname, const remove_mode mode=just_remove) |
static bool | remove (const wchar_t *pathname, const remove_mode mode=just_remove) |
static bool | remove (const ::std::string &pathname, const remove_mode mode=just_remove) |
static bool | remove (const char *pathname, const remove_mode mode=just_remove) |
![]() | |
constexpr | env (MDBX_env *ptr) noexcept |
![]() | |
MDBX_env * | handle_ {nullptr} |
|
constexprdefaultnoexcept |
mdbx::env_managed::env_managed | ( | const ::mdbx::filesystem::path & | pathname, |
const operate_parameters & | , | ||
bool | accede = true |
||
) |
Open existing database.
mdbx::env_managed::env_managed | ( | const ::std::wstring & | pathname, |
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
mdbx::env_managed::env_managed | ( | const ::std::string & | pathname, |
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
mdbx::env_managed::env_managed | ( | const ::mdbx::filesystem::path & | pathname, |
const create_parameters & | , | ||
const operate_parameters & | , | ||
bool | accede = true |
||
) |
Create new or open existing database.
mdbx::env_managed::env_managed | ( | const ::std::wstring & | pathname, |
const create_parameters & | , | ||
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
mdbx::env_managed::env_managed | ( | const ::std::string & | pathname, |
const create_parameters & | , | ||
const operate_parameters & | , | ||
bool | accede = true |
||
) |
|
explicit |
|
default |
|
delete |
|
virtualnoexcept |
void mdbx::env_managed::close | ( | bool | dont_sync = false | ) |
Explicitly closes the environment and release the memory map.
Only a single thread may call this function. All transactions, databases, and cursors must already be closed before calling this function. Attempts to use any such handles after calling this function will cause a SIGSEGV
. The environment handle will be freed and must not be used again after this call.
[in] | dont_sync | A dont'sync flag, if non-zero the last checkpoint will be kept "as is" and may be still "weak" in the lazy_weak_tail or whole_fragile modes. Such "weak" checkpoint will be ignored on opening next time, and transactions since the last non-weak checkpoint (meta-page update) will rolledback for consistency guarantee. |
|
delete |
|
inlinenoexcept |
class mdbx::txn |
Unmanaged database transaction.
Like other unmanaged classes, txn
allows copying and assignment for instances, but does not destroys the represented underlying object from the own class destructor.
All database operations require a transaction handle. Transactions may be read-only or read-write.
Inherited by mdbx::txn_managed.
Public Types | |
using | info = ::MDBX_txn_info |
using | map_stat = ::MDBX_stat |
using | canary = ::MDBX_canary |
Public Member Functions | |
constexpr | txn () noexcept=default |
txn (const txn &) noexcept=default | |
txn & | operator= (txn &&other) noexcept |
txn (txn &&other) noexcept | |
~txn () noexcept | |
constexpr | operator const MDBX_txn * () const |
constexpr | operator MDBX_txn * () |
inline ::mdbx::env | env () const noexcept |
Returns the transaction's environment. More... | |
MDBX_txn_flags_t | flags () const |
Returns transaction's flags. More... | |
uint64_t | id () const |
Return the transaction's ID. More... | |
void * | get_context () const noexcept |
Returns the application context associated with the transaction. More... | |
txn & | set_context (void *your_context) |
Sets the application context associated with the transaction. More... | |
bool | is_dirty (const void *ptr) const |
Checks whether the given data is on a dirty page. More... | |
bool | is_readonly () const |
Checks whether the transaction is read-only. More... | |
bool | is_readwrite () const |
Checks whether the transaction is read-write. More... | |
info | get_info (bool scan_reader_lock_table=false) const |
Returns information about the MDBX transaction. More... | |
size_t | size_max () const |
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. More... | |
size_t | size_current () const |
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes. More... | |
void | reset_reading () |
Reset a read-only transaction. More... | |
void | renew_reading () |
Renew a read-only transaction. More... | |
txn_managed | start_nested () |
Start nested write transaction. More... | |
cursor_managed | open_cursor (map_handle map) const |
Opens cursor for specified key-value map handle. More... | |
map_handle | open_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const |
Open existing key-value map. More... | |
map_handle | open_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const |
Open existing key-value map. More... | |
map_handle | create_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) |
Create new or open existing key-value map. More... | |
map_handle | create_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) |
Create new or open existing key-value map. More... | |
void | drop_map (map_handle map) |
Drops key-value map using handle. More... | |
bool | drop_map (const char *name, bool throw_if_absent=false) |
Drops key-value map using name. More... | |
bool | drop_map (const ::std::string &name, bool throw_if_absent=false) |
Drop key-value map. More... | |
void | clear_map (map_handle map) |
Clear key-value map. More... | |
bool | clear_map (const char *name, bool throw_if_absent=false) |
bool | clear_map (const ::std::string &name, bool throw_if_absent=false) |
map_stat | get_map_stat (map_handle map) const |
Returns statistics for a sub-database. More... | |
uint32_t | get_tree_deepmask (map_handle map) const |
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given database. More... | |
map_handle::info | get_handle_info (map_handle map) const |
Returns information about key-value map (aka sub-database) handle. More... | |
txn & | put_canary (const canary &) |
Set integers markers (aka "canary") associated with the environment. More... | |
canary | get_canary () const |
Returns fours integers markers (aka "canary") associated with the environment. More... | |
uint64_t | sequence (map_handle map) const |
uint64_t | sequence (map_handle map, uint64_t increment) |
Reads and increment sequence generator associated with a key-value map (aka sub-database). More... | |
int | compare_keys (map_handle map, const slice &a, const slice &b) const noexcept |
Compare two keys according to a particular key-value map (aka sub-database). More... | |
int | compare_values (map_handle map, const slice &a, const slice &b) const noexcept |
Compare two values according to a particular key-value map (aka sub-database). More... | |
int | compare_keys (map_handle map, const pair &a, const pair &b) const noexcept |
Compare keys of two pairs according to a particular key-value map (aka sub-database). More... | |
int | compare_values (map_handle map, const pair &a, const pair &b) const noexcept |
Compare values of two pairs according to a particular key-value map (aka sub-database). More... | |
slice | get (map_handle map, const slice &key) const |
Get value by key from a key-value map (aka sub-database). More... | |
slice | get (map_handle map, slice key, size_t &values_count) const |
Get first of multi-value and values count by key from a key-value multimap (aka sub-database). More... | |
slice | get (map_handle map, const slice &key, const slice &value_at_absence) const |
Get value by key from a key-value map (aka sub-database). More... | |
slice | get (map_handle map, slice key, size_t &values_count, const slice &value_at_absence) const |
Get first of multi-value and values count by key from a key-value multimap (aka sub-database). More... | |
pair_result | get_equal_or_great (map_handle map, const slice &key) const |
Get value for equal or great key from a database. More... | |
pair_result | get_equal_or_great (map_handle map, const slice &key, const slice &value_at_absence) const |
Get value for equal or great key from a database. More... | |
MDBX_error_t | put (map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | put (map_handle map, const slice &key, slice value, put_mode mode) |
void | insert (map_handle map, const slice &key, slice value) |
value_result | try_insert (map_handle map, const slice &key, slice value) |
slice | insert_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_insert_reserve (map_handle map, const slice &key, size_t value_length) |
void | upsert (map_handle map, const slice &key, const slice &value) |
slice | upsert_reserve (map_handle map, const slice &key, size_t value_length) |
void | update (map_handle map, const slice &key, const slice &value) |
bool | try_update (map_handle map, const slice &key, const slice &value) |
slice | update_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_update_reserve (map_handle map, const slice &key, size_t value_length) |
bool | erase (map_handle map, const slice &key) |
Removes all values for given key. More... | |
bool | erase (map_handle map, const slice &key, const slice &value) |
Removes the particular multi-value entry of the key. More... | |
void | replace (map_handle map, const slice &key, slice old_value, const slice &new_value) |
Replaces the particular multi-value of the key with a new value. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | extract (map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Removes and return a value of the key. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace (map_handle map, const slice &key, const slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Replaces and returns a value of the key with new one. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace_reserve (map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
void | append (map_handle map, const slice &key, const slice &value, bool multivalue_order_preserved=true) |
Adding a key-value pair, provided that ascending order of the keys and (optionally) values are preserved. More... | |
size_t | put_multiple (map_handle map, const slice &key, const size_t value_length, const void *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
template<typename VALUE > | |
size_t | put_multiple (map_handle map, const slice &key, const VALUE *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
template<typename VALUE > | |
void | put_multiple (map_handle map, const slice &key, const ::std::vector< VALUE > &vector, put_mode mode) |
ptrdiff_t | estimate (map_handle map, const pair &from, const pair &to) const |
ptrdiff_t | estimate (map_handle map, const slice &from, const slice &to) const |
ptrdiff_t | estimate_from_first (map_handle map, const slice &to) const |
ptrdiff_t | estimate_to_last (map_handle map, const slice &from) const |
Protected Member Functions | |
constexpr | txn (MDBX_txn *ptr) noexcept |
Protected Attributes | |
MDBX_txn * | handle_ {nullptr} |
Friends | |
class | cursor |
constexpr friend bool | operator== (const txn &a, const txn &b) noexcept |
constexpr friend bool | operator!= (const txn &a, const txn &b) noexcept |
using mdbx::txn::canary = ::MDBX_canary |
using mdbx::txn::info = ::MDBX_txn_info |
using mdbx::txn::map_stat = ::MDBX_stat |
|
constexprdefaultnoexcept |
|
defaultnoexcept |
bool mdbx::txn::clear_map | ( | const char * | name, |
bool | throw_if_absent = false |
||
) |
True
if the key-value map existed and was cleared, either false
if the key-value map did not exist and there is nothing to clear. bool mdbx::txn::drop_map | ( | const char * | name, |
bool | throw_if_absent = false |
||
) |
Drops key-value map using name.
True
if the key-value map existed and was deleted, either false
if the key-value map did not exist and there is nothing to delete.
|
inline |
Checks whether the transaction is read-only.
|
inline |
Checks whether the transaction is read-write.
|
inline |
|
inline |
|
inline |
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes.
|
inline |
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
txn_managed mdbx::txn::start_nested | ( | ) |
Start nested write transaction.
|
friend |
|
protected |
class mdbx::txn_managed |
Managed database transaction.
As other managed classes, txn_managed
destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.
All database operations require a transaction handle. Transactions may be read-only or read-write.
Inherits mdbx::txn.
Public Types | |
using | commit_latency = MDBX_commit_latency |
![]() | |
using | info = ::MDBX_txn_info |
using | map_stat = ::MDBX_stat |
using | canary = ::MDBX_canary |
Public Member Functions | |
constexpr | txn_managed () noexcept=default |
txn_managed (txn_managed &&)=default | |
txn_managed & | operator= (txn_managed &&other) noexcept |
txn_managed (const txn_managed &)=delete | |
txn_managed & | operator= (const txn_managed &)=delete |
~txn_managed () noexcept | |
void | abort () |
Abandon all the operations of the transaction instead of saving ones. More... | |
void | commit () |
Commit all the operations of a transaction into the database. More... | |
void | commit (commit_latency *) |
Commit all the operations of a transaction into the database and collect latency information. More... | |
void | commit (commit_latency &latency) |
Commit all the operations of a transaction into the database and collect latency information. More... | |
commit_latency | commit_get_latency () |
Commit all the operations of a transaction into the database and return latency information. More... | |
![]() | |
constexpr | txn () noexcept=default |
txn (const txn &) noexcept=default | |
txn & | operator= (txn &&other) noexcept |
txn (txn &&other) noexcept | |
~txn () noexcept | |
constexpr | operator const MDBX_txn * () const |
constexpr | operator MDBX_txn * () |
inline ::mdbx::env | env () const noexcept |
Returns the transaction's environment. More... | |
MDBX_txn_flags_t | flags () const |
Returns transaction's flags. More... | |
uint64_t | id () const |
Return the transaction's ID. More... | |
void * | get_context () const noexcept |
Returns the application context associated with the transaction. More... | |
txn & | set_context (void *your_context) |
Sets the application context associated with the transaction. More... | |
bool | is_dirty (const void *ptr) const |
Checks whether the given data is on a dirty page. More... | |
bool | is_readonly () const |
Checks whether the transaction is read-only. More... | |
bool | is_readwrite () const |
Checks whether the transaction is read-write. More... | |
info | get_info (bool scan_reader_lock_table=false) const |
Returns information about the MDBX transaction. More... | |
size_t | size_max () const |
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes. More... | |
size_t | size_current () const |
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes. More... | |
void | reset_reading () |
Reset a read-only transaction. More... | |
void | renew_reading () |
Renew a read-only transaction. More... | |
txn_managed | start_nested () |
Start nested write transaction. More... | |
cursor_managed | open_cursor (map_handle map) const |
Opens cursor for specified key-value map handle. More... | |
map_handle | open_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const |
Open existing key-value map. More... | |
map_handle | open_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) const |
Open existing key-value map. More... | |
map_handle | create_map (const char *name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) |
Create new or open existing key-value map. More... | |
map_handle | create_map (const ::std::string &name, const ::mdbx::key_mode key_mode=::mdbx::key_mode::usual, const ::mdbx::value_mode value_mode=::mdbx::value_mode::single) |
Create new or open existing key-value map. More... | |
void | drop_map (map_handle map) |
Drops key-value map using handle. More... | |
bool | drop_map (const char *name, bool throw_if_absent=false) |
Drops key-value map using name. More... | |
bool | drop_map (const ::std::string &name, bool throw_if_absent=false) |
Drop key-value map. More... | |
void | clear_map (map_handle map) |
Clear key-value map. More... | |
bool | clear_map (const char *name, bool throw_if_absent=false) |
bool | clear_map (const ::std::string &name, bool throw_if_absent=false) |
map_stat | get_map_stat (map_handle map) const |
Returns statistics for a sub-database. More... | |
uint32_t | get_tree_deepmask (map_handle map) const |
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given database. More... | |
map_handle::info | get_handle_info (map_handle map) const |
Returns information about key-value map (aka sub-database) handle. More... | |
txn & | put_canary (const canary &) |
Set integers markers (aka "canary") associated with the environment. More... | |
canary | get_canary () const |
Returns fours integers markers (aka "canary") associated with the environment. More... | |
uint64_t | sequence (map_handle map) const |
uint64_t | sequence (map_handle map, uint64_t increment) |
Reads and increment sequence generator associated with a key-value map (aka sub-database). More... | |
int | compare_keys (map_handle map, const slice &a, const slice &b) const noexcept |
Compare two keys according to a particular key-value map (aka sub-database). More... | |
int | compare_values (map_handle map, const slice &a, const slice &b) const noexcept |
Compare two values according to a particular key-value map (aka sub-database). More... | |
int | compare_keys (map_handle map, const pair &a, const pair &b) const noexcept |
Compare keys of two pairs according to a particular key-value map (aka sub-database). More... | |
int | compare_values (map_handle map, const pair &a, const pair &b) const noexcept |
Compare values of two pairs according to a particular key-value map (aka sub-database). More... | |
slice | get (map_handle map, const slice &key) const |
Get value by key from a key-value map (aka sub-database). More... | |
slice | get (map_handle map, slice key, size_t &values_count) const |
Get first of multi-value and values count by key from a key-value multimap (aka sub-database). More... | |
slice | get (map_handle map, const slice &key, const slice &value_at_absence) const |
Get value by key from a key-value map (aka sub-database). More... | |
slice | get (map_handle map, slice key, size_t &values_count, const slice &value_at_absence) const |
Get first of multi-value and values count by key from a key-value multimap (aka sub-database). More... | |
pair_result | get_equal_or_great (map_handle map, const slice &key) const |
Get value for equal or great key from a database. More... | |
pair_result | get_equal_or_great (map_handle map, const slice &key, const slice &value_at_absence) const |
Get value for equal or great key from a database. More... | |
MDBX_error_t | put (map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | put (map_handle map, const slice &key, slice value, put_mode mode) |
void | insert (map_handle map, const slice &key, slice value) |
value_result | try_insert (map_handle map, const slice &key, slice value) |
slice | insert_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_insert_reserve (map_handle map, const slice &key, size_t value_length) |
void | upsert (map_handle map, const slice &key, const slice &value) |
slice | upsert_reserve (map_handle map, const slice &key, size_t value_length) |
void | update (map_handle map, const slice &key, const slice &value) |
bool | try_update (map_handle map, const slice &key, const slice &value) |
slice | update_reserve (map_handle map, const slice &key, size_t value_length) |
value_result | try_update_reserve (map_handle map, const slice &key, size_t value_length) |
bool | erase (map_handle map, const slice &key) |
Removes all values for given key. More... | |
bool | erase (map_handle map, const slice &key, const slice &value) |
Removes the particular multi-value entry of the key. More... | |
void | replace (map_handle map, const slice &key, slice old_value, const slice &new_value) |
Replaces the particular multi-value of the key with a new value. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | extract (map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Removes and return a value of the key. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace (map_handle map, const slice &key, const slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
Replaces and returns a value of the key with new one. More... | |
template<class ALLOCATOR , typename CAPACITY_POLICY > | |
buffer< ALLOCATOR, CAPACITY_POLICY > | replace_reserve (map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &allocator=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type()) |
void | append (map_handle map, const slice &key, const slice &value, bool multivalue_order_preserved=true) |
Adding a key-value pair, provided that ascending order of the keys and (optionally) values are preserved. More... | |
size_t | put_multiple (map_handle map, const slice &key, const size_t value_length, const void *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
template<typename VALUE > | |
size_t | put_multiple (map_handle map, const slice &key, const VALUE *values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
template<typename VALUE > | |
void | put_multiple (map_handle map, const slice &key, const ::std::vector< VALUE > &vector, put_mode mode) |
ptrdiff_t | estimate (map_handle map, const pair &from, const pair &to) const |
ptrdiff_t | estimate (map_handle map, const slice &from, const slice &to) const |
ptrdiff_t | estimate_from_first (map_handle map, const slice &to) const |
ptrdiff_t | estimate_to_last (map_handle map, const slice &from) const |
Friends | |
class | env |
class | txn |
Additional Inherited Members | |
![]() | |
constexpr | txn (MDBX_txn *ptr) noexcept |
![]() | |
MDBX_txn * | handle_ {nullptr} |
|
constexprdefaultnoexcept |
|
default |
|
delete |
|
noexcept |
void mdbx::txn_managed::abort | ( | ) |
Abandon all the operations of the transaction instead of saving ones.
void mdbx::txn_managed::commit | ( | ) |
Commit all the operations of a transaction into the database.
|
inline |
Commit all the operations of a transaction into the database and collect latency information.
void mdbx::txn_managed::commit | ( | commit_latency * | ) |
Commit all the operations of a transaction into the database and collect latency information.
|
inline |
Commit all the operations of a transaction into the database and return latency information.
|
delete |
|
inlinenoexcept |
|
friend |
|
friend |
class mdbx::cursor |
Unmanaged cursor.
Like other unmanaged classes, cursor
allows copying and assignment for instances, but does not destroys the represented underlying object from the own class destructor.
Inherited by mdbx::cursor_managed.
Public Types | |
enum | move_operation { first = MDBX_FIRST , last = MDBX_LAST , next = MDBX_NEXT , previous = MDBX_PREV , get_current = MDBX_GET_CURRENT , multi_prevkey_lastvalue = MDBX_PREV_NODUP , multi_currentkey_firstvalue = MDBX_FIRST_DUP , multi_currentkey_prevvalue = MDBX_PREV_DUP , multi_currentkey_nextvalue = MDBX_NEXT_DUP , multi_currentkey_lastvalue = MDBX_LAST_DUP , multi_nextkey_firstvalue = MDBX_NEXT_NODUP , multi_find_pair = MDBX_GET_BOTH , multi_exactkey_lowerboundvalue = MDBX_GET_BOTH_RANGE , find_key = MDBX_SET , key_exact = MDBX_SET_KEY , key_lowerbound = MDBX_SET_RANGE } |
Public Member Functions | |
constexpr | cursor () noexcept=default |
cursor (const cursor &) noexcept=default | |
cursor & | operator= (cursor &&other) noexcept |
cursor (cursor &&other) noexcept | |
~cursor () noexcept | |
cursor_managed | clone (void *your_context=nullptr) const |
constexpr | operator const MDBX_cursor * () const |
constexpr | operator MDBX_cursor * () |
void * | get_context () const noexcept |
Returns the application context associated with the cursor. More... | |
cursor & | set_context (void *your_context) |
Sets the application context associated with the cursor. More... | |
move_result | move (move_operation operation, bool throw_notfound) |
move_result | to_first (bool throw_notfound=true) |
move_result | to_previous (bool throw_notfound=true) |
move_result | to_previous_last_multi (bool throw_notfound=true) |
move_result | to_current_first_multi (bool throw_notfound=true) |
move_result | to_current_prev_multi (bool throw_notfound=true) |
move_result | current (bool throw_notfound=true) const |
move_result | to_current_next_multi (bool throw_notfound=true) |
move_result | to_current_last_multi (bool throw_notfound=true) |
move_result | to_next_first_multi (bool throw_notfound=true) |
move_result | to_next (bool throw_notfound=true) |
move_result | to_last (bool throw_notfound=true) |
move_result | move (move_operation operation, const slice &key, bool throw_notfound) |
move_result | find (const slice &key, bool throw_notfound=true) |
move_result | lower_bound (const slice &key, bool throw_notfound=true) |
move_result | move (move_operation operation, const slice &key, const slice &value, bool throw_notfound) |
move_result | find_multivalue (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
bool | seek (const slice &key) |
bool | move (move_operation operation, slice &key, slice &value, bool throw_notfound) |
size_t | count_multivalue () const |
Return count of duplicates for current key. More... | |
bool | eof () const |
bool | on_first () const |
bool | on_last () const |
estimate_result | estimate (const slice &key, const slice &value) const |
estimate_result | estimate (const slice &key) const |
estimate_result | estimate (move_operation operation) const |
estimate_result | estimate (move_operation operation, slice &key) const |
void | renew (const ::mdbx::txn &txn) |
Renew/bind a cursor with a new transaction and previously used key-value map handle. More... | |
void | bind (const ::mdbx::txn &txn, ::mdbx::map_handle map_handle) |
Bind/renew a cursor with a new transaction and specified key-value map handle. More... | |
inline ::mdbx::txn | txn () const |
Returns the cursor's transaction. More... | |
map_handle | map () const |
operator::mdbx::txn () const | |
operator::mdbx::map_handle () const | |
MDBX_error_t | put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | insert (const slice &key, slice value) |
value_result | try_insert (const slice &key, slice value) |
slice | insert_reserve (const slice &key, size_t value_length) |
value_result | try_insert_reserve (const slice &key, size_t value_length) |
void | upsert (const slice &key, const slice &value) |
slice | upsert_reserve (const slice &key, size_t value_length) |
void | update (const slice &key, const slice &value) |
bool | try_update (const slice &key, const slice &value) |
slice | update_reserve (const slice &key, size_t value_length) |
value_result | try_update_reserve (const slice &key, size_t value_length) |
bool | erase (bool whole_multivalue=false) |
Removes single key-value pair or all multi-values at the current cursor position. More... | |
bool | erase (const slice &key, bool whole_multivalue=true) |
Seeks and removes first value or whole multi-value of the given key. More... | |
bool | erase (const slice &key, const slice &value) |
Seeks and removes the particular multi-value entry of the key. More... | |
Protected Member Functions | |
constexpr | cursor (MDBX_cursor *ptr) noexcept |
bool | move (move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const |
ptrdiff_t | estimate (move_operation operation, MDBX_val *key, MDBX_val *value) const |
Protected Attributes | |
MDBX_cursor * | handle_ {nullptr} |
Friends | |
constexpr friend bool | operator== (const cursor &a, const cursor &b) noexcept |
constexpr friend bool | operator!= (const cursor &a, const cursor &b) noexcept |
|
constexprdefaultnoexcept |
|
defaultnoexcept |
|
inline |
|
inline |
|
inline |
|
protected |
class mdbx::cursor_managed |
Managed cursor.
As other managed classes, cursor_managed
destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.
Inherits mdbx::cursor.
Public Member Functions | |
cursor_managed (void *your_context=nullptr) | |
Creates a new managed cursor with underlying object. More... | |
void | close () |
Explicitly closes the cursor. More... | |
cursor_managed (cursor_managed &&)=default | |
cursor_managed & | operator= (cursor_managed &&other) noexcept |
cursor_managed (const cursor_managed &)=delete | |
cursor_managed & | operator= (const cursor_managed &)=delete |
~cursor_managed () noexcept | |
![]() | |
constexpr | cursor () noexcept=default |
cursor (const cursor &) noexcept=default | |
cursor & | operator= (cursor &&other) noexcept |
cursor (cursor &&other) noexcept | |
~cursor () noexcept | |
cursor_managed | clone (void *your_context=nullptr) const |
constexpr | operator const MDBX_cursor * () const |
constexpr | operator MDBX_cursor * () |
void * | get_context () const noexcept |
Returns the application context associated with the cursor. More... | |
cursor & | set_context (void *your_context) |
Sets the application context associated with the cursor. More... | |
move_result | move (move_operation operation, bool throw_notfound) |
move_result | to_first (bool throw_notfound=true) |
move_result | to_previous (bool throw_notfound=true) |
move_result | to_previous_last_multi (bool throw_notfound=true) |
move_result | to_current_first_multi (bool throw_notfound=true) |
move_result | to_current_prev_multi (bool throw_notfound=true) |
move_result | current (bool throw_notfound=true) const |
move_result | to_current_next_multi (bool throw_notfound=true) |
move_result | to_current_last_multi (bool throw_notfound=true) |
move_result | to_next_first_multi (bool throw_notfound=true) |
move_result | to_next (bool throw_notfound=true) |
move_result | to_last (bool throw_notfound=true) |
move_result | move (move_operation operation, const slice &key, bool throw_notfound) |
move_result | find (const slice &key, bool throw_notfound=true) |
move_result | lower_bound (const slice &key, bool throw_notfound=true) |
move_result | move (move_operation operation, const slice &key, const slice &value, bool throw_notfound) |
move_result | find_multivalue (const slice &key, const slice &value, bool throw_notfound=true) |
move_result | lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false) |
bool | seek (const slice &key) |
bool | move (move_operation operation, slice &key, slice &value, bool throw_notfound) |
size_t | count_multivalue () const |
Return count of duplicates for current key. More... | |
bool | eof () const |
bool | on_first () const |
bool | on_last () const |
estimate_result | estimate (const slice &key, const slice &value) const |
estimate_result | estimate (const slice &key) const |
estimate_result | estimate (move_operation operation) const |
estimate_result | estimate (move_operation operation, slice &key) const |
void | renew (const ::mdbx::txn &txn) |
Renew/bind a cursor with a new transaction and previously used key-value map handle. More... | |
void | bind (const ::mdbx::txn &txn, ::mdbx::map_handle map_handle) |
Bind/renew a cursor with a new transaction and specified key-value map handle. More... | |
inline ::mdbx::txn | txn () const |
Returns the cursor's transaction. More... | |
map_handle | map () const |
operator::mdbx::txn () const | |
operator::mdbx::map_handle () const | |
MDBX_error_t | put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept |
void | insert (const slice &key, slice value) |
value_result | try_insert (const slice &key, slice value) |
slice | insert_reserve (const slice &key, size_t value_length) |
value_result | try_insert_reserve (const slice &key, size_t value_length) |
void | upsert (const slice &key, const slice &value) |
slice | upsert_reserve (const slice &key, size_t value_length) |
void | update (const slice &key, const slice &value) |
bool | try_update (const slice &key, const slice &value) |
slice | update_reserve (const slice &key, size_t value_length) |
value_result | try_update_reserve (const slice &key, size_t value_length) |