30#if defined(__SIZEOF_INT128__) && !defined(__GLIBCXX_TYPE_INT_N_0) && defined(__clang__) && __clang_major__ < 4
31#define __GLIBCXX_BITSIZE_INT_N_0 128
32#define __GLIBCXX_TYPE_INT_N_0 __int128
35#if !defined(__cplusplus) || __cplusplus < 201103L
36#if !defined(_MSC_VER) || _MSC_VER < 1900
37#error "C++11 compiler or better is required"
39#error "Please add `/Zc:__cplusplus` to MSVC compiler options to enforce it conform ISO C++"
43#if (defined(_WIN32) || defined(_WIN64)) && MDBX_WITHOUT_MSVC_CRT
44#error "CRT is required for C++ API, the MDBX_WITHOUT_MSVC_CRT option must be disabled"
48#define __has_include(header) (0)
51#if __has_include(<version>)
73#if defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L
74#include <memory_resource>
77#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
81#ifndef MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM
82#ifdef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
83#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 1
84#elif defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && __cplusplus >= 201703L
85#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 0
86#elif (!defined(_MSC_VER) || __cplusplus >= 201403L || \
87 (defined(_MSC_VER) && defined(_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING) && __cplusplus >= 201403L))
88#if defined(__cpp_lib_experimental_filesystem) && __cpp_lib_experimental_filesystem >= 201406L
89#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 1
90#elif defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L && __has_include(<experimental/filesystem>)
91#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 1
93#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 0
96#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 0
100#if MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM
101#include <experimental/filesystem>
102#elif defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L
106#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
110#if !defined(_MSC_VER) || defined(__clang__)
112#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) extern template class API_ATTRIBUTES API_TYPENAME
113#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) template class API_TYPENAME
116#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) extern template class API_TYPENAME
117#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME) template class API_ATTRIBUTES API_TYPENAME
120#if __cplusplus >= 201103L
127#if (defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L) || \
128 (defined(__cpp_lib_endian) && __cpp_lib_endian >= 201907L) || \
129 (defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L) || \
130 (defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L)
132#elif !(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__))
133#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
134#define __ORDER_LITTLE_ENDIAN__ __LITTLE_ENDIAN
135#define __ORDER_BIG_ENDIAN__ __BIG_ENDIAN
136#define __BYTE_ORDER__ __BYTE_ORDER
137#elif defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
138#define __ORDER_LITTLE_ENDIAN__ _LITTLE_ENDIAN
139#define __ORDER_BIG_ENDIAN__ _BIG_ENDIAN
140#define __BYTE_ORDER__ _BYTE_ORDER
142#define __ORDER_LITTLE_ENDIAN__ 1234
143#define __ORDER_BIG_ENDIAN__ 4321
144#if defined(__LITTLE_ENDIAN__) || (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || defined(__ARMEL__) || \
145 defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(__MIPSEL__) || defined(_MIPSEL) || defined(__MIPSEL) || \
146 defined(_M_ARM) || defined(_M_ARM64) || defined(__e2k__) || defined(__elbrus_4c__) || defined(__elbrus_8c__) || \
147 defined(__bfin__) || defined(__BFIN__) || defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
148 defined(__ia64) || defined(_M_IA64) || defined(__itanium__) || defined(__ia32__) || defined(__CYGWIN__) || \
149 defined(_WIN64) || defined(_WIN32) || defined(__TOS_WIN__) || defined(__WINDOWS__)
150#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
151#elif defined(__BIG_ENDIAN__) || (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || defined(__ARMEB__) || \
152 defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB) || \
153 defined(__m68k__) || defined(M68000) || defined(__hppa__) || defined(__hppa) || defined(__HPPA__) || \
154 defined(__sparc__) || defined(__sparc) || defined(__370__) || defined(__THW_370__) || defined(__s390__) || \
155 defined(__s390x__) || defined(__SYSC_ZARCH__)
156#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
163#define MDBX_CXX17_CONSTEXPR constexpr
164#elif defined(__cpp_constexpr) && __cpp_constexpr >= 201603L && \
165 ((defined(_MSC_VER) && _MSC_VER >= 1915) || (defined(__clang__) && __clang_major__ > 5) || \
166 (defined(__GNUC__) && __GNUC__ > 7) || (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
167#define MDBX_CXX17_CONSTEXPR constexpr
169#define MDBX_CXX17_CONSTEXPR inline
174#define MDBX_CXX20_CONSTEXPR constexpr
175#elif defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L && \
176 defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
177#define MDBX_CXX20_CONSTEXPR constexpr
179#define MDBX_CXX20_CONSTEXPR inline
182#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
183#define MDBX_CXX01_CONSTEXPR_ENUM MDBX_CXX01_CONSTEXPR
184#define MDBX_CXX11_CONSTEXPR_ENUM MDBX_CXX11_CONSTEXPR
185#define MDBX_CXX14_CONSTEXPR_ENUM MDBX_CXX14_CONSTEXPR
186#define MDBX_CXX17_CONSTEXPR_ENUM MDBX_CXX17_CONSTEXPR
187#define MDBX_CXX20_CONSTEXPR_ENUM MDBX_CXX20_CONSTEXPR
189#define MDBX_CXX01_CONSTEXPR_ENUM inline
190#define MDBX_CXX11_CONSTEXPR_ENUM inline
191#define MDBX_CXX14_CONSTEXPR_ENUM inline
192#define MDBX_CXX17_CONSTEXPR_ENUM inline
193#define MDBX_CXX20_CONSTEXPR_ENUM inline
197#if defined(CONSTEXPR_ASSERT)
198#define MDBX_CONSTEXPR_ASSERT(expr) CONSTEXPR_ASSERT(expr)
200#define MDBX_CONSTEXPR_ASSERT(expr) void(0)
202#define MDBX_CONSTEXPR_ASSERT(expr) ((expr) ? void(0) : [] { assert(!#expr); }())
206#if defined(DOXYGEN) || (defined(__GNUC__) || __has_builtin(__builtin_expect)) && !defined(__COVERITY__)
207#define MDBX_LIKELY(cond) __builtin_expect(!!(cond), 1)
209#define MDBX_LIKELY(x) (x)
214#if defined(DOXYGEN) || (defined(__GNUC__) || __has_builtin(__builtin_expect)) && !defined(__COVERITY__)
215#define MDBX_UNLIKELY(cond) __builtin_expect(!!(cond), 0)
217#define MDBX_UNLIKELY(x) (x)
223#define MDBX_IF_CONSTEXPR constexpr
224#elif defined(__cpp_if_constexpr) && __cpp_if_constexpr >= 201606L
225#define MDBX_IF_CONSTEXPR constexpr
227#define MDBX_IF_CONSTEXPR
230#if defined(DOXYGEN) || (__has_cpp_attribute(fallthrough) && (!defined(__clang__) || __clang__ > 4)) || \
231 __cplusplus >= 201703L
232#define MDBX_CXX17_FALLTHROUGH [[fallthrough]]
234#define MDBX_CXX17_FALLTHROUGH
237#if defined(DOXYGEN) || (__has_cpp_attribute(likely) >= 201803L && (!defined(__GNUC__) || __GNUC__ > 9))
238#define MDBX_CXX20_LIKELY [[likely]]
240#define MDBX_CXX20_LIKELY
243#ifndef MDBX_CXX20_UNLIKELY
244#if defined(DOXYGEN) || (__has_cpp_attribute(unlikely) >= 201803L && (!defined(__GNUC__) || __GNUC__ > 9))
245#define MDBX_CXX20_UNLIKELY [[unlikely]]
247#define MDBX_CXX20_UNLIKELY
251#ifndef MDBX_HAVE_CXX20_CONCEPTS
252#if defined(__cpp_concepts) && __cpp_concepts >= 202002L && defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
254#define MDBX_HAVE_CXX20_CONCEPTS 1
255#elif defined(DOXYGEN)
256#define MDBX_HAVE_CXX20_CONCEPTS 1
258#define MDBX_HAVE_CXX20_CONCEPTS 0
262#ifndef MDBX_CXX20_CONCEPT
263#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN)
264#define MDBX_CXX20_CONCEPT(CONCEPT, NAME) CONCEPT NAME
266#define MDBX_CXX20_CONCEPT(CONCEPT, NAME) typename NAME
270#ifndef MDBX_ASSERT_CXX20_CONCEPT_SATISFIED
271#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN)
272#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE) static_assert(CONCEPT<TYPE>)
274#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, NAME) \
275 static_assert(true, MDBX_STRINGIFY(CONCEPT) "<" MDBX_STRINGIFY(TYPE) ">")
280#pragma warning(push, 4)
281#pragma warning(disable : 4127)
282#pragma warning(disable : 4251)
284#pragma warning(disable : 4275)
289#pragma warning(disable : 4702)
292#if defined(__LCC__) && __LCC__ >= 126
293#pragma diagnostic push
295#pragma diag_suppress 3058
297#pragma diag_suppress 3060
312#if defined(DOXYGEN) || (defined(__cpp_char8_t) && __cpp_char8_t >= 201811)
322using byte =
unsigned char;
325#if defined(__cpp_lib_endian) && __cpp_lib_endian >= 201907L
326using endian = ::std::endian;
327#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__)
328enum class endian { little = __ORDER_LITTLE_ENDIAN__, big = __ORDER_BIG_ENDIAN__, native = __BYTE_ORDER__ };
330#error "Please use a C++ compiler provides byte order information or C++20 support"
354#if defined(DOXYGEN) || \
355 (defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L && _GLIBCXX_USE_CXX11_ABI)
365template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
class buffer;
377template <
class ALLOCATOR = default_allocator>
378using string = ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR>;
381#if MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM
383namespace filesystem = ::std::experimental::filesystem::v1;
385namespace filesystem = ::std::experimental::filesystem;
387#define MDBX_STD_FILESYSTEM_PATH ::mdbx::filesystem::path
388#elif defined(DOXYGEN) || \
389 (defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && defined(__cpp_lib_string_view) && \
390 __cpp_lib_string_view >= 201606L && \
391 (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) && \
392 (!defined(__IPHONE_OS_VERSION_MIN_REQUIRED) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 130100)) && \
393 (!defined(_MSC_VER) || __cplusplus >= 201703L)
394namespace filesystem = ::std::filesystem;
400#define MDBX_STD_FILESYSTEM_PATH ::mdbx::filesystem::path
403#ifdef MDBX_STD_FILESYSTEM_PATH
405#elif defined(_WIN32) || defined(_WIN64)
406using path = ::std::wstring;
408using path = ::std::string;
411#if defined(__SIZEOF_INT128__) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128)
412#ifndef MDBX_U128_TYPE
413#define MDBX_U128_TYPE __uint128_t
415#ifndef MDBX_I128_TYPE
416#define MDBX_I128_TYPE __int128_t
420#if __cplusplus >= 201103L || defined(DOXYGEN)
422using duration = ::std::chrono::duration<unsigned, ::std::ratio<1, 65536>>;
433 ::std::exception_ptr captured_;
441 inline
bool is_clean() const noexcept;
442 inline
void capture() noexcept;
470 const
char *
what() const noexcept;
478 [[noreturn]]
void panic(const
char *context_where_when, const
char *func_who_what) const noexcept;
484 inline
void panic_on_failure(const
char *context_where, const
char *func_who) const noexcept;
485 inline
void success_or_panic(const
char *context_where, const
char *func_who) const noexcept;
489 static inline void throw_on_failure(
int error_code);
490 static inline bool boolean_or_throw(
int error_code);
491 static inline void success_or_throw(
int error_code,
const exception_thunk &);
492 static inline bool boolean_or_throw(
int error_code,
const exception_thunk &);
493 static inline void panic_on_failure(
int error_code,
const char *context_where,
const char *func_who)
noexcept;
494 static inline void success_or_panic(
int error_code,
const char *context_where,
const char *func_who)
noexcept;
500 using base = ::std::runtime_error;
518 fatal(const ::mdbx::error &)
noexcept;
528#define MDBX_DECLARE_EXCEPTION(NAME) \
529 struct LIBMDBX_API_TYPE NAME : public exception { \
530 NAME(const ::mdbx::error &); \
531 virtual ~NAME() noexcept; \
565#undef MDBX_DECLARE_EXCEPTION
575static MDBX_CXX14_CONSTEXPR size_t check_length(
size_t headroom,
size_t payload,
size_t tailroom);
584#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN)
591 { a.is_empty() } -> std::same_as<bool>;
592 { a.envisage_result_length() } -> std::same_as<size_t>;
593 { a.write_bytes(&array[0],
size_t(42)) } -> std::same_as<char *>;
601 { a.is_empty() } -> std::same_as<bool>;
602 { a.envisage_result_length() } -> std::same_as<size_t>;
603 { a.write_bytes(&array[0],
size_t(42)) } -> std::same_as<char *>;
612 { a.is_erroneous() } -> std::same_as<bool>;
624 const ALLOCATOR &allocator = ALLOCATOR());
626template <
class ALLOCATOR = default_allocator, MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER)>
629template <
class ALLOCATOR = default_allocator, MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER)>
664 template <
class CHAR,
class T,
class A>
673#if defined(DOXYGEN) || (defined(__cpp_lib_span) && __cpp_lib_span >= 202002L)
675 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
676 "Must be a standard layout type!");
679 template <
typename POD> MDBX_CXX14_CONSTEXPR ::std::span<const POD>
as_span()
const {
680 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
681 "Must be a standard layout type!");
684 return ::std::span<const POD>(
static_cast<const POD *
>(
data()),
size() /
sizeof(POD));
688 template <
typename POD> MDBX_CXX14_CONSTEXPR ::std::span<POD>
as_span() {
689 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
690 "Must be a standard layout type!");
693 return ::std::span<POD>(
static_cast<POD *
>(
data()),
size() /
sizeof(POD));
703#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
705 template <
class CHAR,
class T>
708 template <
class CHAR,
class T>
slice(::std::basic_string_view<CHAR, T> &&sv) :
slice(sv) { sv = {}; }
714 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
715 "Must be a standard layout type!");
716 return slice(&pod,
sizeof(pod));
719 inline slice &assign(
const void *ptr,
size_t bytes);
720 inline slice &assign(
const slice &src)
noexcept;
721 inline slice &assign(const ::MDBX_val &src);
724 inline slice &assign(
const void *begin,
const void *end);
725 template <
class CHAR,
class T,
class ALLOCATOR>
slice &
assign(const ::std::basic_string<CHAR, T, ALLOCATOR> &str) {
726 return assign(str.data(), str.length() *
sizeof(CHAR));
728 inline slice &assign(
const char *c_str);
729#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
730 template <
class CHAR,
class T>
slice &
assign(const ::std::basic_string_view<CHAR, T> &view) {
731 return assign(view.begin(), view.end());
733 template <
class CHAR,
class T>
slice &
assign(::std::basic_string_view<CHAR, T> &&view) {
744 operator const MDBX_val *()
const noexcept {
return this; }
746#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
747 template <
class CHAR,
class T>
slice &
operator=(const ::std::basic_string_view<CHAR, T> &view) {
751 template <
class CHAR,
class T>
slice &
operator=(::std::basic_string_view<CHAR, T> &&view) {
return assign(view); }
754 template <
class CHAR =
char,
class T = ::std::
char_traits<CHAR>>
755 MDBX_CXX11_CONSTEXPR ::std::basic_string_view<CHAR, T>
string_view() const noexcept {
756 static_assert(
sizeof(CHAR) == 1,
"Must be single byte characters");
761 template <
class CHAR,
class T>
767 template <
class CHAR =
char,
class T = ::std::
char_traits<CHAR>,
class ALLOCATOR = default_allocator>
768 MDBX_CXX20_CONSTEXPR ::std::basic_string<CHAR, T, ALLOCATOR>
769 as_string(
const ALLOCATOR &allocator = ALLOCATOR())
const {
770 static_assert(
sizeof(CHAR) == 1,
"Must be single byte characters");
771 return ::std::basic_string<CHAR, T, ALLOCATOR>(
char_ptr(),
length(), allocator);
774 template <
class CHAR,
class T,
class ALLOCATOR>
780 template <
class ALLOCATOR = default_allocator>
781 inline string<ALLOCATOR> as_hex_string(
bool uppercase =
false,
unsigned wrap_width = 0,
782 const ALLOCATOR &allocator = ALLOCATOR())
const;
786 template <
class ALLOCATOR = default_allocator>
787 inline string<ALLOCATOR> as_base58_string(
unsigned wrap_width = 0,
const ALLOCATOR &allocator = ALLOCATOR())
const;
791 template <
class ALLOCATOR = default_allocator>
792 inline string<ALLOCATOR> as_base64_string(
unsigned wrap_width = 0,
const ALLOCATOR &allocator = ALLOCATOR())
const;
795 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
797 const ALLOCATOR &allocator = ALLOCATOR())
const;
801 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
803 const ALLOCATOR &allocator = ALLOCATOR())
const;
807 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
809 const ALLOCATOR &allocator = ALLOCATOR())
const;
812 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
814 const ALLOCATOR &allocator = ALLOCATOR())
const;
818 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
820 const ALLOCATOR &allocator = ALLOCATOR())
const;
824 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
826 const ALLOCATOR &allocator = ALLOCATOR())
const;
857#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
858 template <
class CHAR,
class T>
void swap(::std::basic_string_view<CHAR, T> &view)
noexcept {
859 static_assert(
sizeof(CHAR) == 1,
"Must be single byte characters");
860 const auto temp = ::std::basic_string_view<CHAR, T>(*
this);
919 inline
void remove_prefix(
size_t n) noexcept;
923 inline
void remove_suffix(
size_t n) noexcept;
927 inline
void safe_remove_prefix(
size_t n);
931 inline
void safe_remove_suffix(
size_t n);
993 const
slice &b) noexcept;
1008 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
1009 "Must be a standard layout type!");
1013 memcpy(&r,
data(),
sizeof(r));
1019#ifdef MDBX_U128_TYPE
1027#ifdef MDBX_I128_TYPE
1035#ifdef MDBX_U128_TYPE
1043#ifdef MDBX_I128_TYPE
1060#if defined(__cpp_lib_allocator_traits_is_always_equal) && __cpp_lib_allocator_traits_is_always_equal >= 201411L
1061 return ::std::allocator_traits<A>::is_always_equal::value;
1063 return ::std::is_empty<A>::value;
1067template <
typename T,
typename A =
typename T::allocator_type,
1068 bool PoCMA = ::std::allocator_traits<A>::propagate_on_container_move_assignment::value>
1077 assert(target->get_allocator() != source.get_allocator());
1083template <
typename T,
typename A>
struct move_assign_alloc<T, A, true> {
1084 static constexpr bool is_nothrow() noexcept {
1085 return allocator_is_always_equal<A>() || ::std::is_nothrow_move_assignable<A>::value;
1087 static constexpr bool is_moveable(T *, T &)
noexcept {
return true; }
1089 assert(target->get_allocator() != source.get_allocator());
1090 target->get_allocator() = ::std::move(source.get_allocator());
1094template <
typename T,
typename A =
typename T::allocator_type,
1095 bool PoCCA = ::std::allocator_traits<A>::propagate_on_container_copy_assignment::value>
1099 static constexpr bool is_nothrow() noexcept {
return false; }
1101 assert(target->get_allocator() != source.get_allocator());
1107template <
typename T,
typename A>
struct copy_assign_alloc<T, A, true> {
1108 static constexpr bool is_nothrow() noexcept {
1109 return allocator_is_always_equal<A>() || ::std::is_nothrow_copy_assignable<A>::value;
1111 static MDBX_CXX20_CONSTEXPR void propagate(T *target,
const T &source)
noexcept(is_nothrow()) {
1113 if (
MDBX_UNLIKELY(target->get_allocator() != source.get_allocator()))
1114 MDBX_CXX20_UNLIKELY target->get_allocator() =
1115 ::std::allocator_traits<A>::select_on_container_copy_construction(source.get_allocator());
1124template <
typename T,
typename A =
typename T::allocator_type,
1125 bool PoCS = ::std::allocator_traits<A>::propagate_on_container_swap::value>
1128template <
typename T,
typename A>
struct swap_alloc<T, A, false> {
1132 if (
MDBX_UNLIKELY(target->get_allocator() != source.get_allocator()))
1142template <
typename T,
typename A>
struct swap_alloc<T, A, true> {
1143 static constexpr bool is_nothrow() noexcept {
1144 return allocator_is_always_equal<A>() ||
1145#if defined(__cpp_lib_is_swappable) && __cpp_lib_is_swappable >= 201603L
1146 ::std::is_nothrow_swappable<A>() ||
1148 (::std::is_nothrow_move_constructible<A>::value && ::std::is_nothrow_move_assignable<A>::value);
1152 if (
MDBX_UNLIKELY(target->get_allocator() != source.get_allocator()))
1153 MDBX_CXX20_UNLIKELY ::std::swap(*target, source);
1175 static_assert(
pettiness_threshold >=
sizeof(uint64_t),
"pettiness_threshold must be > 7");
1183 if (wanna > current)
1187 if (current - wanna >
1191 return round(wanna);
1209 template <
class ALLOCATOR = default_allocator>
1215 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1223 const size_t bytes =
source.length() << 1;
1233 ::std::ostream &
output(::std::ostream &out)
const;
1256 template <
class ALLOCATOR = default_allocator>
1263 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1271 const size_t bytes = (
source.length() * 11 + 7) / 8;
1281 ::std::ostream &
output(::std::ostream &out)
const;
1302 template <
class ALLOCATOR = default_allocator>
1309 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1317 const size_t bytes = (
source.length() + 2) / 3 * 4;
1329 ::std::ostream &
output(::std::ostream &out)
const;
1354 template <
class ALLOCATOR = default_allocator>
1360 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1393 template <
class ALLOCATOR = default_allocator>
1400 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1436 template <
class ALLOCATOR = default_allocator>
1443 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1468template <class ALLOCATOR, typename CAPACITY_POLICY> class
buffer {
1470#if !defined(_MSC_VER) || _MSC_VER > 1900
1471 using allocator_type = typename ::std::allocator_traits<ALLOCATOR>::template rebind_alloc<uint64_t>;
1473 using allocator_type =
typename ALLOCATOR::template rebind<uint64_t>::other;
1483 ?
alignof(max_align_t) * 2
1495 using allocator_pointer =
typename allocator_traits::pointer;
1496 using allocator_const_pointer =
typename allocator_traits::const_pointer;
1498 MDBX_CXX20_CONSTEXPR ::std::pair<allocator_pointer, size_t> allocate_storage(
size_t bytes) {
1499 assert(bytes >=
sizeof(bin));
1500 constexpr size_t unit =
sizeof(
typename allocator_type::value_type);
1501 static_assert((unit & (unit - 1)) == 0,
"size of ALLOCATOR::value_type should be a power of 2");
1502 static_assert(unit > 0,
"size of ALLOCATOR::value_type must be > 0");
1503 const size_t n = (bytes + unit - 1) / unit;
1504 return ::std::make_pair(allocator_traits::allocate(get_allocator(), n), n * unit);
1507 constexpr size_t unit =
sizeof(
typename allocator_type::value_type);
1508 assert(ptr && bytes >=
sizeof(bin) && bytes >= unit && bytes % unit == 0);
1509 allocator_traits::deallocate(get_allocator(), ptr, bytes / unit);
1513#if defined(__cpp_lib_to_address) && __cpp_lib_to_address >= 201711L
1514 return static_cast<void *
>(::std::to_address(ptr));
1516 return static_cast<void *
>(::std::addressof(*ptr));
1520#if defined(__cpp_lib_to_address) && __cpp_lib_to_address >= 201711L
1521 return static_cast<const void *
>(::std::to_address(ptr));
1523 return static_cast<const void *
>(::std::addressof(*ptr));
1527 union alignas(max_align_t)
bin {
1538 << (
sizeof(
size_t ) - 1) * CHAR_BIT,
1559 static_assert((size_t(reservation_policy::inplace_storage_size_rounding) &
1560 (size_t(reservation_policy::inplace_storage_size_rounding) - 1)) == 0,
1561 "CAPACITY_POLICY::inplace_storage_size_rounding must be power of 2");
1563 return capacity_bytes <
sizeof(
bin);
1568 static_assert(std::numeric_limits<size_t>::max() - (std::numeric_limits<size_t>::max() >> CHAR_BIT) ==
1581 if (::std::is_trivial<allocator_pointer>::value)
1589 template <
bool construct_ptr>
1592 if (construct_ptr) {
1608 (void)capacity_bytes;
1620 if (ditto.is_inplace()) {
1626 new (&
allocated_ptr_) allocator_pointer(::std::move(ditto.allocated_ptr_));
1627 capacity_.bytes_ = ditto.capacity_.bytes_;
1628 ditto.make_inplace<
true>();
1634 if (ditto.is_inplace()) {
1651 if (ditto.is_allocated())
1652 ditto.make_inplace<
true>();
1660 const size_t advised = reservation_policy::advise(current, wanna);
1661 assert(advised >= wanna);
1662 return ::std::min(
size_t(
max_capacity), ::std::max(
sizeof(
bin) - 1, advised));
1676 if (bin_.is_suitable_for_inplace(
capacity))
1681 new (&bin_) bin(
pair.first,
pair.second);
1683 return bin_.address();
1687 if (bin_.is_allocated()) {
1688 deallocate_storage(bin_.allocated_ptr_, bin_.capacity_.bytes_);
1689 bin_.template make_inplace<true>();
1693 template <
bool external_content>
1695 const void *
const content,
const size_t length) {
1696 assert(wanna_capacity >= wanna_headroom + length);
1697 const size_t old_capacity = bin_.capacity();
1698 const size_t new_capacity = bin::advise_capacity(old_capacity, wanna_capacity);
1701 assert(bin_.is_inplace() == bin::is_suitable_for_inplace(new_capacity));
1702 byte *
const new_place = bin_.address() + wanna_headroom;
1705 if (external_content)
1706 memcpy(new_place, content, length);
1708 const size_t old_headroom = bin_.address() -
static_cast<const byte *
>(content);
1709 assert(old_capacity >= old_headroom + length);
1711 MDBX_CXX20_UNLIKELY ::std::memmove(new_place, content, length);
1717 if (bin::is_suitable_for_inplace(new_capacity)) {
1718 assert(bin_.is_allocated());
1719 const auto old_allocated = ::std::move(bin_.allocated_ptr_);
1720 byte *
const new_place = bin_.template make_inplace<true>() + wanna_headroom;
1723 deallocate_storage(old_allocated, old_capacity);
1727 if (!bin_.is_allocated()) {
1728 const auto pair = allocate_storage(new_capacity);
1729 assert(pair.second >= new_capacity);
1730 byte *
const new_place =
static_cast<byte *
>(to_address(pair.first)) + wanna_headroom;
1733 bin_.template make_allocated<true>(pair.first, pair.second);
1737 const auto old_allocated = ::std::move(bin_.allocated_ptr_);
1738 if (external_content)
1739 deallocate_storage(old_allocated, old_capacity);
1740 const auto pair = allocate_storage(new_capacity);
1741 assert(pair.second >= new_capacity);
1742 byte *
const new_place = bin_.template make_allocated<false>(pair.first, pair.second) + wanna_headroom;
1745 if (!external_content)
1746 deallocate_storage(old_allocated, old_capacity);
1751 assert(capacity() >= offset);
1752 return bin_.address() + offset;
1755 assert(capacity() >= offset);
1756 return bin_.address() + offset;
1759 assert(capacity() >= offset + length);
1760 return static_cast<byte *
>(memcpy(get(offset), ptr, length));
1766 silo() noexcept : allocator_type() { init(0); }
1768 silo(
const allocator_type &alloc) noexcept : allocator_type(alloc) { init(0); }
1770 MDBX_CXX20_CONSTEXPR silo(
size_t capacity,
const allocator_type &alloc) : silo(alloc) { init(capacity); }
1772 MDBX_CXX20_CONSTEXPR silo(silo &&ditto)
noexcept(::std::is_nothrow_move_constructible<allocator_type>::value)
1773 : allocator_type(::std::move(ditto.get_allocator())), bin_(::std::move(ditto.bin_)) {}
1775 MDBX_CXX20_CONSTEXPR silo(
size_t capacity,
size_t headroom,
const void *ptr,
size_t length) : silo(capacity) {
1776 assert(capacity >= headroom + length);
1778 put(headroom, ptr, length);
1783 const allocator_type &alloc)
1784 : silo(capacity, alloc) {
1785 assert(capacity >= headroom + length);
1787 put(headroom, ptr, length);
1792 : silo(length, 0, ptr, length, alloc) {}
1794 ~silo() { release(); }
1798 MDBX_CXX20_CONSTEXPR void *assign(
size_t headroom,
const void *ptr,
size_t length,
size_t tailroom) {
1799 return reshape<true>(headroom + length + tailroom, headroom, ptr, length);
1801 MDBX_CXX20_CONSTEXPR void *assign(
const void *ptr,
size_t length) {
return assign(0, ptr, length, 0); }
1804 assert(ditto.get() + headroom == content.byte_ptr());
1805 if MDBX_IF_CONSTEXPR (!allocation_aware_details::allocator_is_always_equal<allocator_type>()) {
1806 if (
MDBX_UNLIKELY(get_allocator() != ditto.get_allocator()))
1807 MDBX_CXX20_UNLIKELY {
1809 allocation_aware_details::copy_assign_alloc<silo, allocator_type>::propagate(
this, ditto);
1812 content.iov_base = reshape<true>(ditto.capacity(), headroom, content.data(), content.length());
1817 assign(silo &&ditto,
size_t headroom,
1818 slice &content)
noexcept(allocation_aware_details::move_assign_alloc<silo, allocator_type>::is_nothrow()) {
1819 assert(ditto.get() + headroom == content.byte_ptr());
1820 if (allocation_aware_details::move_assign_alloc<silo, allocator_type>::is_moveable(
this, ditto)) {
1822 allocation_aware_details::move_assign_alloc<silo, allocator_type>::propagate(
this, ditto);
1824 bin_ = ::std::move(ditto.bin_);
1825 assert(get() + headroom == content.byte_ptr());
1828 content.iov_base = reshape<true>(ditto.capacity(), headroom, content.data(), content.length());
1836 return reshape<false>(whole_capacity, headroom,
nullptr, 0);
1839 content.iov_base = reshape<false>(capacity, headroom, content.iov_base, content.iov_len);
1842 swap(silo &ditto)
noexcept(allocation_aware_details::swap_alloc<silo, allocator_type>::is_nothrow()) {
1843 allocation_aware_details::swap_alloc<silo, allocator_type>::propagate(
this, ditto);
1844 ::std::swap(bin_, ditto.bin_);
1857 ::mdbx::slice slice_;
1860 assert(is_reference());
1862 slice_.iov_base = silo_.
data();
1866 return static_cast<const byte *
>(silo_.data());
1870 return silo_begin() + silo_.capacity();
1873 struct data_preserver :
public exception_thunk {
1875 data_preserver(allocator_type &allocator) : data(allocator) {}
1876 static int callback(
void *context,
MDBX_val *target,
const void *src,
size_t bytes)
noexcept {
1877 auto self =
static_cast<data_preserver *
>(context);
1878 assert(self->is_clean());
1879 assert(&self->data.slice_ == target);
1882 self->data.assign(src, bytes,
false);
1909 return size_t(
byte_ptr() - silo_begin()) < silo_.capacity();
1943 return const_cast<byte *
>(slice_.byte_ptr());
1950 return const_cast<byte *
>(slice_.end_byte_ptr());
1963 return const_cast<char *
>(slice_.char_ptr());
1970 return const_cast<char *
>(slice_.end_char_ptr());
1983 return const_cast<void *
>(slice_.data());
1990 return const_cast<void *
>(slice_.end());
2001 slice_.set_length(
bytes);
2023 : silo_(allocator), slice_(src) {
2024 if (!make_reference)
2029 :
buffer(src.slice_, make_reference, allocator) {}
2034 template <
class CHAR,
class T,
class A>
buffer(const ::std::basic_string<CHAR, T, A> &) =
delete;
2035 template <
class CHAR,
class T,
class A>
buffer(const ::std::basic_string<CHAR, T, A> &&) =
delete;
2040#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2041 template <
class CHAR,
class T>
2042 buffer(const ::std::basic_string_view<CHAR, T> &view,
bool make_reference,
2058 template <
class CHAR,
class T,
class A>
2067#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2068 template <
class CHAR,
class T>
2075 slice_.iov_base = silo_.init(check_length(head_room, tail_room));
2076 assert(slice_.iov_len == 0);
2080 slice_.iov_base = silo_.init(check_length(
capacity));
2081 assert(slice_.iov_len == 0);
2086 : silo_(allocator) {
2087 slice_.iov_base = silo_.init(check_length(head_room, src.
length(), tail_room));
2088 slice_.iov_len = src.
length();
2089 memcpy(slice_.iov_base, src.
data(), src.
length());
2093 :
buffer(head_room, src.slice_, tail_room, allocator) {}
2098 : silo_(::
std::move(src.silo_)), slice_(::
std::move(src.slice_)) {}
2104#if defined(DOXYGEN) || (defined(__cpp_lib_span) && __cpp_lib_span >= 202002L)
2106 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
2107 "Must be a standard layout type!");
2110 template <
typename POD> MDBX_CXX14_CONSTEXPR ::std::span<const POD>
as_span()
const {
2113 template <
typename POD> MDBX_CXX14_CONSTEXPR ::std::span<POD>
as_span() {
return slice_.template
as_span<POD>(); }
2121 template <
typename POD>
2128#ifdef MDBX_U128_TYPE
2136#ifdef MDBX_I128_TYPE
2144#ifdef MDBX_U128_TYPE
2152#ifdef MDBX_I128_TYPE
2161 static buffer hex(const ::mdbx::slice &source,
bool uppercase =
false,
unsigned wrap_width = 0,
2180 template <
typename POD>
2181 static buffer hex(
const POD &pod,
bool uppercase =
false,
unsigned wrap_width = 0,
2188 template <
typename POD>
2195 template <
typename POD>
2256 void reserve(
size_t wanna_headroom,
size_t wanna_tailroom) {
2259 const size_t wanna_capacity = check_length(wanna_headroom, slice_.length(), wanna_tailroom);
2260 silo_.resize(wanna_capacity, wanna_headroom, slice_);
2273 slice_.assign(ptr,
bytes);
2278 silo_.
assign(
static_cast<const typename silo::value_type *
>(ptr), check_length(
bytes));
2284 silo_.swap(other.silo_);
2285 slice_.swap(other.slice_);
2303 return assign(src.iov_base, src.iov_len, make_reference);
2313 assign(src.iov_base, src.iov_len, make_reference);
2314 src.iov_base =
nullptr;
2319 return assign(begin,
static_cast<const byte *
>(
end) -
static_cast<const byte *
>(begin), make_reference);
2322 template <
class CHAR,
class T,
class A>
2323 buffer &
assign(const ::std::basic_string<CHAR, T, A> &str,
bool make_reference =
false) {
2324 return assign(str.data(), str.length(), make_reference);
2328 return assign(c_str, ::mdbx::strlen(c_str), make_reference);
2331#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
2332 template <
class CHAR,
class T>
2333 buffer &assign(const ::std::basic_string_view<CHAR, T> &view,
bool make_reference =
false) {
2334 return assign(view.data(), view.length(), make_reference);
2337 template <
class CHAR,
class T> buffer &assign(::std::basic_string_view<CHAR, T> &&view,
bool make_reference =
false) {
2338 assign(view.data(), view.length(), make_reference);
2352#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2353 template <
class CHAR,
class T>
buffer &
operator=(const ::std::basic_string_view<CHAR, T> &view)
noexcept {
2358 template <
class CHAR =
char,
class T = ::std::
char_traits<CHAR>>
2360 return slice_.string_view<CHAR, T>();
2364 template <
class CHAR,
class T> operator ::std::basic_string_view<CHAR, T>() const noexcept {
2365 return string_view<CHAR, T>();
2384 template <
class CHAR =
char,
class T = ::std::
char_traits<CHAR>,
class A = legacy_allocator>
2385 MDBX_CXX20_CONSTEXPR ::std::basic_string<CHAR, T, A>
as_string(
const A &allocator = A())
const {
2386 return slice_.as_string<CHAR, T, A>(allocator);
2389 template <
class CHAR,
class T,
class A>
2396 return slice_.starts_with(prefix);
2401 return slice_.ends_with(suffix);
2405 void clear() noexcept { slice_.assign(silo_.clear(),
size_t(0)); }
2409 slice_.assign(silo_.clear_and_reserve(whole_capacity,
headroom),
size_t(0));
2485 slice_.iov_len +=
bytes;
2494 slice_.iov_base = memcpy(
static_cast<char *
>(slice_.iov_base) -
bytes, src,
bytes);
2495 slice_.iov_len +=
bytes;
2502 const size_t wanna_bytes = producer.envisage_result_length();
2509 const size_t wanna_bytes = producer.envisage_result_length();
2542 *slice_.end_byte_ptr() = uint8_t(u8);
2543 slice_.iov_len += 1;
2552 const auto ptr = slice_.end_byte_ptr();
2553 ptr[0] = uint8_t(u16);
2554 ptr[1] = uint8_t(u16 >> 8);
2555 slice_.iov_len += 2;
2562 const auto ptr = slice_.end_byte_ptr();
2563 ptr[0] = uint8_t(u24);
2564 ptr[1] = uint8_t(u24 >> 8);
2565 ptr[2] = uint8_t(u24 >> 16);
2566 slice_.iov_len += 3;
2573 const auto ptr = slice_.end_byte_ptr();
2574 ptr[0] = uint8_t(u32);
2575 ptr[1] = uint8_t(u32 >> 8);
2576 ptr[2] = uint8_t(u32 >> 16);
2577 ptr[3] = uint8_t(u32 >> 24);
2578 slice_.iov_len += 4;
2585 const auto ptr = slice_.end_byte_ptr();
2586 ptr[0] = uint8_t(u48);
2587 ptr[1] = uint8_t(u48 >> 8);
2588 ptr[2] = uint8_t(u48 >> 16);
2589 ptr[3] = uint8_t(u48 >> 24);
2590 ptr[4] = uint8_t(u48 >> 32);
2591 ptr[5] = uint8_t(u48 >> 40);
2592 slice_.iov_len += 6;
2599 const auto ptr = slice_.end_byte_ptr();
2600 ptr[0] = uint8_t(u64);
2601 ptr[1] = uint8_t(u64 >> 8);
2602 ptr[2] = uint8_t(u64 >> 16);
2603 ptr[3] = uint8_t(u64 >> 24);
2604 ptr[4] = uint8_t(u64 >> 32);
2605 ptr[5] = uint8_t(u64 >> 40);
2606 ptr[6] = uint8_t(u64 >> 48);
2607 ptr[7] = uint8_t(u64 >> 56);
2608 slice_.iov_len += 8;
2614 template <
size_t SIZE>
static buffer key_from(
const char (&text)[SIZE],
bool make_reference =
true) {
2618#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2619 template <
class CHAR,
class T>
2620 static buffer key_from(const ::std::basic_string_view<CHAR, T> &src,
bool make_reference =
false) {
2621 return buffer(src, make_reference);
2627 template <
class CHAR,
class T,
class A>
2628 static buffer key_from(const ::std::basic_string<CHAR, T, A> &src,
bool make_reference =
false) {
2629 return buffer(src, make_reference);
2667template <
class ALLOCATOR,
class CAPACITY_POLICY, MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER)>
2678template <
class ALLOCATOR,
class CAPACITY_POLICY, MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER)>
2689template <
class ALLOCATOR, MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER)>
2694 result.resize(producer.envisage_result_length());
2695 result.resize(producer.write_bytes(
const_cast<char *
>(result.data()), result.capacity()) - result.data());
2700template <
class ALLOCATOR, MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER)>
2705 result.resize(producer.envisage_result_length());
2706 result.resize(producer.write_bytes(
const_cast<char *
>(result.data()), result.capacity()) - result.data());
2713#if defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L && _GLIBCXX_USE_CXX11_ABI
2750 const pair &b)
noexcept;
2779 using stl_pair = ::std::pair<buffer_type, buffer_type>;
2790 :
key(
key, make_reference, allocator),
value(
value, make_reference, allocator) {}
2801 :
key(
key, make_reference, allocator),
value(
value, make_reference, allocator) {}
2822 return key.is_freestanding() &&
value.is_freestanding();
2827 return key.is_reference() ||
value.is_reference();
2833 key.make_freestanding();
2834 value.make_freestanding();
2841template <
typename BUFFER>
2900#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
2982 operator bool() const noexcept {
return dbi != 0; }
3032 inline
env &operator=(
env &&other) noexcept;
3033 inline
env(
env &&other) noexcept;
3034 inline ~
env() noexcept;
3057#if INTPTR_MAX > 0x7fffFFFFl
3065#if INTPTR_MAX > 0x7fffFFFFl
3111 inline geometry &make_fixed(intptr_t size)
noexcept;
3112 inline geometry &make_dynamic(intptr_t lower = default_value, intptr_t upper = default_value)
noexcept;
3202 bool use_subdirectory =
false
3238 static inline
size_t dbsize_min(intptr_t pagesize);
3240 static inline
size_t dbsize_max(intptr_t pagesize);
3319#ifdef MDBX_STD_FILESYSTEM_PATH
3322#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3323 env &
copy(const ::std::wstring &destination,
bool compactify,
bool force_dynamic_size =
false);
3324 env &
copy(
const wchar_t *destination,
bool compactify,
bool force_dynamic_size =
false);
3326 env &
copy(const ::std::string &destination,
bool compactify,
bool force_dynamic_size =
false);
3327 env &
copy(
const char *destination,
bool compactify,
bool force_dynamic_size =
false);
3349#ifdef MDBX_STD_FILESYSTEM_PATH
3352#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3372 inline info get_info()
const;
3375 inline stat get_stat(
const txn &)
const;
3378 inline info get_info(
const txn &)
const;
3426#if __cplusplus >= 201103L || defined(DOXYGEN)
3513 inline env &set_extra_option(extra_runtime_option option, uint64_t value);
3516 inline uint64_t extra_option(extra_runtime_option option)
const;
3522 inline env &set_geometry(
const geometry &size);
3527 inline bool sync_to_disk(
bool force =
true,
bool nonblock =
false);
3576 size_t used,
size_t retained)
noexcept;
3642 using inherited =
env;
3651#ifdef MDBX_STD_FILESYSTEM_PATH
3654#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3673#ifdef MDBX_STD_FILESYSTEM_PATH
3675 bool accede =
true);
3677#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3679 bool accede =
true);
3681 bool accede =
true);
3704 MDBX_CXX20_UNLIKELY {
3705 assert(
handle_ != other.handle_);
3733 inline
txn &operator=(
txn &&other) noexcept;
3734 inline
txn(
txn &&other) noexcept;
3735 inline ~
txn() noexcept;
3748 inline uint64_t
id() const;
3757 inline
bool is_dirty(const
void *ptr) const;
3767 inline info get_info(
bool scan_reader_lock_table =
false)
const;
3776 return size_t(
get_info().txn_space_dirty);
3782 inline void reset_reading();
3785 inline void renew_reading();
3788 inline void make_broken();
3791 inline void park_reading(
bool autounpark =
true);
3795 inline bool unpark_reading(
bool restart_if_ousted =
true);
3823 inline map_handle open_map_accede(
const char *name)
const;
3825 inline map_handle open_map_accede(const ::std::string &name)
const;
3827 inline map_handle open_map_accede(const ::mdbx::slice &name)
const;
3844 bool drop_map(
const char *name,
bool throw_if_absent =
false);
3848 inline bool drop_map(const ::std::string &name,
bool throw_if_absent =
false);
3852 bool drop_map(const ::mdbx::slice &name,
bool throw_if_absent =
false);
3858 bool clear_map(
const char *name,
bool throw_if_absent =
false);
3861 inline bool clear_map(const ::std::string &name,
bool throw_if_absent =
false);
3864 bool clear_map(const ::mdbx::slice &name,
bool throw_if_absent =
false);
3875 bool rename_map(
const char *old_name,
const char *new_name,
bool throw_if_absent =
false);
3879 bool rename_map(const ::std::string &old_name, const ::std::string &new_name,
bool throw_if_absent =
false);
3883 bool rename_map(const ::mdbx::slice &old_name, const ::mdbx::slice &new_name,
bool throw_if_absent =
false);
3885#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
3903 bool drop_map(const ::std::string_view &name,
bool throw_if_absent =
false) {
3908 bool clear_map(const ::std::string_view &name,
bool throw_if_absent =
false) {
3916 bool rename_map(const ::std::string_view &old_name, const ::std::string_view &new_name,
3917 bool throw_if_absent =
false) {
3998 template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4005 template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4011 template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4033 inline void append(
map_handle map,
const slice &key,
const slice &value,
bool multivalue_order_preserved =
true);
4035 return append(map, kv.
key, kv.
value, multivalue_order_preserved);
4038 inline size_t put_multiple_samelength(
map_handle map,
const slice &key,
const size_t value_length,
4039 const void *values_array,
size_t values_count,
put_mode mode,
4040 bool allow_partial =
false);
4041 template <
typename VALUE>
4043 put_mode mode,
bool allow_partial =
false) {
4044 static_assert(::std::is_standard_layout<VALUE>::value && !::std::is_pointer<VALUE>::value &&
4045 !::std::is_array<VALUE>::value,
4046 "Must be a standard layout type!");
4049 template <
typename VALUE>
4056 inline ptrdiff_t estimate_from_first(
map_handle map,
const slice &to)
const;
4057 inline ptrdiff_t estimate_to_last(
map_handle map,
const slice &from)
const;
4069 using inherited =
txn;
4077 txn_managed(txn_managed &&) = default;
4078 txn_managed &operator=(txn_managed &&other) noexcept {
4080 MDBX_CXX20_UNLIKELY {
4081 assert(
handle_ != other.handle_);
4141 inline ~
cursor() noexcept;
4173 inline void *get_context() const noexcept;
4176 inline
cursor &set_context(
void *your_context);
4238 bool throw_notfound);
4261 template <
typename CALLABLE_PREDICATE>
4264 static int probe(
void *context,
MDBX_val *key,
MDBX_val *value,
void *arg)
noexcept {
4265 auto thunk =
static_cast<wrapper *
>(context);
4266 assert(thunk->is_clean());
4267 auto &predicate = *
static_cast<CALLABLE_PREDICATE *
>(arg);
4281 template <
typename CALLABLE_PREDICATE>
bool fullscan(CALLABLE_PREDICATE predicate,
bool backward =
false) {
4285 template <
typename CALLABLE_PREDICATE>
4289 static int probe(
void *context,
MDBX_val *key,
MDBX_val *value,
void *arg)
noexcept {
4290 auto thunk =
static_cast<wrapper *
>(context);
4291 assert(thunk->is_clean());
4292 auto &predicate = *
static_cast<CALLABLE_PREDICATE *
>(arg);
4306 template <
typename CALLABLE_PREDICATE>
4310 static int probe(
void *context,
MDBX_val *key,
MDBX_val *value,
void *arg)
noexcept {
4311 auto thunk =
static_cast<wrapper *
>(context);
4312 assert(thunk->is_clean());
4313 auto &predicate = *
static_cast<CALLABLE_PREDICATE *
>(arg);
4328 return move_result(*
this, operation, throw_notfound);
4334 return move_result(*
this, operation, key, value, throw_notfound);
4337 return move(operation, &key, &value, throw_notfound);
4416 inline bool seek(
const slice &key);
4417 inline move_result find(
const slice &key,
bool throw_notfound =
true);
4418 inline move_result lower_bound(
const slice &key,
bool throw_notfound =
false);
4419 inline move_result upper_bound(
const slice &key,
bool throw_notfound =
false);
4422 inline size_t count_multivalue()
const;
4424 inline move_result find_multivalue(
const slice &key,
const slice &value,
bool throw_notfound =
true);
4425 inline move_result lower_bound_multivalue(
const slice &key,
const slice &value,
bool throw_notfound =
false);
4426 inline move_result upper_bound_multivalue(
const slice &key,
const slice &value,
bool throw_notfound =
false);
4444 inline bool eof()
const;
4445 inline bool on_first()
const;
4446 inline bool on_last()
const;
4447 inline bool on_first_multival()
const;
4448 inline bool on_last_multival()
const;
4451 inline estimate_result
estimate(move_operation operation)
const;
4466 inline ::mdbx::txn
txn()
const;
4469 inline operator ::mdbx::txn()
const {
return txn(); }
4470 inline operator ::mdbx::map_handle()
const {
return map(); }
4474 inline void insert(
const slice &key,
slice value);
4476 inline slice insert_reserve(
const slice &key,
size_t value_length);
4480 inline slice upsert_reserve(
const slice &key,
size_t value_length);
4483 inline bool try_update(
const slice &key,
const slice &value);
4484 inline slice update_reserve(
const slice &key,
size_t value_length);
4493 inline bool erase(
bool whole_multivalue =
false);
4497 inline bool erase(
const slice &key,
bool whole_multivalue =
true);
4501 inline bool erase(
const slice &key,
const slice &value);
4503 inline size_t put_multiple_samelength(
const slice &key,
const size_t value_length,
const void *values_array,
4504 size_t values_count,
put_mode mode,
bool allow_partial =
false);
4505 template <
typename VALUE>
4507 bool allow_partial =
false) {
4508 static_assert(::std::is_standard_layout<VALUE>::value && !::std::is_pointer<VALUE>::value &&
4509 !::std::is_array<VALUE>::value,
4510 "Must be a standard layout type!");
4513 template <
typename VALUE>
4527 using inherited =
cursor;
4546 cursor_managed &
operator=(cursor_managed &&other)
noexcept {
4548 MDBX_CXX20_UNLIKELY {
4549 assert(
handle_ != other.handle_);
4572template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4599#if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
4600 if (::std::is_constant_evaluated()) {
4601 for (
size_t i = 0; c_str; ++i)
4607#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
4608 return c_str ? ::std::string_view(c_str).length() : 0;
4610 return c_str ? ::std::strlen(c_str) : 0;
4615#if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
4616 if (::std::is_constant_evaluated()) {
4617 for (
size_t i = 0; i < bytes; ++i)
4618 static_cast<byte *
>(dest)[i] =
static_cast<const byte *
>(src)[i];
4622 return ::std::memcpy(dest, src, bytes);
4626#if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
4627 if (::std::is_constant_evaluated()) {
4628 for (
size_t i = 0; i < bytes; ++i) {
4629 const int diff = int(
static_cast<const byte *
>(a)[i]) - int(
static_cast<const byte *
>(b)[i]);
4636 return ::std::memcmp(a, b, bytes);
4646 return check_length(check_length(headroom) + check_length(payload));
4650 return check_length(check_length(headroom, payload) + check_length(tailroom));
4657 captured_ = ::std::current_exception();
4662 MDBX_CXX20_UNLIKELY ::std::rethrow_exception(captured_);
4720 MDBX_CXX20_UNLIKELY
panic(context_where, func_who);
4725 MDBX_CXX20_UNLIKELY
panic(context_where, func_who);
4730 MDBX_CXX20_UNLIKELY
error(error_code).throw_exception();
4739 error rc(error_code);
4744 switch (error_code) {
4780 : ::
MDBX_val({
const_cast<void *
>(ptr), check_length(
bytes)}) {}
4783 :
slice(begin, static_cast<const
byte *>(
end) - static_cast<const
byte *>(begin)) {}
4794 iov_base =
const_cast<void *
>(ptr);
4795 iov_len = check_length(
bytes);
4800 iov_base = src.iov_base;
4801 iov_len = src.iov_len;
4814 assign(src.iov_base, src.iov_len);
4815 src.iov_base =
nullptr;
4820 return assign(begin,
static_cast<const byte *
>(
end) -
static_cast<const byte *
>(begin));
4830 const auto temp = *
this;
4836 return static_cast<const byte *
>(iov_base);
4841MDBX_CXX11_CONSTEXPR ::mdbx::byte *
slice::byte_ptr() noexcept {
return static_cast<byte *
>(iov_base); }
4864 iov_len = check_length(
bytes);
4889 assert(n <=
size());
4890 iov_base =
static_cast<byte *
>(iov_base) + n;
4901 assert(n <=
size());
4912 return length() >= prefix.length() && memcmp(
data(), prefix.data(), prefix.length()) == 0;
4916 return length() >= suffix.length() &&
4917 memcmp(
byte_ptr() +
length() - suffix.length(), suffix.data(), suffix.length()) == 0;
4921 size_t h =
length() * 3977471;
4922 for (
size_t i = 0; i <
length(); ++i)
4923 h = (h ^
static_cast<const uint8_t *
>(
data())[i]) * 1664525 + 1013904223;
4924 return h ^ 3863194411 * (h >> 11);
4974 const intptr_t diff = intptr_t(a.length()) - intptr_t(b.length());
4976 :
MDBX_UNLIKELY(a.length() == 0 || a.data() == b.data()) ? 0
4977 : memcmp(a.data(), b.data(), a.length());
4981 const size_t shortest = ::std::min(a.length(), b.length());
4984 const intptr_t diff = memcmp(a.data(), b.data(), shortest);
4988 return intptr_t(a.length()) - intptr_t(b.length());
5015template <
class ALLOCATOR>
5017 return to_hex(*
this, uppercase, wrap_width).
as_string<ALLOCATOR>(allocator);
5020template <
class ALLOCATOR>
5025template <
class ALLOCATOR>
5030template <
class ALLOCATOR,
class CAPACITY_POLICY>
5032 const ALLOCATOR &allocator)
const {
5033 return to_hex(*
this, uppercase, wrap_width).
as_buffer<ALLOCATOR, CAPACITY_POLICY>(allocator);
5036template <
class ALLOCATOR,
class CAPACITY_POLICY>
5038 return to_base58(*
this, wrap_width).
as_buffer<ALLOCATOR, CAPACITY_POLICY>(allocator);
5041template <
class ALLOCATOR,
class CAPACITY_POLICY>
5043 return to_base64(*
this, wrap_width).
as_buffer<ALLOCATOR, CAPACITY_POLICY>(allocator);
5046template <
class ALLOCATOR,
class CAPACITY_POLICY>
5048 return from_hex(*
this, ignore_spaces).
as_buffer<ALLOCATOR, CAPACITY_POLICY>(allocator);
5051template <
class ALLOCATOR,
class CAPACITY_POLICY>
5056template <
class ALLOCATOR,
class CAPACITY_POLICY>
5086 return a.key.length() == b.key.length() && a.value.length() == b.value.length() &&
5087 memcmp(a.key.data(), b.key.data(), a.key.length()) == 0 &&
5088 memcmp(a.value.data(), b.value.data(), a.value.length()) == 0;
5108 return a.key.length() != b.key.length() || a.value.length() != b.value.length() ||
5109 memcmp(a.key.data(), b.key.data(), a.key.length()) != 0 ||
5110 memcmp(a.value.data(), b.value.data(), a.value.length()) != 0;
5115template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5139 other.handle_ =
nullptr;
5190 return static_cast<size_t>(result);
5197 return static_cast<size_t>(result);
5208 return static_cast<size_t>(result);
5219 return static_cast<size_t>(result);
5232 return static_cast<size_t>(result);
5243 return static_cast<size_t>(result);
5252 return static_cast<size_t>(result);
5263 return static_cast<size_t>(result);
5274 return static_cast<size_t>(result);
5285 return static_cast<size_t>(result);
5296 return static_cast<size_t>(result);
5395 unsigned seconds_16dot16;
5397 return seconds_16dot16;
5406#if __cplusplus >= 201103L
5451 size_t retained) noexcept
5458 static int cb(
void *ctx,
int number,
int slot,
mdbx_pid_t pid,
mdbx_tid_t thread, uint64_t txnid, uint64_t lag,
5459 size_t used,
size_t retained)
noexcept {
5460 reader_visitor_thunk *thunk =
static_cast<reader_visitor_thunk *
>(ctx);
5461 assert(thunk->is_clean());
5463 const reader_info info(slot, pid, thread, txnid, lag, used, retained);
5472 reader_visitor_thunk thunk(visitor);
5474 thunk.rethrow_captured();
5481 assert(dead_count >= 0);
5482 return static_cast<unsigned>(dead_count);
5495 assert(ptr !=
nullptr);
5502 assert(ptr !=
nullptr);
5509 assert(ptr !=
nullptr);
5516 assert(ptr !=
nullptr);
5528 other.handle_ =
nullptr;
5618 assert(map.
dbi != 0);
5627 assert(map.
dbi != 0);
5634 assert(map.
dbi != 0);
5641 assert(map.
dbi != 0);
5650 assert(map.
dbi != 0);
5659 assert(map.
dbi != 0);
5747 return ::mdbx_dcmp(
handle_, map.
dbi, &a, &b);
5777 return value_at_absence;
5790 return value_at_absence;
5807 return pair_result{result.key, result.value,
true};
5809 return pair_result{result.key, result.value,
false};
5831 const int err =
put(map, key, &value ,
5844 slice result(
nullptr, value_length);
5851 slice result(
nullptr, value_length);
5852 const int err =
put(map, key, &result ,
5869 slice result(
nullptr, value_length);
5891 slice result(
nullptr, value_length);
5897 slice result(
nullptr, value_length);
5938template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5942 typename buffer<ALLOCATOR, CAPACITY_POLICY>::data_preserver result(allocator);
5948template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5952 typename buffer<ALLOCATOR, CAPACITY_POLICY>::data_preserver result(allocator);
5959template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5963 typename buffer<ALLOCATOR, CAPACITY_POLICY>::data_preserver result(allocator);
5976 const void *values_array,
size_t values_count,
put_mode mode,
5977 bool allow_partial) {
5978 MDBX_val args[2] = {{
const_cast<void *
>(values_array), value_length}, {
nullptr, values_count}};
5991 return args[1].iov_len ;
6037 other.handle_ =
nullptr;
6077 bool throw_notfound)
6079 this->
done =
cursor.move(operation, &this->key, &this->value, throw_notfound);
6090 if (!throw_notfound)
6180 return ::mdbx::txn(
txn);
6217 slice result(
nullptr, value_length);
6224 slice result(
nullptr, value_length);
6225 const int err =
put(key, &result ,
6242 slice result(
nullptr, value_length);
6264 slice result(
nullptr, value_length);
6270 slice result(
nullptr, value_length);
6295 bool found =
seek(key);
6296 return found ?
erase(whole_multivalue) : found;
6305 size_t values_count,
put_mode mode,
bool allow_partial) {
6306 MDBX_val args[2] = {{
const_cast<void *
>(values_array), value_length}, {
nullptr, values_count}};
6319 return args[1].iov_len ;
6340template <
class ALLOCATOR,
typename CAPACITY_POLICY>
6341inline string to_string(const ::mdbx::buffer<ALLOCATOR, CAPACITY_POLICY> &buffer) {
6353inline string to_string(const ::mdbx::env::geometry &value) {
6359inline string to_string(const ::mdbx::env::operate_parameters &value) {
6371inline string to_string(const ::mdbx::env::durability &value) {
6377inline string to_string(const ::mdbx::env::reclaiming_options &value) {
6383inline string to_string(const ::mdbx::env::operate_options &value) {
6389inline string to_string(const ::mdbx::env_managed::create_parameters &value) {
6422#if defined(__LCC__) && __LCC__ >= 126
6423#pragma diagnostic pop
#define MDBX_CXX11_CONSTEXPR
Definition mdbx.h:443
#define MDBX_MAYBE_UNUSED
Definition mdbx.h:509
#define MDBX_CXX14_CONSTEXPR
Definition mdbx.h:462
#define MDBX_NOTHROW_PURE_FUNCTION
The 'pure nothrow' function attribute for optimization.
Definition mdbx.h:259
mode_t mdbx_mode_t
Definition mdbx.h:174
int(* MDBX_preserve_func)(void *context, MDBX_val *target, const void *src, size_t bytes)
Definition mdbx.h:5046
#define LIBMDBX_API
Definition mdbx.h:590
#define LIBMDBX_API_TYPE
Definition mdbx.h:605
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the table. .
Definition mdbx.h:765
LIBMDBX_API int mdbx_replace_ex(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *new_data, MDBX_val *old_data, MDBX_put_flags_t flags, MDBX_preserve_func preserver, void *preserver_context)
pthread_t mdbx_tid_t
Definition mdbx.h:173
struct MDBX_env MDBX_env
Opaque structure for a database environment.
Definition mdbx.h:697
int mdbx_filehandle_t
Definition mdbx.h:171
pid_t mdbx_pid_t
Definition mdbx.h:172
@ MDBX_MAX_PAGESIZE
Definition mdbx.h:779
@ MDBX_MAXDATASIZE
Definition mdbx.h:773
@ MDBX_MAX_DBI
Definition mdbx.h:770
@ MDBX_MIN_PAGESIZE
Definition mdbx.h:776
libmdbx build information
Definition mdbx.h:633
The fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h:4421
Latency of commit stages in 1/65536 of seconds units.
Definition mdbx.h:4070
Information about the environment.
Definition mdbx.h:2796
Statistics for a table in the environment.
Definition mdbx.h:2750
Information about the transaction.
Definition mdbx.h:3972
libmdbx version information,
Definition mdbx.h:615
LIBMDBX_API int mdbx_cursor_del(MDBX_cursor *cursor, MDBX_put_flags_t flags)
Delete current key/data pair.
LIBMDBX_API int mdbx_dbi_sequence(MDBX_txn *txn, MDBX_dbi dbi, uint64_t *result, uint64_t increment)
Sequence generation for a table.
LIBMDBX_API int mdbx_get_equal_or_great(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data)
Get equal or great item from a table.
LIBMDBX_API int mdbx_cursor_scan(MDBX_cursor *cursor, MDBX_predicate_func *predicate, void *context, MDBX_cursor_op start_op, MDBX_cursor_op turn_op, void *arg)
Сканирует таблицу с использованием передаваемого предиката, с уменьшением сопутствующих накладных рас...
LIBMDBX_API int mdbx_canary_put(MDBX_txn *txn, const MDBX_canary *canary)
Set integers markers (aka "canary") associated with the environment.
LIBMDBX_API int mdbx_canary_get(const MDBX_txn *txn, MDBX_canary *canary)
Returns fours integers markers (aka "canary") associated with the environment.
MDBX_put_flags_t
Data changing flags.
Definition mdbx.h:1625
LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *count)
Return count values (aka duplicates) for current key.
LIBMDBX_API int mdbx_cursor_scan_from(MDBX_cursor *cursor, MDBX_predicate_func *predicate, void *context, MDBX_cursor_op from_op, MDBX_val *from_key, MDBX_val *from_value, MDBX_cursor_op turn_op, void *arg)
int MDBX_cmp_func(const MDBX_val *a, const MDBX_val *b) noexcept
A callback function used to compare two keys in a table.
Definition mdbx.h:4481
LIBMDBX_API int mdbx_del(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, const MDBX_val *data)
Delete items from a table.
LIBMDBX_API int mdbx_get_ex(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_val *key, MDBX_val *data, size_t *values_count)
Get items from a table and optionally number of data items for a given key.
LIBMDBX_API int mdbx_cursor_put(MDBX_cursor *cursor, const MDBX_val *key, MDBX_val *data, MDBX_put_flags_t flags)
Store by cursor.
LIBMDBX_API int mdbx_put(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data, MDBX_put_flags_t flags)
Store items into a table.
LIBMDBX_API int mdbx_drop(MDBX_txn *txn, MDBX_dbi dbi, bool del)
Empty or delete and close a table.
LIBMDBX_API int mdbx_cursor_get(MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, MDBX_cursor_op op)
Retrieve by cursor.
LIBMDBX_API int mdbx_get(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *key, MDBX_val *data)
Get items from a table.
@ MDBX_MULTIPLE
Definition mdbx.h:1662
@ MDBX_ALLDUPS
Definition mdbx.h:1645
@ MDBX_CURRENT
Definition mdbx.h:1640
@ MDBX_APPENDDUP
Definition mdbx.h:1658
@ MDBX_APPEND
Definition mdbx.h:1653
@ MDBX_UPSERT
Definition mdbx.h:1627
@ MDBX_RESERVE
Definition mdbx.h:1649
@ MDBX_NOOVERWRITE
Definition mdbx.h:1630
LIBMDBX_API int mdbx_cursor_on_first_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на первом или единственном мульти-значении соответствующем ключу.
LIBMDBX_API int mdbx_cursor_open(MDBX_txn *txn, MDBX_dbi dbi, MDBX_cursor **cursor)
Create a cursor handle for the specified transaction and DBI handle.
LIBMDBX_API int mdbx_cursor_unbind(MDBX_cursor *cursor)
Unbind cursor from a transaction.
LIBMDBX_API MDBX_cursor * mdbx_cursor_create(void *context)
Create a cursor handle but not bind it to transaction nor DBI-handle.
LIBMDBX_API MDBX_dbi mdbx_cursor_dbi(const MDBX_cursor *cursor)
Return the cursor's table handle.
MDBX_cursor_op
Cursor operationsThis is the set of all operations for retrieving data using a cursor.
Definition mdbx.h:1702
LIBMDBX_API int mdbx_cursor_compare(const MDBX_cursor *left, const MDBX_cursor *right, bool ignore_multival)
Сравнивает позицию курсоров.
LIBMDBX_API int mdbx_cursor_on_last_dup(const MDBX_cursor *cursor)
Определяет стоит ли курсор на последнем или единственном мульти-значении соответствующем ключу.
LIBMDBX_API int mdbx_cursor_on_first(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to the first key-value pair or not.
LIBMDBX_API int mdbx_cursor_bind(MDBX_txn *txn, MDBX_cursor *cursor, MDBX_dbi dbi)
Bind cursor to specified transaction and DBI-handle.
LIBMDBX_API int mdbx_txn_release_all_cursors_ex(const MDBX_txn *txn, bool unbind, size_t *count)
Unbind or closes all cursors of a given transaction and of all its parent transactions if ones are.
struct MDBX_cursor MDBX_cursor
Opaque structure for navigating through a table.
Definition mdbx.h:727
LIBMDBX_API int mdbx_cursor_set_userctx(MDBX_cursor *cursor, void *ctx)
Set application information associated with the cursor.
LIBMDBX_API int mdbx_cursor_eof(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to a key-value pair or not, i.e. was not positioned or point...
LIBMDBX_API int mdbx_cursor_close2(MDBX_cursor *cursor)
Closes a cursor handle with returning error code.
LIBMDBX_API void * mdbx_cursor_get_userctx(const MDBX_cursor *cursor)
Get the application information associated with the MDBX_cursor.
LIBMDBX_API int mdbx_cursor_renew(MDBX_txn *txn, MDBX_cursor *cursor)
Renew a cursor handle for use within the given transaction.
LIBMDBX_API void mdbx_cursor_close(MDBX_cursor *cursor)
Closes a cursor handle without returning error code.
LIBMDBX_API MDBX_txn * mdbx_cursor_txn(const MDBX_cursor *cursor)
Return the cursor's transaction handle.
LIBMDBX_API int mdbx_cursor_on_last(const MDBX_cursor *cursor)
Determines whether the cursor is pointed to the last key-value pair or not.
LIBMDBX_API int mdbx_cursor_copy(const MDBX_cursor *src, MDBX_cursor *dest)
Copy cursor position and state.
@ MDBX_SEEK_AND_GET_MULTIPLE
Definition mdbx.h:1821
@ MDBX_GET_CURRENT
Definition mdbx.h:1717
@ MDBX_GET_BOTH
Definition mdbx.h:1710
@ MDBX_TO_KEY_EQUAL
Definition mdbx.h:1798
@ MDBX_GET_BOTH_RANGE
Definition mdbx.h:1714
@ MDBX_SET_KEY
Definition mdbx.h:1757
@ MDBX_FIRST_DUP
Definition mdbx.h:1707
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition mdbx.h:1797
@ MDBX_GET_MULTIPLE
Definition mdbx.h:1722
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition mdbx.h:1808
@ MDBX_NEXT_NODUP
Definition mdbx.h:1742
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition mdbx.h:1805
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition mdbx.h:1806
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition mdbx.h:1813
@ MDBX_PREV_MULTIPLE
Definition mdbx.h:1765
@ MDBX_SET_RANGE
Definition mdbx.h:1760
@ MDBX_LAST_DUP
Definition mdbx.h:1728
@ MDBX_PREV
Definition mdbx.h:1745
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition mdbx.h:1815
@ MDBX_TO_PAIR_GREATER_THAN
Definition mdbx.h:1816
@ MDBX_LAST
Definition mdbx.h:1725
@ MDBX_TO_KEY_LESSER_THAN
Definition mdbx.h:1796
@ MDBX_PREV_DUP
Definition mdbx.h:1748
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition mdbx.h:1804
@ MDBX_SET
Definition mdbx.h:1754
@ MDBX_NEXT
Definition mdbx.h:1731
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition mdbx.h:1799
@ MDBX_TO_PAIR_LESSER_THAN
Definition mdbx.h:1812
@ MDBX_NEXT_MULTIPLE
Definition mdbx.h:1739
@ MDBX_PREV_NODUP
Definition mdbx.h:1751
@ MDBX_TO_PAIR_EQUAL
Definition mdbx.h:1814
@ MDBX_NEXT_DUP
Definition mdbx.h:1734
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition mdbx.h:1807
@ MDBX_TO_KEY_GREATER_THAN
Definition mdbx.h:1800
@ MDBX_FIRST
Definition mdbx.h:1704
LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name)
Переименовает таблицу по DBI-дескриптору
LIBMDBX_API int mdbx_dbi_rename2(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *name)
Переименовает таблицу по DBI-дескриптору
LIBMDBX_API int mdbx_dbi_close(MDBX_env *env, MDBX_dbi dbi)
Close a table handle. Normally unnecessary.
LIBMDBX_API int mdbx_dbi_open(MDBX_txn *txn, const char *name, MDBX_db_flags_t flags, MDBX_dbi *dbi)
Open or Create a named table in the environment.
LIBMDBX_API int mdbx_dbi_open2(MDBX_txn *txn, const MDBX_val *name, MDBX_db_flags_t flags, MDBX_dbi *dbi)
Open or Create a named table in the environment.
uint32_t MDBX_dbi
A handle for an individual table (key-value spaces) in the environment.
Definition mdbx.h:720
MDBX_db_flags_t
Table flags.
Definition mdbx.h:1575
@ MDBX_INTEGERDUP
Definition mdbx.h:1599
@ MDBX_DB_ACCEDE
Definition mdbx.h:1617
@ MDBX_DB_DEFAULTS
Definition mdbx.h:1577
@ MDBX_REVERSEKEY
Definition mdbx.h:1580
@ MDBX_DUPFIXED
Definition mdbx.h:1594
@ MDBX_INTEGERKEY
Definition mdbx.h:1590
@ MDBX_REVERSEDUP
Definition mdbx.h:1602
@ MDBX_CREATE
Definition mdbx.h:1605
@ MDBX_DUPSORT
Definition mdbx.h:1583
MDBX_log_level_t
Definition mdbx.h:840
MDBX_debug_flags_t
Runtime debug flags.
Definition mdbx.h:897
LIBMDBX_API int mdbx_env_set_hsr(MDBX_env *env, MDBX_hsr_func *hsr_callback)
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which ...
int MDBX_hsr_func(const MDBX_env *env, const MDBX_txn *txn, mdbx_pid_t pid, mdbx_tid_t tid, uint64_t laggard, unsigned gap, size_t space, int retry) noexcept
A Handle-Slow-Readers callback function to resolve database full/overflow issue due to a reader(s) wh...
Definition mdbx.h:6274
MDBX_error_t
Errors and return codes.
Definition mdbx.h:1829
@ MDBX_FIRST_LMDB_ERRCODE
Definition mdbx.h:1843
@ MDBX_BAD_TXN
Definition mdbx.h:1909
@ MDBX_LAST_LMDB_ERRCODE
Definition mdbx.h:1923
@ MDBX_SUCCESS
Definition mdbx.h:1831
@ MDBX_NOTFOUND
Definition mdbx.h:1846
@ MDBX_RESULT_TRUE
Definition mdbx.h:1837
@ MDBX_BUSY
Definition mdbx.h:1927
@ MDBX_EINVAL
Definition mdbx.h:2000
@ MDBX_ENOMEM
Definition mdbx.h:2002
@ MDBX_FIRST_ADDED_ERRCODE
Definition mdbx.h:1930
@ MDBX_RESULT_FALSE
Definition mdbx.h:1834
@ MDBX_LAST_ADDED_ERRCODE
Definition mdbx.h:1979
@ MDBX_KEYEXIST
Definition mdbx.h:1840
MDBX_env_flags_t
Environment flags.
Definition mdbx.h:1016
LIBMDBX_API int mdbx_estimate_distance(const MDBX_cursor *first, const MDBX_cursor *last, ptrdiff_t *distance_items)
Estimates the distance between cursors as a number of elements.
LIBMDBX_API int mdbx_estimate_move(const MDBX_cursor *cursor, MDBX_val *key, MDBX_val *data, MDBX_cursor_op move_op, ptrdiff_t *distance_items)
Estimates the move distance.
LIBMDBX_API int mdbx_estimate_range(const MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *begin_key, const MDBX_val *begin_data, const MDBX_val *end_key, const MDBX_val *end_data, ptrdiff_t *distance_items)
Estimates the size of a range as a number of elements.
LIBMDBX_API int mdbx_env_get_option(const MDBX_env *env, const MDBX_option_t option, uint64_t *pvalue)
Gets the value of extra runtime options from an environment.
int mdbx_env_set_syncperiod(MDBX_env *env, unsigned seconds_16dot16)
Sets relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h:3040
MDBX_option_t
MDBX environment extra runtime options.
Definition mdbx.h:2106
LIBMDBX_API int mdbx_env_set_geometry(MDBX_env *env, intptr_t size_lower, intptr_t size_now, intptr_t size_upper, intptr_t growth_step, intptr_t shrink_threshold, intptr_t pagesize)
Set all size-related parameters of environment, including page size and the min/max size of the memor...
int mdbx_env_set_syncbytes(MDBX_env *env, size_t threshold)
Sets threshold to force flush the data buffers to disk, even any of MDBX_SAFE_NOSYNC flag in the envi...
Definition mdbx.h:2979
LIBMDBX_API int mdbx_env_set_option(MDBX_env *env, const MDBX_option_t option, uint64_t value)
Sets the value of a extra runtime options for an environment.
LIBMDBX_API int mdbx_env_set_userctx(MDBX_env *env, void *ctx)
Sets application information (a context pointer) associated with the environment.
LIBMDBX_API int mdbx_env_set_flags(MDBX_env *env, MDBX_env_flags_t flags, bool onoff)
Set environment flags.
@ MDBX_opt_txn_dp_initial
Controls the in-process initial allocation size for dirty pages list of a write transaction....
Definition mdbx.h:2211
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h:2207
@ MDBX_opt_prefault_write_enable
Controls prevention of page-faults of reclaimed and allocated pages in the MDBX_WRITEMAP mode by clea...
Definition mdbx.h:2311
@ MDBX_opt_max_db
Controls the maximum number of named tables for the environment.
Definition mdbx.h:2115
@ MDBX_opt_merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h:2278
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h:2138
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h:2243
@ MDBX_opt_spill_parent4child_denominator
Controls the in-process how much of the parent transaction dirty pages will be spilled while start ea...
Definition mdbx.h:2266
@ MDBX_opt_loose_limit
Controls the in-process limit to grow a cache of dirty pages for reuse in the current transaction.
Definition mdbx.h:2178
@ MDBX_opt_rp_augment_limit
Controls the in-process limit to grow a list of reclaimed/recycled page's numbers for finding a seque...
Definition mdbx.h:2165
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition mdbx.h:2132
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h:2227
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h:2144
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h:2192
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h:2306
LIBMDBX_API int mdbx_dbi_stat(const MDBX_txn *txn, MDBX_dbi dbi, MDBX_stat *stat, size_t bytes)
Retrieve statistics for a table.
LIBMDBX_API uint64_t mdbx_txn_id(const MDBX_txn *txn)
Return the transaction's ID.
LIBMDBX_API intptr_t mdbx_limits_valsize_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal data size in bytes for given page size and table flags, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_env_info_ex(const MDBX_env *env, const MDBX_txn *txn, MDBX_envinfo *info, size_t bytes)
Return information about the MDBX environment.
int mdbx_env_get_maxreaders(const MDBX_env *env, unsigned *readers)
Get the maximum number of threads/reader slots for the environment.
Definition mdbx.h:3676
int mdbx_env_get_syncperiod(const MDBX_env *env, unsigned *period_seconds_16dot16)
Get relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h:3060
LIBMDBX_API int mdbx_env_get_maxkeysize_ex(const MDBX_env *env, MDBX_db_flags_t flags)
Returns the maximum size of keys can put.
LIBMDBX_API int mdbx_env_get_maxvalsize_ex(const MDBX_env *env, MDBX_db_flags_t flags)
Returns the maximum size of data we can put.
LIBMDBX_API int mdbx_env_stat_ex(const MDBX_env *env, const MDBX_txn *txn, MDBX_stat *stat, size_t bytes)
Return statistics about the MDBX environment.
LIBMDBX_API int mdbx_env_get_pairsize4page_max(const MDBX_env *env, MDBX_db_flags_t flags)
Returns maximal size of key-value pair to fit in a single page for specified table flags.
int mdbx_env_get_syncbytes(const MDBX_env *env, size_t *threshold)
Get threshold to force flush the data buffers to disk, even any of MDBX_SAFE_NOSYNC flag in the envir...
Definition mdbx.h:2997
LIBMDBX_API intptr_t mdbx_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 large/overflow-page with the given...
LIBMDBX_API intptr_t mdbx_limits_txnsize_max(intptr_t pagesize)
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes for gi...
LIBMDBX_API int mdbx_dbi_dupsort_depthmask(const MDBX_txn *txn, MDBX_dbi dbi, uint32_t *mask)
Retrieve depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.
LIBMDBX_API int mdbx_txn_info(const MDBX_txn *txn, MDBX_txn_info *info, bool scan_rlt)
Return information about the MDBX transaction.
LIBMDBX_API int mdbx_is_dirty(const MDBX_txn *txn, const void *ptr)
Determines whether the given address is on a dirty database page of the transaction or not.
MDBX_dbi_state_t
DBI state bits returted by mdbx_dbi_flags_ex()
Definition mdbx.h:4746
LIBMDBX_API int mdbx_env_get_valsize4page_max(const MDBX_env *env, MDBX_db_flags_t flags)
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified ...
LIBMDBX_API int mdbx_env_get_fd(const MDBX_env *env, mdbx_filehandle_t *fd)
Return the file descriptor for the given environment.
LIBMDBX_API void * mdbx_env_get_userctx(const MDBX_env *env)
Returns an application information (a context pointer) associated with the environment.
int mdbx_env_get_maxdbs(const MDBX_env *env, MDBX_dbi *dbs)
Get the maximum number of named tables for the environment.
Definition mdbx.h:3721
LIBMDBX_API intptr_t mdbx_limits_keysize_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal key size in bytes for given page size and table flags, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_reader_list(const MDBX_env *env, MDBX_reader_list_func *func, void *ctx)
Enumerate the entries in the reader lock table.
LIBMDBX_API intptr_t mdbx_limits_pairsize4page_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal size of key-value pair to fit in a single page with the given size and table flags,...
LIBMDBX_API intptr_t mdbx_limits_dbsize_max(intptr_t pagesize)
Returns maximal database size in bytes for given page size, or -1 if pagesize is invalid.
LIBMDBX_API intptr_t mdbx_limits_dbsize_min(intptr_t pagesize)
Returns minimal database size in bytes for given page size, or -1 if pagesize is invalid.
LIBMDBX_API int mdbx_env_get_flags(const MDBX_env *env, unsigned *flags)
Get environment flags.
LIBMDBX_API int mdbx_dbi_flags_ex(const MDBX_txn *txn, MDBX_dbi dbi, unsigned *flags, unsigned *state)
Retrieve the DB flags and status for a table handle.
LIBMDBX_API int mdbx_txn_break(MDBX_txn *txn)
Marks transaction as broken to prevent further operations.
LIBMDBX_API int mdbx_txn_set_userctx(MDBX_txn *txn, void *ctx)
Sets application information associated (a context pointer) with the transaction.
LIBMDBX_API int mdbx_txn_park(MDBX_txn *txn, bool autounpark)
Переводит читающую транзакцию в "припаркованное" состояние.
LIBMDBX_API int mdbx_txn_unpark(MDBX_txn *txn, bool restart_if_ousted)
Распарковывает ранее припаркованную читающую транзакцию.
MDBX_txn_flags_t
Definition mdbx.h:1477
LIBMDBX_API void * mdbx_txn_get_userctx(const MDBX_txn *txn)
Returns an application information (a context pointer) associated with the transaction.
int mdbx_txn_begin(MDBX_env *env, MDBX_txn *parent, MDBX_txn_flags_t flags, MDBX_txn **txn)
Create a transaction for use with the environment.
Definition mdbx.h:3941
struct MDBX_txn MDBX_txn
Opaque structure for a transaction handle.
Definition mdbx.h:708
LIBMDBX_API int mdbx_txn_reset(MDBX_txn *txn)
Reset a read-only transaction.
LIBMDBX_API int mdbx_txn_renew(MDBX_txn *txn)
Renew a read-only transaction.
LIBMDBX_API MDBX_txn_flags_t mdbx_txn_flags(const MDBX_txn *txn)
Return the transaction's flags.
@ MDBX_TXN_RDONLY
Definition mdbx.h:1488
@ MDBX_TXN_RDONLY_PREPARE
Definition mdbx.h:1497
@ MDBX_TXN_READWRITE
Definition mdbx.h:1482
@ MDBX_TXN_TRY
Definition mdbx.h:1503
bool rename_map(const ::mdbx::slice &old_name, const ::mdbx::slice &new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
MDBX_NOTHROW_PURE_FUNCTION constexpr bool is_reference() const noexcept
Checks whether the buffer just refers to data located outside the buffer, rather than stores it.
Definition mdbx.h++:1914
MDBX_CXX14_CONSTEXPR struct slice tail(size_t n) const noexcept
Definition mdbx.h++:2463
buffer & assign(const void *begin, const void *end, bool make_reference=false)
Definition mdbx.h++:2318
buffer(size_t head_room, const struct slice &src, size_t tail_room, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2084
friend class env
Definition mdbx.h++:4070
MDBX_commit_latency commit_latency
Definition mdbx.h++:4104
env_managed(const char *pathname, const operate_parameters &, bool accede=true)
MDBX_CXX14_CONSTEXPR struct slice middle(size_t from, size_t n) const noexcept
Definition mdbx.h++:2467
::MDBX_txn_info info
Definition mdbx.h++:3765
cursor_managed(void *your_context=nullptr)
Creates a new managed cursor with underlying object.
Definition mdbx.h++:4534
::MDBX_stat map_stat
Definition mdbx.h++:3922
env & set_sync_period(const duration &period)
Sets relative period since the last unsteady commit to force flush the data buffers to disk,...
MDBX_NOTHROW_PURE_FUNCTION constexpr size_t size() const noexcept
Returns the number of bytes.
Definition mdbx.h++:2376
txn_managed start_nested()
Start nested write transaction.
extra_runtime_option
MDBX environment extra runtime options.
Definition mdbx.h++:3475
@ prefault_write_enable
Controls prevention of page-faults of reclaimed and allocated pages in the MDBX_WRITEMAP mode by clea...
Definition mdbx.h++:3509
@ spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h++:3501
@ spill_parent4child_denominator
Controls the in-process how much of the parent transaction dirty pages will be spilled while start ea...
Definition mdbx.h++:3503
@ writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h++:3507
@ sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h++:3484
@ dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h++:3495
@ dp_initial
Controls the in-process initial allocation size for dirty pages list of a write transaction....
Definition mdbx.h++:3497
@ spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h++:3499
@ merge_threshold_16dot16_percent
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h++:3505
@ rp_augment_limit
Controls the in-process limit to grow a list of reclaimed/recycled page's numbers for finding a seque...
Definition mdbx.h++:3489
@ loose_limit
Controls the in-process limit to grow a cache of dirty pages for reuse in the current transaction.
Definition mdbx.h++:3491
@ dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h++:3493
static buffer key_from(silo &&src) noexcept
Definition mdbx.h++:2632
env_managed & operator=(env_managed &&other) noexcept
Definition mdbx.h++:3702
MDBX_CXX14_CONSTEXPR struct slice safe_middle(size_t from, size_t n) const
Definition mdbx.h++:2479
MDBX_CXX14_CONSTEXPR int64_t as_int64() const
Definition mdbx.h++:2139
constexpr allocator_type get_allocator() const
Definition mdbx.h++:1903
bool drop_map(const ::std::string_view &name, bool throw_if_absent=false)
Drop key-value map.
Definition mdbx.h++:3903
env_managed(const char *pathname, const create_parameters &, const operate_parameters &, bool accede=true)
map_handle(const map_handle &) noexcept=default
void reserve_tailroom(size_t wanna_tailroom)
Reserves space after the payload.
Definition mdbx.h++:2269
::MDBX_db_flags_t flags
Definition mdbx.h++:2985
path get_path() const
Return the path that was used for opening the environment.
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.
Definition mdbx.h++:2218
int64_t as_int64_adapt() const
Definition mdbx.h++:2155
constexpr ::std::basic_string< CHAR, T, A > as_string(const A &allocator=A()) const
Definition mdbx.h++:2385
move_result to_exact_key_value_lesser_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4384
move_result previous_multiple_samelength(bool throw_notfound=false)
Definition mdbx.h++:4440
buffer encode_base64(unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const
Definition mdbx.h++:2213
static buffer key_from(const double *ieee754_64bit)
Definition mdbx.h++:2638
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.
Definition mdbx.h++:2189
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t length() const noexcept
Returns the number of bytes.
Definition mdbx.h++:1994
static bool remove(const ::std::wstring &pathname, const remove_mode mode=just_remove)
MDBX_CXX14_CONSTEXPR ::std::span< const POD > as_span() const
Definition mdbx.h++:2110
MDBX_CXX11_CONSTEXPR map_handle(MDBX_dbi dbi) noexcept
Definition mdbx.h++:2979
buffer & assign(const char *c_str, bool make_reference=false)
Definition mdbx.h++:2327
void reserve(size_t wanna_headroom, size_t wanna_tailroom)
Reserves storage space.
Definition mdbx.h++:2256
buffer & assign(const struct slice &src, bool make_reference=false)
Definition mdbx.h++:2298
void reserve_headroom(size_t wanna_headroom)
Reserves space before the payload.
Definition mdbx.h++:2266
durability
Durability level.
Definition mdbx.h++:3132
@ lazy_weak_tail
Definition mdbx.h++:3135
@ robust_synchronous
Definition mdbx.h++:3133
@ whole_fragile
Definition mdbx.h++:3136
@ half_synchronous_weak_last
Definition mdbx.h++:3134
void commit_embark_read()
Commit all the operations of a transaction into the database and then start read transaction.
constexpr buffer(const buffer &src, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2052
MDBX_CXX11_CONSTEXPR txn_managed() noexcept=default
MDBX_CXX11_CONSTEXPR bool is_null() const noexcept
Checks whether the data pointer of the buffer is nullptr.
Definition mdbx.h++:2373
::std::allocator_traits< allocator_type > allocator_traits
Definition mdbx.h++:1475
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.
Definition mdbx.h++:2232
size_t dbsize_min() const
Returns the minimal database size in bytes for the environment.
Definition mdbx.h++:3302
buffer & append_decoded_hex(const struct slice &data, bool ignore_spaces=false)
Definition mdbx.h++:2527
map_handle & operator=(const map_handle &) noexcept=default
duration sync_period() const
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk...
buffer(const ::std::basic_string_view< CHAR, T > &view, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2042
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t hash_value() const noexcept
Returns the hash value of the data.
Definition mdbx.h++:2382
MDBX_NOTHROW_PURE_FUNCTION constexpr size_t tailroom() const noexcept
Returns the number of bytes that available in currently allocated storage after the currently data en...
Definition mdbx.h++:1929
move_result seek_multiple_samelength(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4428
buffer & assign_freestanding(const void *ptr, size_t bytes)
Definition mdbx.h++:2277
constexpr void swap(buffer &other) noexcept(swap_alloc::is_nothrow())
Definition mdbx.h++:2283
buffer & operator=(const buffer &src)
Definition mdbx.h++:2344
estimate_result estimate(move_operation operation, slice &key) const
uint16_t as_uint16_adapt() const
Definition mdbx.h++:2149
buffer & append_u16(uint_fast16_t u16)
Definition mdbx.h++:2549
MDBX_NOTHROW_PURE_FUNCTION constexpr bool is_freestanding() const noexcept
Checks whether data chunk stored inside the buffer, otherwise buffer just refers to data located outs...
Definition mdbx.h++:1907
static bool remove(const char *pathname, const remove_mode mode=just_remove)
friend class cursor
Definition mdbx.h++:3726
move_result to_pair_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4403
::MDBX_canary canary
Definition mdbx.h++:3931
env & copy(const wchar_t *destination, bool compactify, bool force_dynamic_size=false)
void safe_remove_suffix(size_t n)
Drops the last "n" bytes from the data chunk.
Definition mdbx.h++:2429
void safe_remove_prefix(size_t n)
Drops the first "n" bytes from the data chunk.
Definition mdbx.h++:2425
bool is_readwrite() const
Checks whether the transaction is read-write.
Definition mdbx.h++:3763
MDBX_CXX11_CONSTEXPR void * end() noexcept
Return a pointer to the end of the referenced data.
Definition mdbx.h++:1988
map_handle open_map_accede(const ::std::string_view &name) const
Open existing key-value map.
move_result move(move_operation operation, const slice &key, const slice &value, bool throw_notfound)
Definition mdbx.h++:4333
MDBX_CXX11_CONSTEXPR const void * data() const noexcept
Return a const pointer to the beginning of the referenced data.
Definition mdbx.h++:1974
static buffer key_from(const ::std::basic_string< CHAR, T, A > &src, bool make_reference=false)
Definition mdbx.h++:2628
env_managed(const wchar_t *pathname, const operate_parameters &, bool accede=true)
move_result to_pair_lesser_than(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4397
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.
Definition mdbx.h++:2251
bool clear_map(const char *name, bool throw_if_absent=false)
buffer & add_header(const void *src, size_t bytes)
Definition mdbx.h++:2491
uint8_t as_uint8_adapt() const
Definition mdbx.h++:2150
MDBX_NOTHROW_PURE_FUNCTION bool starts_with(const struct slice &prefix) const noexcept
Checks if the data starts with the given prefix.
Definition mdbx.h++:2395
move_result to_pair_exact(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4406
buffer encode_base58(unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const
Definition mdbx.h++:2208
MDBX_CXX14_CONSTEXPR struct slice safe_tail(size_t n) const
Definition mdbx.h++:2475
void rename_map(map_handle map, const ::std::string_view &new_name)
Переименовывает таблицу ключ-значение.
env & copy(filehandle fd, bool compactify, bool force_dynamic_size=false)
Copy an environment to the specified file descriptor.
::std::basic_string_view< CHAR, T > string_view() const noexcept
Definition mdbx.h++:2359
buffer(size_t head_room, const buffer &src, size_t tail_room, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2092
buffer & assign(const ::std::basic_string< CHAR, T, A > &str, bool make_reference=false)
Definition mdbx.h++:2323
env_managed(const ::mdbx::filesystem::path &pathname, const operate_parameters &, bool accede=true)
Open existing database.
static buffer key_from_jsonInteger(const int64_t json_integer)
Definition mdbx.h++:2648
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.
Definition mdbx.h++:2181
static bool remove(const ::std::string &pathname, const remove_mode mode=just_remove)
void put(const pair &kv, put_mode mode)
Definition mdbx.h++:4487
move_result current(bool throw_notfound=true) const
Definition mdbx.h++:4351
MDBX_CXX14_CONSTEXPR uint128_t as_uint128() const
Definition mdbx.h++:2129
MDBX_CXX14_CONSTEXPR ::std::span< POD > as_span()
Definition mdbx.h++:2113
env & copy(const char *destination, bool compactify, bool force_dynamic_size=false)
move_result to_previous_last_multi(bool throw_notfound=true)
Definition mdbx.h++:4342
MDBX_CXX14_CONSTEXPR buffer & set_end(const void *ptr)
Sets the length by specifying the end of the data.
Definition mdbx.h++:2006
static buffer key_from(const float ieee754_32bit)
Definition mdbx.h++:2654
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.
bool drop_map(const char *name, bool throw_if_absent=false)
Drops key-value map using name.
MDBX_CXX11_CONSTEXPR map_handle() noexcept
Definition mdbx.h++:2978
bool is_same_or_after_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4168
size_t unbind_all_cursors() const
Unbind all cursors.
Definition mdbx.h++:3810
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.
Definition mdbx.h++:2161
void upsert(map_handle map, const pair &kv)
Definition mdbx.h++:3986
move_result to_key_greater_or_equal(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4374
bool is_same_position(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4160
buffer(const buffer &src, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2028
bool is_after_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4164
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.
Definition mdbx.h++:2225
buffer & operator=(const ::std::basic_string_view< CHAR, T > &view) noexcept
Definition mdbx.h++:2353
uint32_t as_uint32_adapt() const
Definition mdbx.h++:2148
buffer(size_t head_room, size_t tail_room, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2074
constexpr buffer() noexcept=default
static buffer key_from_double(const double ieee754_64bit)
Definition mdbx.h++:2634
void remove_suffix(size_t n) noexcept
Drops the last "n" bytes from the data chunk.
Definition mdbx.h++:2421
env_managed & operator=(const env_managed &)=delete
map_handle create_map(const ::std::string_view &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.
Definition mdbx.h++:3895
buffer & assign(struct slice &&src, bool make_reference=false)
Definition mdbx.h++:2306
static size_t default_pagesize() noexcept
Returns default page size for current system/platform.
Definition mdbx.h++:3229
MDBX_CXX11_CONSTEXPR cursor() noexcept=default
MDBX_CXX14_CONSTEXPR uint32_t as_uint32() const
Definition mdbx.h++:2132
move_result to_next_first_multi(bool throw_notfound=true)
Definition mdbx.h++:4358
buffer & assign(const void *ptr, size_t bytes, bool make_reference=false)
Definition mdbx.h++:2294
MDBX_cursor * withdraw_handle() noexcept
Definition mdbx.h++:4556
bool clear_map(const ::mdbx::slice &name, bool throw_if_absent=false)
void clear_and_reserve(size_t whole_capacity, size_t headroom=0) noexcept
Clears the contents and reserve storage.
Definition mdbx.h++:2408
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.
Definition mdbx.h++:2196
MDBX_txn * handle_
Definition mdbx.h++:3727
void abort()
Abandon all the operations of the transaction instead of saving ones.
static buffer key_from_u64(const uint64_t unsigned_int64)
Definition mdbx.h++:2640
move_result move(move_operation operation, const slice &key, bool throw_notfound)
Definition mdbx.h++:4330
mode
Operation mode.
Definition mdbx.h++:3124
@ write_mapped_io
Definition mdbx.h++:3127
@ nested_transactions
Definition mdbx.h++:3128
@ readonly
Definition mdbx.h++:3125
@ write_file_io
Definition mdbx.h++:3126
move_result move(move_operation operation, bool throw_notfound)
Definition mdbx.h++:4327
MDBX_CXX14_CONSTEXPR ::std::span< const byte > bytes() const
Definition mdbx.h++:2115
bool scan_from(CALLABLE_PREDICATE predicate, slice &from, move_operation start=key_greater_or_equal, move_operation turn=next)
Definition mdbx.h++:4286
::MDBX_envinfo info
Information about the environment.
Definition mdbx.h++:3363
operator::mdbx::txn() const
Definition mdbx.h++:4469
MDBX_NOTHROW_PURE_FUNCTION constexpr size_t headroom() const noexcept
Returns the number of bytes that available in currently allocated storage ahead the currently beginni...
Definition mdbx.h++:1923
buffer & append_base64(const struct slice &data, unsigned wrap_width=0)
Definition mdbx.h++:2523
MDBX_env * handle_
Definition mdbx.h++:3026
static buffer key_from(const ::std::basic_string_view< CHAR, T > &src, bool make_reference=false)
Definition mdbx.h++:2620
move_result to_exact_key_value_greater_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4390
buffer & append_byte(uint_fast8_t byte)
Definition mdbx.h++:2547
commit_latency commit_get_latency()
Commit all the operations of a transaction into the database and return latency information.
Definition mdbx.h++:4117
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.
Definition mdbx.h++:2168
bool is_same_or_before_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4156
static buffer key_from_float(const float ieee754_32bit)
Definition mdbx.h++:2652
buffer(const struct slice &src, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2022
MDBX_CXX14_CONSTEXPR int128_t as_int128() const
Definition mdbx.h++:2137
move_result to_first(bool throw_notfound=true)
Definition mdbx.h++:4340
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.
Definition mdbx.h++:2239
move_result to_last(bool throw_notfound=true)
Definition mdbx.h++:4360
buffer & operator=(const struct slice &src)
Definition mdbx.h++:2348
constexpr buffer(const void *ptr, size_t bytes, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2055
buffer(const ::mdbx::txn &txn, const struct slice &src, const allocator_type &allocator=allocator_type())
void close()
Explicitly closes the cursor.
Definition mdbx.h++:4540
MDBX_NOTHROW_PURE_FUNCTION constexpr bool empty() const noexcept
Checks whether the string is empty.
Definition mdbx.h++:2370
constexpr buffer(const ::std::basic_string< CHAR, T, A > &str, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2059
buffer & append_base58(const struct slice &data, unsigned wrap_width=0)
Definition mdbx.h++:2519
MDBX_CXX11_CONSTEXPR void * data() noexcept
Return a pointer to the beginning of the referenced data.
Definition mdbx.h++:1981
MDBX_CXX11_CONSTEXPR const struct slice & slice() const noexcept
Definition mdbx.h++:2100
bool is_pristine() const
Returns true for a freshly created database, but false if at least one transaction was committed.
move_result to_key_exact(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4371
bool is_readonly() const
Checks whether the transaction is read-only.
Definition mdbx.h++:3760
MDBX_CXX11_CONSTEXPR const char * char_ptr() const noexcept
Returns casted to const pointer to char an address of data.
Definition mdbx.h++:1954
buffer & assign(::MDBX_val &&src, bool make_reference=false)
Definition mdbx.h++:2312
static buffer key_from(const float *ieee754_32bit)
Definition mdbx.h++:2656
constexpr buffer(const ::std::basic_string_view< CHAR, T > &view, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2069
buffer & append_u48(uint_fast64_t u48)
Definition mdbx.h++:2582
move_result next_multiple_samelength(bool throw_notfound=false)
Definition mdbx.h++:4436
env_managed(const ::std::wstring &pathname, const operate_parameters &, bool accede=true)
MDBX_CXX14_CONSTEXPR uint8_t as_uint8() const
Definition mdbx.h++:2134
MDBX_CXX14_CONSTEXPR int16_t as_int16() const
Definition mdbx.h++:2141
void append(map_handle map, const pair &kv, bool multivalue_order_preserved=true)
Definition mdbx.h++:4034
cursor_managed & operator=(const cursor_managed &)=delete
default_capacity_policy reservation_policy
Definition mdbx.h++:1476
remove_mode
Deletion modes for remove().
Definition mdbx.h++:3333
@ ensure_unused
Make sure that the environment is not being used by other processes, or return an error otherwise.
Definition mdbx.h++:3343
@ wait_for_unused
Wait until other processes closes the environment before deletion.
Definition mdbx.h++:3345
@ just_remove
Just delete the environment's files and directory if any.
Definition mdbx.h++:3340
MDBX_CXX14_CONSTEXPR byte & at(size_t n)
Accesses the specified byte of data chunk with bounds checking.
Definition mdbx.h++:2451
static buffer key_from(const int64_t signed_int64)
Definition mdbx.h++:2646
MDBX_CXX11_CONSTEXPR byte * byte_ptr() noexcept
Returns casted to pointer to byte an address of data.
Definition mdbx.h++:1941
bool scan(CALLABLE_PREDICATE predicate, move_operation start=first, move_operation turn=next)
Definition mdbx.h++:4262
move_result to_current_first_multi(bool throw_notfound=true)
Definition mdbx.h++:4345
buffer & operator=(struct slice &&src)
Definition mdbx.h++:2350
buffer & add_header(const struct slice &chunk)
Definition mdbx.h++:2499
MDBX_CXX14_CONSTEXPR ::std::span< const char > chars() const
Definition mdbx.h++:2117
buffer & append_u32(uint_fast32_t u32)
Definition mdbx.h++:2570
buffer & append_decoded_base58(const struct slice &data, bool ignore_spaces=false)
Definition mdbx.h++:2531
bool scan_from(CALLABLE_PREDICATE predicate, pair &from, move_operation start=pair_greater_or_equal, move_operation turn=next)
Definition mdbx.h++:4307
uint128_t as_uint128_adapt() const
Definition mdbx.h++:2145
cursor_managed & operator=(cursor_managed &&other) noexcept
Definition mdbx.h++:4546
::MDBX_dbi_state_t state
Definition mdbx.h++:2986
MDBX_CXX14_CONSTEXPR uint16_t as_uint16() const
Definition mdbx.h++:2133
env_managed(env_managed &&)=default
bool poll_sync_to_disk()
Performs non-blocking polling of sync-to-disk thresholds.
Definition mdbx.h++:3532
void put_multiple_samelength(const slice &key, const ::std::vector< VALUE > &vector, put_mode mode)
Definition mdbx.h++:4514
cursor_managed(cursor_managed &&)=default
void commit(commit_latency &latency)
Commit all the operations of a transaction into the database and collect latency information.
Definition mdbx.h++:4112
MDBX_CXX14_CONSTEXPR byte at(size_t n) const
Accesses the specified byte of data chunk with bounds checking.
Definition mdbx.h++:2447
static bool remove(const wchar_t *pathname, const remove_mode mode=just_remove)
size_t key_max(key_mode mode) const
Returns the maximal key size in bytes for specified keys mode.
Definition mdbx.h++:3308
MDBX_CXX14_CONSTEXPR POD as_pod() const
Definition mdbx.h++:2126
move_result to_pair_lesser_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4400
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.
static buffer key_from_i32(const int32_t signed_int32)
Definition mdbx.h++:2662
move_result get_multiple_samelength(bool throw_notfound=false)
Definition mdbx.h++:4432
move_result to_key_lesser_than(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4362
move_result to_next(bool throw_notfound=true)
Definition mdbx.h++:4359
env_managed(const ::std::string &pathname, const operate_parameters &, bool accede=true)
MDBX_CXX14_CONSTEXPR size_t operator()(::mdbx::slice const &slice) const noexcept
Definition mdbx.h++:6416
operator::mdbx::map_handle() const
Definition mdbx.h++:4470
size_t dbsize_max() const
Returns the maximal database size in bytes for the environment.
Definition mdbx.h++:3304
buffer encode_hex(bool uppercase=false, unsigned wrap_width=0, const allocator_type &allocator=allocator_type()) const
Definition mdbx.h++:2201
static buffer wrap(const POD &pod, bool make_reference=false, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2122
static buffer key_from_u32(const uint32_t unsigned_int32)
Definition mdbx.h++:2658
void remove_prefix(size_t n) noexcept
Drops the first "n" bytes from the data chunk.
Definition mdbx.h++:2417
bool drop_map(const ::mdbx::slice &name, bool throw_if_absent=false)
Drop key-value map.
size_t close_all_cursors() const
Close all cursors.
Definition mdbx.h++:3807
static buffer key_from(const uint32_t unsigned_int32)
Definition mdbx.h++:2660
buffer & assign_reference(const void *ptr, size_t bytes)
Definition mdbx.h++:2271
void commit()
Commit all the operations of a transaction into the database.
move_result to_key_greater_than(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4377
size_t get_pagesize() const
Returns pagesize of this MDBX environment.
Definition mdbx.h++:3369
void make_freestanding()
Makes buffer owning the data.
Definition mdbx.h++:2014
void put(map_handle map, const pair &kv, put_mode mode)
Definition mdbx.h++:3983
MDBX_CXX14_CONSTEXPR buffer & set_length(size_t bytes)
Set length of data.
Definition mdbx.h++:1999
env_managed(const ::std::string &pathname, const create_parameters &, const operate_parameters &, bool accede=true)
buffer & assign(const ::MDBX_val &src, bool make_reference=false)
Definition mdbx.h++:2302
MDBX_CXX14_CONSTEXPR int32_t as_int32() const
Definition mdbx.h++:2140
friend int compare_position(const cursor &left, const cursor &right, bool ignore_nested)
Definition mdbx.h++:6063
buffer(const char *c_str, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2037
constexpr buffer(const struct slice &src, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2048
MDBX_CXX11_CONSTEXPR byte operator[](size_t n) const noexcept
Accesses the specified byte of data chunk.
Definition mdbx.h++:2433
void put_multiple_samelength(map_handle map, const slice &key, const ::std::vector< VALUE > &vector, put_mode mode)
Definition mdbx.h++:4050
MDBX_CXX14_CONSTEXPR struct slice safe_head(size_t n) const
Definition mdbx.h++:2471
env_managed(const wchar_t *pathname, const create_parameters &, const operate_parameters &, bool accede=true)
size_t transaction_size_max() const
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
Definition mdbx.h++:3315
map_handle open_map(const ::std::string_view &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.
Definition mdbx.h++:3888
allocation_aware_details::move_assign_alloc< silo, allocator_type > move_assign_alloc
Definition mdbx.h++:1899
int32_t as_int32_adapt() const
Definition mdbx.h++:2156
buffer & assign(const buffer &src, bool make_reference=false)
Definition mdbx.h++:2292
size_t put_multiple_samelength(map_handle map, const slice &key, const VALUE *values_array, size_t values_count, put_mode mode, bool allow_partial=false)
Definition mdbx.h++:4042
MDBX_CXX11_CONSTEXPR char * end_char_ptr() noexcept
Returns casted to pointer to char an end of data.
Definition mdbx.h++:1968
allocation_aware_details::copy_assign_alloc< silo, allocator_type > copy_assign_alloc
Definition mdbx.h++:1900
bool rename_map(const ::std::string &old_name, const ::std::string &new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
buffer(const void *ptr, size_t bytes, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2031
buffer & append(const struct slice &chunk)
Definition mdbx.h++:2489
MDBX_CXX14_CONSTEXPR int8_t as_int8() const
Definition mdbx.h++:2142
bool is_empty() const
Checks whether the database is empty.
MDBX_CXX11_CONSTEXPR const byte * byte_ptr() const noexcept
Definition mdbx.h++:1934
buffer & append_decoded_base64(const struct slice &data, bool ignore_spaces=false)
Definition mdbx.h++:2535
void close(bool dont_sync=false)
Explicitly closes the environment and release the memory map.
MDBX_NOTHROW_PURE_FUNCTION bool ends_with(const struct slice &suffix) const noexcept
Checks if the data ends with the given suffix.
Definition mdbx.h++:2400
move_result to_pair_greater_than(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4412
env & copy(const ::std::string &destination, bool compactify, bool force_dynamic_size=false)
move_operation
Definition mdbx.h++:4178
@ multi_exactkey_lowerboundvalue
Definition mdbx.h++:4193
@ multi_exactkey_value_equal
Definition mdbx.h++:4210
@ pair_greater_or_equal
Definition mdbx.h++:4218
@ key_lesser_than
Definition mdbx.h++:4200
@ next
Definition mdbx.h++:4181
@ pair_exact
Definition mdbx.h++:4217
@ multi_exactkey_value_greater_or_equal
Definition mdbx.h++:4211
@ pair_lesser_or_equal
Definition mdbx.h++:4215
@ batch_samelength
Definition mdbx.h++:4221
@ seek_key
Definition mdbx.h++:4195
@ key_lowerbound
Definition mdbx.h++:4197
@ pair_lesser_than
Definition mdbx.h++:4214
@ pair_equal
Definition mdbx.h++:4216
@ key_greater_than
Definition mdbx.h++:4204
@ batch_samelength_next
Definition mdbx.h++:4222
@ multi_find_pair
Definition mdbx.h++:4192
@ key_greater_or_equal
Definition mdbx.h++:4203
@ key_exact
Definition mdbx.h++:4196
@ key_equal
Definition mdbx.h++:4202
@ multi_currentkey_prevvalue
Definition mdbx.h++:4187
@ key_lesser_or_equal
Definition mdbx.h++:4201
@ multi_nextkey_firstvalue
Definition mdbx.h++:4190
@ get_current
Definition mdbx.h++:4183
@ multi_exactkey_value_lesser_or_equal
Definition mdbx.h++:4209
@ multi_prevkey_lastvalue
Definition mdbx.h++:4185
@ previous
Definition mdbx.h++:4182
@ last
Definition mdbx.h++:4180
@ pair_greater_than
Definition mdbx.h++:4219
@ multi_exactkey_value_lesser_than
Definition mdbx.h++:4208
@ multi_currentkey_firstvalue
Definition mdbx.h++:4186
@ first
Definition mdbx.h++:4179
@ batch_samelength_previous
Definition mdbx.h++:4223
@ multi_currentkey_nextvalue
Definition mdbx.h++:4188
@ seek_and_batch_samelength
Definition mdbx.h++:4224
@ multi_exactkey_value_greater
Definition mdbx.h++:4212
@ multi_currentkey_lastvalue
Definition mdbx.h++:4189
virtual ~env_managed() noexcept
MDBX_CXX14_CONSTEXPR uint64_t as_uint64() const
Definition mdbx.h++:2131
MDBX_CXX14_CONSTEXPR struct slice head(size_t n) const noexcept
Definition mdbx.h++:2459
bool move(move_operation operation, slice &key, slice &value, bool throw_notfound)
Definition mdbx.h++:4336
static buffer key_from(const char(&text)[SIZE], bool make_reference=true)
Definition mdbx.h++:2614
void insert(const pair &kv)
Definition mdbx.h++:4488
buffer & append(const void *src, size_t bytes)
Definition mdbx.h++:2481
cursor_managed(const cursor_managed &)=delete
env_managed(const ::std::wstring &pathname, const create_parameters &, const operate_parameters &, bool accede=true)
MDBX_CXX14_CONSTEXPR ::std::span< char > chars()
Definition mdbx.h++:2118
void upsert(const pair &kv)
Definition mdbx.h++:4490
move_result to_current_prev_multi(bool throw_notfound=true)
Definition mdbx.h++:4348
void shrink_to_fit()
Reduces memory usage by freeing unused storage space.
Definition mdbx.h++:2413
MDBX_CXX11_CONSTEXPR const char * end_char_ptr() const noexcept
Returns casted to const pointer to char an end of data.
Definition mdbx.h++:1957
int16_t as_int16_adapt() const
Definition mdbx.h++:2157
txn_managed & operator=(const txn_managed &)=delete
static buffer key_from(const int32_t signed_int32)
Definition mdbx.h++:2664
void clear() noexcept
Clears the contents and storage.
Definition mdbx.h++:2405
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.
Definition mdbx.h++:2174
bool clear_map(const ::std::string_view &name, bool throw_if_absent=false)
Definition mdbx.h++:3908
move_result to_exact_key_value_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4387
MDBX_CXX11_CONSTEXPR const void * end() const noexcept
Return a const pointer to the end of the referenced data.
Definition mdbx.h++:1977
typename ::std::allocator_traits< default_allocator >::template rebind_alloc< uint64_t > allocator_type
Definition mdbx.h++:1471
bool rename_map(const char *old_name, const char *new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
env_managed(const env_managed &)=delete
static buffer key_from(const double ieee754_64bit)
Definition mdbx.h++:2636
move_result to_current_last_multi(bool throw_notfound=true)
Definition mdbx.h++:4355
MDBX_CXX11_CONSTEXPR char * char_ptr() noexcept
Returns casted to pointer to char an address of data.
Definition mdbx.h++:1961
value_result try_insert(const pair &kv)
Definition mdbx.h++:4489
size_t put_multiple_samelength(const slice &key, const VALUE *values_array, size_t values_count, put_mode mode, bool allow_partial=false)
Definition mdbx.h++:4506
move_result to_key_lesser_or_equal(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4365
MDBX_CXX11_CONSTEXPR env_managed() noexcept=default
static buffer key_from_i64(const int64_t signed_int64)
Definition mdbx.h++:2644
move_result to_pair_greater_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4409
uint64_t as_uint64_adapt() const
Definition mdbx.h++:2147
size_t value_max(value_mode mode) const
Returns the maximal value size in bytes for specified values mode.
Definition mdbx.h++:3312
MDBX_cursor * handle_
Definition mdbx.h++:4133
buffer & append_u8(uint_fast8_t u8)
Definition mdbx.h++:2539
~cursor_managed() noexcept
Definition mdbx.h++:4564
buffer & append_u24(uint_fast32_t u24)
Definition mdbx.h++:2559
buffer(buffer &&src) noexcept(move_assign_alloc::is_nothrow())
Definition mdbx.h++:2097
MDBX_dbi dbi
Definition mdbx.h++:2977
buffer(const ::std::basic_string< CHAR, T, A > &&)=delete
move_result to_exact_key_value_lesser_than(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4381
static buffer key_from(const uint64_t unsigned_int64)
Definition mdbx.h++:2642
move_result to_current_next_multi(bool throw_notfound=true)
Definition mdbx.h++:4352
buffer & append_u64(uint_fast64_t u64)
Definition mdbx.h++:2596
MDBX_NOTHROW_PURE_FUNCTION constexpr size_t capacity() const noexcept
Returns the number of bytes that can be held in currently allocated storage.
Definition mdbx.h++:1917
MDBX_CXX11_CONSTEXPR env() noexcept=default
MDBX_CXX11_CONSTEXPR const byte * end_byte_ptr() const noexcept
Returns casted to const pointer to byte an end of data.
Definition mdbx.h++:1937
MDBX_CXX11_CONSTEXPR byte & operator[](size_t n) noexcept
Accesses the specified byte of data chunk.
Definition mdbx.h++:2440
buffer(const ::std::basic_string< CHAR, T, A > &)=delete
buffer & append_hex(const struct slice &data, bool uppercase=false, unsigned wrap_width=0)
Definition mdbx.h++:2515
MDBX_CXX14_CONSTEXPR buffer(const ::std::span< POD > &span)
Definition mdbx.h++:2105
size_t size_max() const
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
Definition mdbx.h++:3771
MDBX_CXX11_CONSTEXPR byte * end_byte_ptr() noexcept
Returns casted to pointer to byte an end of data.
Definition mdbx.h++:1948
buffer & operator=(buffer &&src) noexcept(move_assign_alloc::is_nothrow())
Definition mdbx.h++:2346
env & copy(const ::std::wstring &destination, bool compactify, bool force_dynamic_size=false)
move_result to_exact_key_value_greater_than(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4393
txn_managed(const txn_managed &)=delete
friend int compare_position_nothrow(const cursor &left, const cursor &right, bool ignore_nested) noexcept
Definition mdbx.h++:6059
static buffer clone(const buffer &src, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2288
buffer(size_t capacity, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2079
MDBX_CXX14_CONSTEXPR ::std::span< byte > bytes()
Definition mdbx.h++:2116
::MDBX_stat stat
Statistics for a database in the MDBX environment.
Definition mdbx.h++:3360
size_t value_min(value_mode mode) const noexcept
Returns the minimal value size in bytes for specified values mode.
Definition mdbx.h++:3310
value_result try_insert(map_handle map, const pair &kv)
Definition mdbx.h++:3985
buffer & append_producer(PRODUCER &producer)
Definition mdbx.h++:2501
void insert(map_handle map, const pair &kv)
Definition mdbx.h++:3984
buffer & append_producer(const PRODUCER &producer)
Definition mdbx.h++:2508
MDBX_CXX11_CONSTEXPR txn() noexcept=default
int128_t as_int128_adapt() const
Definition mdbx.h++:2153
env_managed(const ::mdbx::filesystem::path &pathname, const create_parameters &, const operate_parameters &, bool accede=true)
Create new or open existing database.
static buffer key_from(const char *src, bool make_reference=false)
Definition mdbx.h++:2625
bool rename_map(const ::std::string_view &old_name, const ::std::string_view &new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
Definition mdbx.h++:3916
move_result to_key_equal(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4368
@ pettiness_threshold
Definition mdbx.h++:1485
@ max_length
Definition mdbx.h++:1478
@ max_capacity
Definition mdbx.h++:1479
@ extra_inplace_storage
Definition mdbx.h++:1480
@ inplace_storage_size_rounding
Definition mdbx.h++:1481
move_result to_previous(bool throw_notfound=true)
Definition mdbx.h++:4341
constexpr buffer(const char *c_str, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2064
friend class txn
Definition mdbx.h++:1489
bool is_before_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4152
size_t key_min(key_mode mode) const noexcept
Returns the minimal key size in bytes for specified keys mode.
Definition mdbx.h++:3306
int8_t as_int8_adapt() const
Definition mdbx.h++:2158
size_t size_current() const
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes.
Definition mdbx.h++:3774
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.
Definition mdbx.h++:2245
bool fullscan(CALLABLE_PREDICATE predicate, bool backward=false)
Definition mdbx.h++:4281
The chunk of data stored inside the buffer or located outside it.
Definition mdbx.h++:1468
Unmanaged cursor.
Definition mdbx.h++:4131
Managed cursor.
Definition mdbx.h++:4526
Unmanaged database environment.
Definition mdbx.h++:3022
Managed database environment.
Definition mdbx.h++:3641
Unmanaged database transaction.
Definition mdbx.h++:3724
Managed database transaction.
Definition mdbx.h++:4068
static size_t key_min(MDBX_db_flags_t flags) noexcept
Returns the minimal key size in bytes for specified table flags.
Definition mdbx.h++:5200
polymorphic_allocator default_allocator
Definition mdbx.h++:358
MDBX_CXX11_CONSTEXPR txn(MDBX_txn *ptr) noexcept
Definition mdbx.h++:5524
buffer< ALLOCATOR, CAPACITY_POLICY > encode_base58(unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a buffer with a Base58 dump of the slice content.
Definition mdbx.h++:5037
env & set_HandleSlowReaders(MDBX_hsr_func *)
Sets a Handle-Slow-Readers callback to resolve database full/overflow issue due to a reader(s) which ...
Definition mdbx.h++:5485
MDBX_CXX11_CONSTEXPR bool is_success() const noexcept
Definition mdbx.h++:4678
void * get_context() const noexcept
Returns the application context associated with the transaction.
Definition mdbx.h++:5550
static size_t value_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns the maximal value size in bytes for specified page size and table flags.
Definition mdbx.h++:5228
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.
Definition mdbx.h++:5933
void renew(::mdbx::txn &txn)
Renew/bind a cursor with a new transaction and previously used key-value map handle.
Definition mdbx.h++:6170
value_mode
Kind of the values and sorted multi-values with corresponding comparison.
Definition mdbx.h++:2891
MDBX_CXX14_CONSTEXPR void clear() noexcept
Makes the slice empty and referencing to nothing.
Definition mdbx.h++:4883
MDBX_CXX11_CONSTEXPR byte operator[](size_t n) const noexcept
Returns the nth byte in the referenced data.
Definition mdbx.h++:4927
MDBX_CXX11_CONSTEXPR_ENUM mdbx::key_mode key_mode() const noexcept
Definition mdbx.h++:5125
void reset_reading()
Reset read-only transaction.
Definition mdbx.h++:5583
void success_or_panic(const char *context_where, const char *func_who) const noexcept
Definition mdbx.h++:4723
void rethrow_captured() const
Definition mdbx.h++:4660
move_result find_multivalue(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:6128
ptrdiff_t estimate(move_operation operation, MDBX_val *key, MDBX_val *value) const
Definition mdbx.h++:6104
MDBX_CXX14_CONSTEXPR void invalidate() noexcept
Depletes content of slice and make it invalid.
Definition mdbx.h++:4881
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.
Definition mdbx.h++:5654
static size_t dbsize_max(intptr_t pagesize)
Returns the maximal database size in bytes for specified page size.
Definition mdbx.h++:5193
geometry & make_dynamic(intptr_t lower=default_value, intptr_t upper=default_value) noexcept
Definition mdbx.h++:5167
value_result try_update_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5896
value_result try_insert_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5850
void close_map(const map_handle &)
Close a key-value map (aka table) handle. Normally unnecessary.
Definition mdbx.h++:5447
MDBX_CXX11_CONSTEXPR byte at(size_t n) const
Returns the nth byte in the referenced data with bounds checking.
Definition mdbx.h++:4932
env & set_sync_threshold(size_t bytes)
Sets threshold to force flush the data buffers to disk, for non-sync durability modes.
Definition mdbx.h++:5378
move_result(const cursor &cursor, bool throw_notfound)
Definition mdbx.h++:6072
MDBX_CXX11_CONSTEXPR const version_info & get_version() noexcept
Returns libmdbx version information.
Definition mdbx.h++:4595
ptrdiff_t estimate_from_first(map_handle map, const slice &to) const
Definition mdbx.h++:6006
void remove_suffix(size_t n) noexcept
Drops the last "n" bytes from this slice.
Definition mdbx.h++:4900
slice & assign(const void *ptr, size_t bytes)
Definition mdbx.h++:4793
env & operator=(env &&other) noexcept
Definition mdbx.h++:5137
void unbind()
Unbind cursor from a transaction.
Definition mdbx.h++:6176
MDBX_CXX11_CONSTEXPR const void * end() const noexcept
Return a pointer to the ending of the referenced data.
Definition mdbx.h++:4855
::std::chrono::duration< unsigned, ::std::ratio< 1, 65536 > > duration
Duration in 1/65536 units of second.
Definition mdbx.h++:422
slice insert_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5843
string< ALLOCATOR > 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.
Definition mdbx.h++:5016
void rename_map(map_handle map, const char *new_name)
Переименовывает таблицу ключ-значение.
Definition mdbx.h++:5667
void throw_on_failure() const
Definition mdbx.h++:4700
bool try_update(const slice &key, const slice &value)
Definition mdbx.h++:6251
void update(const slice &key, const slice &value)
Definition mdbx.h++:6247
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 table).
Definition mdbx.h++:5742
MDBX_CXX11_CONSTEXPR MDBX_error_t code() const noexcept
Returns error code.
Definition mdbx.h++:4688
txn & set_context(void *your_context)
Sets the application context associated with the transaction.
Definition mdbx.h++:5552
txn_managed start_write(txn &parent)
Starts write (read-write) transaction.
Definition mdbx.h++:5513
int compare_position_nothrow(const cursor &left, const cursor &right, bool ignore_nested=false) noexcept
Definition mdbx.h++:6059
env::durability get_durability() const
Returns current durability mode.
Definition mdbx.h++:5311
uint64_t sequence(map_handle map) const
Reads sequence generator associated with a key-value map (aka table).
Definition mdbx.h++:5730
void upsert(const slice &key, const slice &value)
Definition mdbx.h++:6237
MDBX_CXX11_CONSTEXPR const byte * byte_ptr() const noexcept
Returns casted to pointer to byte an address of data.
Definition mdbx.h++:4835
MDBX_CXX11_CONSTEXPR bool is_mdbx_error() const noexcept
Returns true for MDBX's errors.
Definition mdbx.h++:4690
bool is_clean() const noexcept
Definition mdbx.h++:4653
string< ALLOCATOR > as_base58_string(unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a string with a Base58 dump of the slice content.
Definition mdbx.h++:5021
MDBX_CXX11_CONSTEXPR const char * end_char_ptr() const noexcept
Returns casted to pointer to char an end of data.
Definition mdbx.h++:4847
MDBX_CXX01_CONSTEXPR_ENUM bool is_reverse(key_mode mode) noexcept
Definition mdbx.h++:2884
static bool boolean_or_throw(int error_code)
Definition mdbx.h++:4743
MDBX_CXX14_CONSTEXPR slice safe_tail(size_t n) const
Returns the last "n" bytes of the slice.
Definition mdbx.h++:4959
void swap(slice &other) noexcept
Definition mdbx.h++:4829
env::operate_parameters get_operation_parameters() const
Returns current operation parameters.
Definition mdbx.h++:5301
MDBX_CXX01_CONSTEXPR_ENUM bool is_msgpack(key_mode mode) noexcept
Definition mdbx.h++:2888
::std::basic_string< char, ::std::char_traits< char >, ALLOCATOR > string
Default single-byte string.
Definition mdbx.h++:378
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR bool starts_with(const slice &prefix) const noexcept
Checks if the data starts with the given prefix.
Definition mdbx.h++:4911
MDBX_env_flags_t get_flags() const
Returns environment flags.
Definition mdbx.h++:5353
static size_t dbsize_min(intptr_t pagesize)
Returns the minimal database size in bytes for specified page size.
Definition mdbx.h++:5186
MDBX_CXX11_CONSTEXPR slice() noexcept
Create an empty slice.
Definition mdbx.h++:4777
static MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR intptr_t compare_fast(const slice &a, const slice &b) noexcept
Three-way fast non-lexicographically length-based comparison.
Definition mdbx.h++:4973
MDBX_CXX11_CONSTEXPR size_t size() const noexcept
Returns the number of bytes.
Definition mdbx.h++:4877
void insert(const slice &key, slice value)
Definition mdbx.h++:6198
MDBX_CXX11_CONSTEXPR 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
Definition mdbx.h++:5450
move_result lower_bound_multivalue(const slice &key, const slice &value, bool throw_notfound=false)
Definition mdbx.h++:6132
::std::pmr::string::allocator_type polymorphic_allocator
Default polymorphic allocator for modern code.
Definition mdbx.h++:357
MDBX_CXX14_CONSTEXPR slice safe_head(size_t n) const
Returns the first "n" bytes of the slice.
Definition mdbx.h++:4953
MDBX_CXX01_CONSTEXPR_ENUM bool is_usual(key_mode mode) noexcept
Definition mdbx.h++:2872
MDBX_hsr_func * get_HandleSlowReaders() const noexcept
Returns the current Handle-Slow-Readers callback used to resolve database full/overflow issue due to ...
Definition mdbx.h++:5490
cursor_managed clone(void *your_context=nullptr) const
Definition mdbx.h++:6022
~cursor() noexcept
Definition mdbx.h++:6043
~txn() noexcept
Definition mdbx.h++:5534
size_t sync_threshold() const
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes.
Definition mdbx.h++:5383
MDBX_CXX11_CONSTEXPR bool is_null() const noexcept
Checks whether the slice data pointer is nullptr.
Definition mdbx.h++:4875
move_result upper_bound(const slice &key, bool throw_notfound=false)
Definition mdbx.h++:6124
inline ::mdbx::txn txn() const
Returns the cursor's transaction.
Definition mdbx.h++:6178
MDBX_CXX11_CONSTEXPR const void * data() const noexcept
Return a pointer to the beginning of the referenced data.
Definition mdbx.h++:4853
value_result try_insert_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6223
static env::operate_options options_from_flags(MDBX_env_flags_t flags) noexcept
Definition mdbx.h++:5178
map_handle map() const
Definition mdbx.h++:6183
unsigned sync_period__seconds_16dot16() const
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h++:5394
MDBX_CXX11_CONSTEXPR info(map_handle::flags flags, map_handle::state state) noexcept
Definition mdbx.h++:5122
MDBX_CXX11_CONSTEXPR_ENUM mdbx::value_mode value_mode() const noexcept
Definition mdbx.h++:5129
move_result find(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:6116
move_result upper_bound_multivalue(const slice &key, const slice &value, bool throw_notfound=false)
Definition mdbx.h++:6136
MDBX_CXX01_CONSTEXPR_ENUM bool is_multi(value_mode mode) noexcept
Definition mdbx.h++:2952
MDBX_NOTHROW_PURE_FUNCTION bool is_base64(bool ignore_spaces=false) const noexcept
Checks whether the content of the slice is a Base64 dump.
Definition mdbx.h++:5069
void success_or_throw() const
Definition mdbx.h++:4705
buffer< ALLOCATOR, CAPACITY_POLICY > encode_base64(unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a buffer with a Base64 dump of the slice content.
Definition mdbx.h++:5042
void renew_reading()
Renew read-only transaction.
Definition mdbx.h++:5587
buffer< ALLOCATOR, CAPACITY_POLICY > base64_decode(bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes Base64 dump from the slice content to returned buffer.
Definition mdbx.h++:5057
bool sync_to_disk(bool force=true, bool nonblock=false)
Flush the environment data buffers.
Definition mdbx.h++:5434
MDBX_CXX11_CONSTEXPR env(MDBX_env *ptr) noexcept
Definition mdbx.h++:5135
int compare_position(const cursor &left, const cursor &right, bool ignore_nested=false)
Definition mdbx.h++:6063
static MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR intptr_t compare_lexicographically(const pair &a, const pair &b) noexcept
Three-way lexicographically comparison.
Definition mdbx.h++:5080
size_t count_multivalue() const
Return count of duplicates for current key.
Definition mdbx.h++:6142
static size_t pagesize_max() noexcept
Returns the maximal database page size in bytes.
Definition mdbx.h++:5184
MDBX_CXX11_CONSTEXPR error(MDBX_error_t error_code) noexcept
Definition mdbx.h++:4667
bool is_dirty(const void *ptr) const
Checks whether the given data is on a dirty page.
Definition mdbx.h++:5557
slice upsert_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6241
env::mode get_mode() const
Returns current operation mode.
Definition mdbx.h++:5309
MDBX_NOTHROW_PURE_FUNCTION bool is_hex(bool ignore_spaces=false) const noexcept
Checks whether the content of the slice is a hexadecimal dump.
Definition mdbx.h++:5061
MDBX_CXX01_CONSTEXPR_ENUM bool is_samelength(key_mode mode) noexcept
Definition mdbx.h++:2880
void capture() noexcept
Definition mdbx.h++:4655
inline ::mdbx::env env() const noexcept
Returns the transaction's environment.
Definition mdbx.h++:5569
uint32_t get_tree_deepmask(map_handle map) const
Returns depth (bitmask) information of nested dupsort (multi-value) B+trees for given table.
Definition mdbx.h++:5707
bool try_update(map_handle map, const slice &key, const slice &value)
Definition mdbx.h++:5878
void safe_remove_prefix(size_t n)
Drops the first "n" bytes from this slice.
Definition mdbx.h++:4894
comparator default_comparator(key_mode mode) noexcept
Definition mdbx.h++:2999
MDBX_NOTHROW_PURE_FUNCTION bool is_base58(bool ignore_spaces=false) const noexcept
Checks whether the content of the slice is a Base58 dump.
Definition mdbx.h++:5065
slice insert_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6216
static size_t 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 table flags.
Definition mdbx.h++:5248
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,...
Definition mdbx.h++:5389
ptrdiff_t estimate(map_handle map, const pair &from, const pair &to) const
Definition mdbx.h++:5994
MDBX_CXX14_CONSTEXPR slice tail(size_t n) const noexcept
Returns the last "n" bytes of the slice.
Definition mdbx.h++:4943
env::reclaiming_options get_reclaiming() const
Returns current reclaiming options.
Definition mdbx.h++:5315
void drop_map(map_handle map)
Drops key-value map using handle.
Definition mdbx.h++:5663
ptrdiff_t estimate_to_last(map_handle map, const slice &from) const
Definition mdbx.h++:6012
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 preser...
Definition mdbx.h++:5970
MDBX_CXX11_CONSTEXPR bool empty() const noexcept
Checks whether the slice is empty.
Definition mdbx.h++:4873
env::operate_options get_options() const
Returns current operate options.
Definition mdbx.h++:5319
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.
Definition mdbx.h++:5940
void park_reading(bool autounpark=true)
Park read-only transaction.
Definition mdbx.h++:5589
cursor & set_context(void *your_context)
Sets the application context associated with the cursor.
Definition mdbx.h++:6030
map_stat get_map_stat(map_handle map) const
Returns statistics for a table.
Definition mdbx.h++:5701
bool move(move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const
Definition mdbx.h++:6082
static size_t value_min(MDBX_db_flags_t flags) noexcept
Returns the minimal values size in bytes for specified table flags.
Definition mdbx.h++:5224
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 table).
Definition mdbx.h++:5746
static env::reclaiming_options reclaiming_from_flags(MDBX_env_flags_t flags) noexcept
Definition mdbx.h++:5174
buffer< ALLOCATOR, CAPACITY_POLICY > 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.
Definition mdbx.h++:5031
cursor & operator=(cursor &&other) noexcept
Definition mdbx.h++:6035
txn & put_canary(const canary &)
Set integers markers (aka "canary") associated with the environment.
Definition mdbx.h++:5719
slice upsert_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5868
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR bool operator<(const slice &a, const slice &b) noexcept
Definition mdbx.h++:4995
buffer< ALLOCATOR, CAPACITY_POLICY > hex_decode(bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes hexadecimal dump from the slice content to returned buffer.
Definition mdbx.h++:5047
MDBX_CXX14_CONSTEXPR slice head(size_t n) const noexcept
Returns the first "n" bytes of the slice.
Definition mdbx.h++:4938
string to_string(const ::mdbx::slice &value)
Definition mdbx.h++:6334
env & set_sync_period__seconds_double(double seconds)
Sets relative period since the last unsteady commit to force flush the data buffers to disk,...
Definition mdbx.h++:5400
bool on_first() const
Definition mdbx.h++:6150
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR size_t hash_value() const noexcept
Returns the hash value of referenced data.
Definition mdbx.h++:4920
::MDBX_version_info version_info
libmdbx version information,
Definition mdbx.h++:334
bool eof() const
Definition mdbx.h++:6148
void make_broken()
Marks transaction as broken to prevent further operations.
Definition mdbx.h++:5585
MDBX_txn_flags_t flags() const
Returns transaction's flags.
Definition mdbx.h++:5571
void * get_context() const noexcept
Returns the application context associated with the environment.
Definition mdbx.h++:5371
MDBX_error_t put(const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
Definition mdbx.h++:6190
map_handle open_map_accede(const char *name) const
Open existing key-value map.
Definition mdbx.h++:5638
txn_managed prepare_read() const
Creates but not start read transaction.
Definition mdbx.h++:5499
::MDBX_build_info build_info
libmdbx build information
Definition mdbx.h++:338
void safe_remove_suffix(size_t n)
Drops the last "n" bytes from this slice.
Definition mdbx.h++:4905
bool seek(const slice &key)
Definition mdbx.h++:6140
env & alter_flags(MDBX_env_flags_t flags, bool on_off)
Alter environment flags.
Definition mdbx.h++:5423
env & set_context(void *your_context)
Sets the application context associated with the environment.
Definition mdbx.h++:5373
static size_t transaction_size_max(intptr_t pagesize)
Returns the maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes fo...
Definition mdbx.h++:5292
MDBX_CXX11_CONSTEXPR size_t length() const noexcept
Returns the number of bytes.
Definition mdbx.h++:4861
void clear_map(map_handle map)
Clear key-value map.
Definition mdbx.h++:5665
env & set_extra_option(extra_runtime_option option, uint64_t value)
Sets the value of a extra runtime options for an environment.
Definition mdbx.h++:5412
void remove_prefix(size_t n) noexcept
Drops the first "n" bytes from this slice.
Definition mdbx.h++:4888
MDBX_CXX11_CONSTEXPR bool is_result_true() const noexcept
Definition mdbx.h++:4680
MDBX_CXX11_CONSTEXPR bool operator==(const error &a, const error &b) noexcept
Definition mdbx.h++:4674
value_result try_insert(const slice &key, slice value)
Definition mdbx.h++:6203
size_t put_multiple_samelength(const slice &key, const size_t value_length, const void *values_array, size_t values_count, put_mode mode, bool allow_partial=false)
Definition mdbx.h++:6304
static void throw_on_nullptr(const void *ptr, MDBX_error_t error_code)
Definition mdbx.h++:4728
string< ALLOCATOR > as_base64_string(unsigned wrap_width=0, const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a string with a Base58 dump of the slice content.
Definition mdbx.h++:5026
::MDBX_cmp_func * comparator
Definition mdbx.h++:2998
put_mode
Key-value pairs put mode.
Definition mdbx.h++:3007
double sync_period__seconds_double() const
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h++:5404
::mdbx_filehandle_t filehandle
Definition mdbx.h++:380
MDBX_CXX14_CONSTEXPR slice & set_end(const void *ptr)
Sets the length by specifying the end of the slice data.
Definition mdbx.h++:4868
static MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR intptr_t compare_fast(const pair &a, const pair &b) noexcept
Three-way fast non-lexicographically length-based comparison.
Definition mdbx.h++:5075
static size_t valsize4page_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns maximal data size in bytes to fit in a leaf-page or single large/overflow-page for specified ...
Definition mdbx.h++:5270
MDBX_CXX11_CONSTEXPR cursor(MDBX_cursor *ptr) noexcept
Definition mdbx.h++:6020
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR bool operator<=(const slice &a, const slice &b) noexcept
Definition mdbx.h++:5003
char8_t byte
Definition mdbx.h++:318
canary get_canary() const
Returns fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h++:5724
txn & operator=(txn &&other) noexcept
Definition mdbx.h++:5526
bool erase(bool whole_multivalue=false)
Removes single key-value pair or all multi-values at the current cursor position.
Definition mdbx.h++:6282
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())
Definition mdbx.h++:5961
stat get_stat() const
Returns snapshot statistics about the MDBX environment.
Definition mdbx.h++:5323
uint64_t id() const
Return the transaction's ID.
Definition mdbx.h++:5577
value_result try_insert(map_handle map, const slice &key, slice value)
Definition mdbx.h++:5830
::std::string::allocator_type legacy_allocator
Legacy allocator but it is recommended to use polymorphic_allocator.
Definition mdbx.h++:352
MDBX_CXX11_CONSTEXPR const byte * end_byte_ptr() const noexcept
Returns casted to pointer to byte an end of data.
Definition mdbx.h++:4839
ptrdiff_t estimate(const cursor &from, const cursor &to)
Definition mdbx.h++:6110
slice update_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5890
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR bool ends_with(const slice &suffix) const noexcept
Checks if the data ends with the given suffix.
Definition mdbx.h++:4915
MDBX_CXX14_CONSTEXPR slice & set_length(size_t bytes)
Set slice length.
Definition mdbx.h++:4863
~env() noexcept
Definition mdbx.h++:5145
loop_control
Loop control constants for readers enumeration functor and other cases.
Definition mdbx.h++:2853
slice get(map_handle map, const slice &key) const
Get value by key from a key-value map (aka table).
Definition mdbx.h++:5758
size_t put_multiple_samelength(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)
Definition mdbx.h++:5975
void update(map_handle map, const slice &key, const slice &value)
Definition mdbx.h++:5874
key_mode
Kinds of the keys and corresponding modes of comparing it.
Definition mdbx.h++:2856
txn_managed start_read() const
Starts read (read-only) transaction.
Definition mdbx.h++:5492
::mdbx::filesystem::path path
Definition mdbx.h++:404
bool on_last_multival() const
Definition mdbx.h++:6156
unsigned max_maps() const
Returns the maximum number of named tables for the environment.
Definition mdbx.h++:5365
void insert(map_handle map, const slice &key, slice value)
Definition mdbx.h++:5825
unsigned max_readers() const
Returns the maximum number of threads/reader slots for the environment.
Definition mdbx.h++:5359
static size_t key_max(intptr_t pagesize, MDBX_db_flags_t flags)
Returns the maximal key size in bytes for specified page size and table flags.
Definition mdbx.h++:5204
int enumerate_readers(VISITOR &visitor)
Enumerate readers.
Definition mdbx.h++:5455
void * get_context() const noexcept
Returns the application context associated with the cursor.
Definition mdbx.h++:6028
static size_t max_map_handles(void)
Returns the maximum opened map handles, aka DBI-handles.
Definition mdbx.h++:5299
cursor_managed open_cursor(map_handle map) const
Opens cursor for specified key-value map handle.
Definition mdbx.h++:5601
MDBX_CXX01_CONSTEXPR_ENUM bool is_ordinal(key_mode mode) noexcept
Definition mdbx.h++:2876
bool unpark_reading(bool restart_if_ousted=true)
Resume parked read-only transaction.
Definition mdbx.h++:5591
uint64_t extra_option(extra_runtime_option option) const
Gets the value of extra runtime options from an environment.
Definition mdbx.h++:5417
bool on_first_multival() const
Definition mdbx.h++:6154
MDBX_error_t put(map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
Definition mdbx.h++:5817
void panic_on_failure(const char *context_where, const char *func_who) const noexcept
Definition mdbx.h++:4718
info get_info() const
Return snapshot information about the MDBX environment.
Definition mdbx.h++:5335
void upsert(map_handle map, const slice &key, const slice &value)
Definition mdbx.h++:5864
static size_t pagesize_min() noexcept
Returns the minimal database page size in bytes.
Definition mdbx.h++:5182
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR bool operator>(const slice &a, const slice &b) noexcept
Definition mdbx.h++:4999
slice update_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6263
move_result lower_bound(const slice &key, bool throw_notfound=false)
Definition mdbx.h++:6120
MDBX_CXX14_CONSTEXPR slice middle(size_t from, size_t n) const noexcept
Returns the middle "n" bytes of the slice.
Definition mdbx.h++:4948
MDBX_CXX11_CONSTEXPR bool operator!=(const error &a, const error &b) noexcept
Definition mdbx.h++:4676
unsigned check_readers()
Checks for stale readers in the lock table and return number of cleared slots.
Definition mdbx.h++:5478
bool erase(map_handle map, const slice &key)
Removes all values for given key.
Definition mdbx.h++:5909
MDBX_CXX14_CONSTEXPR slice safe_middle(size_t from, size_t n) const
Returns the middle "n" bytes of the slice.
Definition mdbx.h++:4965
bool on_last() const
Definition mdbx.h++:6152
MDBX_CXX11_CONSTEXPR const char * char_ptr() const noexcept
Returns casted to pointer to char an address of data.
Definition mdbx.h++:4845
#define MDBX_STD_FILESYSTEM_PATH
Defined if mdbx::filesystem::path is available.
Definition mdbx.h++:400
static MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR intptr_t compare_lexicographically(const slice &a, const slice &b) noexcept
Three-way lexicographically comparison.
Definition mdbx.h++:4980
buffer< ALLOCATOR, CAPACITY_POLICY > base58_decode(bool ignore_spaces=false, const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes Base58 dump from the slice content to returned buffer.
Definition mdbx.h++:5052
filehandle get_filehandle() const
Returns the file descriptor for the DXB file of MDBX environment.
Definition mdbx.h++:5347
env & set_geometry(const geometry &size)
Set all size-related parameters of environment.
Definition mdbx.h++:5428
map_handle::info get_handle_info(map_handle map) const
Returns information about key-value map (aka table) handle.
Definition mdbx.h++:5713
void bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle)
Bind/renew a cursor with a new transaction and specified key-value map handle.
Definition mdbx.h++:6172
geometry & make_fixed(intptr_t size) noexcept
Definition mdbx.h++:5161
size_t release_all_cursors(bool unbind) const
Unbind or close all cursors.
Definition mdbx.h++:5607
MDBX_CXX11_CONSTEXPR bool is_failure() const noexcept
Definition mdbx.h++:4684
MDBX_CXX11_CONSTEXPR const build_info & get_build() noexcept
Returns libmdbx build information.
Definition mdbx.h++:4596
value_result try_update_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6269
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.
Definition mdbx.h++:5622
buffer< default_allocator, default_capacity_policy > default_buffer
Default buffer.
Definition mdbx.h++:374
txn_managed try_start_write()
Tries to start write (read-write) transaction without blocking.
Definition mdbx.h++:5520
MDBX_CXX11_CONSTEXPR bool is_result_false() const noexcept
Definition mdbx.h++:4682
info get_info(bool scan_reader_lock_table=false) const
Returns information about the MDBX transaction.
Definition mdbx.h++:5595
pair_result get_equal_or_great(map_handle map, const slice &key) const
Get value for equal or great key from a table.
Definition mdbx.h++:5796
MDBX_NOTHROW_PURE_FUNCTION MDBX_CXX14_CONSTEXPR bool operator>=(const slice &a, const slice &b) noexcept
Definition mdbx.h++:5007
@ multi_reverse_samelength
Definition mdbx.h++:2924
@ multi_samelength
Definition mdbx.h++:2909
@ multi_ordinal
Definition mdbx.h++:2916
@ msgpack
Definition mdbx.h++:2939
@ single
Definition mdbx.h++:2892
@ multi
Definition mdbx.h++:2894
@ multi_reverse
Definition mdbx.h++:2901
@ upsert
Insert or update.
Definition mdbx.h++:3009
@ update
Update existing, don't insert new.
Definition mdbx.h++:3010
@ insert_unique
Insert only unique keys.
Definition mdbx.h++:3008
@ continue_loop
Definition mdbx.h++:2853
@ exit_loop
Definition mdbx.h++:2853
@ usual
Definition mdbx.h++:2857
@ ordinal
Definition mdbx.h++:2862
@ reverse
Definition mdbx.h++:2859
@ msgpack
Definition mdbx.h++:2867
A handle for an individual table (aka key-value space, maps or sub-database) in the environment.
Definition mdbx.h++:2976
MDBX_CXX11_CONSTEXPR size_t envisage_result_length() const noexcept
Returns the buffer size in bytes needed for Base58 dump of passed slice.
Definition mdbx.h++:1270
MDBX_CXX11_CONSTEXPR bool is_valid() const noexcept
Checks the slice is not refers to null address or has zero length.
Definition mdbx.h++:1002
MDBX_CXX14_CONSTEXPR ::std::span< const char > chars() const
Definition mdbx.h++:699
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes Base58 dump from a passed slice to returned buffer.
Definition mdbx.h++:1401
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a buffer with a hexadecimal dump of a passed slice.
Definition mdbx.h++:1216
constexpr slice(const ::std::basic_string< CHAR, T, A > &str)
Create a slice that refers to the contents of "str".
Definition mdbx.h++:665
const slice source
Definition mdbx.h++:1293
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid Base58 dump, and therefore there could be dec...
slice & assign(::std::basic_string_view< CHAR, T > &&view)
Definition mdbx.h++:733
MDBX_CXX11_CONSTEXPR slice(const slice &) noexcept=default
int8_t as_int8_adapt() const
MDBX_NOTHROW_PURE_FUNCTION constexpr bool is_reference() const noexcept
Definition mdbx.h++:2826
static MDBX_CXX11_CONSTEXPR size_t advise(const size_t current, const size_t wanna)
Definition mdbx.h++:1180
buffer< ALLOCATOR, CAPACITY_POLICY > buffer_type
Definition mdbx.h++:2775
@ max_length
Definition mdbx.h++:644
MDBX_NOTHROW_PURE_FUNCTION constexpr bool is_freestanding() const noexcept
Definition mdbx.h++:2821
slice & operator=(::std::basic_string_view< CHAR, T > &&view)
Definition mdbx.h++:751
MDBX_CXX14_CONSTEXPR ::std::span< const POD > as_span() const
Definition mdbx.h++:679
buffer_pair_spec(buffer_pair_spec &&pair) noexcept(buffer_type::move_assign_alloc::is_nothrow())
Definition mdbx.h++:2816
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a buffer with a Base58 dump of a passed slice.
Definition mdbx.h++:1264
const bool ignore_spaces
Definition mdbx.h++:1385
MDBX_NOTHROW_PURE_FUNCTION bool is_printable(bool disable_utf8=false) const noexcept
Checks whether the content of the slice is printable.
void swap(::std::basic_string_view< CHAR, T > &view) noexcept
Definition mdbx.h++:858
MDBX_CXX14_CONSTEXPR uint8_t as_uint8() const
Definition mdbx.h++:1025
value_result & operator=(const value_result &) noexcept=default
MDBX_CXX11_CONSTEXPR to_base58(const slice &source, unsigned wrap_width=0) noexcept
Definition mdbx.h++:1250
buffer_type value
Definition mdbx.h++:2780
MDBX_CXX14_CONSTEXPR uint64_t as_uint64() const
Definition mdbx.h++:1022
int128_t as_int128_adapt() const
char * write_bytes(char *dest, size_t dest_size) const
Fills the destination with data decoded from Base64 dump from a passed slice.
string< ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes Base58 dump from a passed slice to returned string.
Definition mdbx.h++:1394
string< ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes Base64 dump from a passed slice to returned string.
Definition mdbx.h++:1437
slice value
Definition mdbx.h++:2719
::std::ostream & output(::std::ostream &out) const
Output Base64 dump of passed slice to the std::ostream.
MDBX_CXX11_CONSTEXPR pair_result(const slice &key, const slice &value, bool done) noexcept
Definition mdbx.h++:2764
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1237
static MDBX_CXX14_CONSTEXPR slice wrap(const char(&text)[SIZE])
Definition mdbx.h++:711
MDBX_CXX14_CONSTEXPR slice(const ::std::span< POD > &span)
Definition mdbx.h++:674
buffer_pair_spec(const slice &key, const slice &value, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2797
slice value
Definition mdbx.h++:2733
::std::pair< buffer_type, buffer_type > stl_pair
Definition mdbx.h++:2779
::std::ostream & output(::std::ostream &out) const
Output hexadecimal dump of passed slice to the std::ostream.
pair_result(const pair_result &) noexcept=default
MDBX_CXX11_CONSTEXPR slice(size_t invalid_length) noexcept
Definition mdbx.h++:1052
const slice source
Definition mdbx.h++:1384
const slice source
Definition mdbx.h++:1200
const unsigned wrap_width
Definition mdbx.h++:1202
buffer_pair_spec(const txn &txn, const pair &pair, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2811
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes hexadecimal dump from a passed slice to returned buffer.
Definition mdbx.h++:1361
slice & assign(const ::std::basic_string< CHAR, T, ALLOCATOR > &str)
Definition mdbx.h++:725
const bool ignore_spaces
Definition mdbx.h++:1347
char * write_bytes(char *dest, size_t dest_size) const
Fills the destination with data decoded from Base58 dump from a passed slice.
pair & operator=(const pair &) noexcept=default
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1459
uint16_t as_uint16_adapt() const
static MDBX_CXX14_CONSTEXPR slice invalid() noexcept
Build an invalid slice which non-zero length and refers to null address.
Definition mdbx.h++:1005
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a buffer with a Base64 dump of a passed slice.
Definition mdbx.h++:1310
buffer_pair_spec(const slice &key, const slice &value, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2799
slice & operator=(const ::std::basic_string_view< CHAR, T > &view)
Definition mdbx.h++:747
std::pair< slice, slice > stl_pair
Definition mdbx.h++:2732
value_result(const value_result &) noexcept=default
MDBX_CXX11_CONSTEXPR pair_result() noexcept
Definition mdbx.h++:2763
@ pettiness_threshold
Definition mdbx.h++:1168
@ extra_inplace_storage
Definition mdbx.h++:1166
@ max_reserve
Definition mdbx.h++:1169
@ inplace_storage_size_rounding
Definition mdbx.h++:1167
string< ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a string with a hexadecimal dump of a passed slice.
Definition mdbx.h++:1210
buffer_pair_spec(const stl_pair &pair, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2794
MDBX_CXX14_CONSTEXPR ::std::span< const byte > bytes() const
Definition mdbx.h++:697
buffer_type key
Definition mdbx.h++:2780
MDBX_CXX14_CONSTEXPR int16_t as_int16() const
Definition mdbx.h++:1032
MDBX_CXX14_CONSTEXPR ::std::span< char > chars()
Definition mdbx.h++:700
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1284
value_result(const slice &value, bool done) noexcept
Definition mdbx.h++:2721
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1417
const slice source
Definition mdbx.h++:1247
MDBX_CXX11_CONSTEXPR pair(const stl_pair &couple) noexcept
Definition mdbx.h++:2735
MDBX_CXX14_CONSTEXPR ::std::span< byte > bytes()
Definition mdbx.h++:698
MDBX_CXX14_CONSTEXPR ::std::span< POD > as_span()
Definition mdbx.h++:688
MDBX_CXX11_CONSTEXPR from_hex(const slice &source, bool ignore_spaces=false) noexcept
Definition mdbx.h++:1348
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not...
Definition mdbx.h++:1241
uint8_t as_uint8_adapt() const
string< ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes hexadecimal dump from a passed slice to returned string.
Definition mdbx.h++:1355
buffer_pair_spec(const txn &txn, const slice &key, const slice &value, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2808
slice & assign(const ::std::basic_string_view< CHAR, T > &view)
Definition mdbx.h++:730
MDBX_CXX14_CONSTEXPR uint128_t as_uint128() const
Definition mdbx.h++:1020
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1374
int32_t as_int32_adapt() const
MDBX_CXX11_CONSTEXPR size_t envisage_result_length() const noexcept
Returns the buffer size in bytes needed for hexadecimal dump of a passed slice.
Definition mdbx.h++:1222
string< ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a string with a Base64 dump of a passed slice.
Definition mdbx.h++:1303
MDBX_CXX11_CONSTEXPR size_t envisage_result_length() const noexcept
Returns the number of bytes needed for conversion Base58 dump from a passed slice to decoded data.
Definition mdbx.h++:1407
buffer_pair_spec(const buffer_type &key, const buffer_type &value, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2786
MDBX_CXX11_CONSTEXPR to_hex(const slice &source, bool uppercase=false, unsigned wrap_width=0) noexcept
Definition mdbx.h++:1203
char * write_bytes(char *dest, size_t dest_size) const
Fills the buffer by hexadecimal dump of a passed slice.
MDBX_CXX11_CONSTEXPR to_base64(const slice &source, unsigned wrap_width=0) noexcept
Definition mdbx.h++:1296
MDBX_CXX11_CONSTEXPR ::std::basic_string_view< CHAR, T > string_view() const noexcept
Return a string_view that references the same data as this slice.
Definition mdbx.h++:755
MDBX_CXX14_CONSTEXPR uint32_t as_uint32() const
Definition mdbx.h++:1023
bool done
Definition mdbx.h++:2762
::std::ostream & output(::std::ostream &out) const
Output Base58 dump of passed slice to the std::ostream.
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not...
Definition mdbx.h++:1287
buffer_pair_spec(const pair &pair, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2805
MDBX_CXX14_CONSTEXPR int8_t as_int8() const
Definition mdbx.h++:1033
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &allocator=ALLOCATOR()) const
Decodes Base64 dump from a passed slice to returned buffer.
Definition mdbx.h++:1444
MDBX_CXX11_CONSTEXPR size_t envisage_result_length() const noexcept
Returns the number of bytes needed for conversion Base64 dump from a passed slice to decoded data.
Definition mdbx.h++:1450
const bool uppercase
Definition mdbx.h++:1201
static MDBX_CXX11_CONSTEXPR size_t round(const size_t value)
Definition mdbx.h++:1172
MDBX_CXX14_CONSTEXPR int64_t as_int64() const
Definition mdbx.h++:1030
void make_freestanding()
Definition mdbx.h++:2832
const bool ignore_spaces
Definition mdbx.h++:1428
pair(const pair &) noexcept=default
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid Base64 dump, and therefore there could be dec...
slice & operator=(const slice &) noexcept=default
uint128_t as_uint128_adapt() const
slice key
Definition mdbx.h++:2733
const slice source
Definition mdbx.h++:1427
pair_result & operator=(const pair_result &) noexcept=default
string< ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Returns a string with a Base58 dump of a passed slice.
Definition mdbx.h++:1257
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1333
MDBX_CXX14_CONSTEXPR int32_t as_int32() const
Definition mdbx.h++:1031
typename buffer_type::allocator_traits allocator_traits
Definition mdbx.h++:2777
char * write_bytes(char *dest, size_t dest_size) const
Fills the destination with data decoded from hexadecimal dump from a passed slice.
MDBX_CXX11_CONSTEXPR size_t envisage_result_length() const noexcept
Returns the number of bytes needed for conversion hexadecimal dump from a passed slice to decoded dat...
Definition mdbx.h++:1367
MDBX_CXX14_CONSTEXPR POD as_pod() const
Definition mdbx.h++:1007
static MDBX_CXX14_CONSTEXPR pair invalid() noexcept
Definition mdbx.h++:2743
int64_t as_int64_adapt() const
buffer_pair_spec(const stl_pair &pair, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2792
constexpr ::std::basic_string< CHAR, T, ALLOCATOR > as_string(const ALLOCATOR &allocator=ALLOCATOR()) const
Definition mdbx.h++:769
MDBX_CXX11_CONSTEXPR pair(const slice &key, const slice &value) noexcept
Definition mdbx.h++:2734
CAPACITY_POLICY reservation_policy
Definition mdbx.h++:2778
MDBX_CXX14_CONSTEXPR slice(const ::std::basic_string_view< CHAR, T > &sv)
Create a slice that refers to the same contents as "string_view".
Definition mdbx.h++:706
MDBX_CXX14_CONSTEXPR uint16_t as_uint16() const
Definition mdbx.h++:1024
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid hexadecimal dump, and therefore there could b...
MDBX_CXX11_CONSTEXPR from_base64(const slice &source, bool ignore_spaces=false) noexcept
Definition mdbx.h++:1429
const unsigned wrap_width
Definition mdbx.h++:1248
MDBX_CXX11_CONSTEXPR from_base58(const slice &source, bool ignore_spaces=false) noexcept
Definition mdbx.h++:1386
const unsigned wrap_width
Definition mdbx.h++:1294
uint32_t as_uint32_adapt() const
buffer_pair_spec(const pair &pair, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2803
char * write_bytes(char *dest, size_t dest_size) const
Fills the buffer by Base64 dump of passed slice.
buffer_pair_spec(buffer_type &&key, buffer_type &&value) noexcept(buffer_type::move_assign_alloc::is_nothrow())
Definition mdbx.h++:2814
static MDBX_CXX14_CONSTEXPR slice wrap(const POD &pod)
Definition mdbx.h++:713
MDBX_CXX11_CONSTEXPR size_t envisage_result_length() const noexcept
Returns the buffer size in bytes needed for Base64 dump of passed slice.
Definition mdbx.h++:1316
int16_t as_int16_adapt() const
MDBX_CXX14_CONSTEXPR int128_t as_int128() const
Definition mdbx.h++:1028
typename buffer_type::allocator_type allocator_type
Definition mdbx.h++:2776
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid data and could be encoded or unexpectedly not...
Definition mdbx.h++:1337
uint64_t as_uint64_adapt() const
constexpr buffer_pair_spec() noexcept=default
buffer_pair_spec(const buffer_type &key, const buffer_type &value, bool make_reference, const allocator_type &allocator=allocator_type())
Definition mdbx.h++:2788
slice(::std::basic_string_view< CHAR, T > &&sv)
Definition mdbx.h++:708
bool done
Definition mdbx.h++:2720
char * write_bytes(char *dest, size_t dest_size) const
Fills the buffer by Base58 dump of passed slice.
const slice source
Definition mdbx.h++:1346
buffer< ALLOCATOR, CAPACITY_POLICY > make_buffer(PRODUCER &producer, const ALLOCATOR &allocator=ALLOCATOR())
Definition mdbx.h++:2668
buffer_pair< default_buffer > default_buffer_pair
Default pair of buffers.
Definition mdbx.h++:2845
inline ::std::ostream & operator<<(::std::ostream &out, const to_hex &wrapper)
Definition mdbx.h++:1340
string< ALLOCATOR > make_string(PRODUCER &producer, const ALLOCATOR &allocator=ALLOCATOR())
Definition mdbx.h++:2690
buffer_pair_spec< typename BUFFER::allocator_type, typename BUFFER::reservation_policy > buffer_pair
Combines pair of buffers for key and value to hold an operands for certain operations.
Definition mdbx.h++:2842
Base58 decoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1383
Base64 decoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1426
Hexadecimal decoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1345
Combines pair of slices for key and value to represent result of certain operations.
Definition mdbx.h++:2731
Combines pair of slices for key and value with boolean flag to represent result of certain operations...
Definition mdbx.h++:2761
References a data located outside the slice.
Definition mdbx.h++:639
Base58 encoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1246
Base64 encoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1292
Hexadecimal encoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1199
Combines data slice with boolean flag to represent result of certain operations.
Definition mdbx.h++:2718
incompatible_operation(const ::mdbx::error &)
fatal(exception &&src) noexcept
Definition mdbx.h++:520
remote_media(const ::mdbx::error &)
dangling_map_id(const ::mdbx::error &)
fatal(const ::mdbx::error &) noexcept
reader_slot_busy(const ::mdbx::error &)
exception(const exception &)=default
MDBX_CXX11_CONSTEXPR friend bool operator!=(const error &a, const error &b) noexcept
Definition mdbx.h++:4676
::std::string message() const
Returns message for any errors.
not_found(const ::mdbx::error &)
operation_not_permitted(const ::mdbx::error &)
key_exists(const ::mdbx::error &)
permission_denied_or_not_writeable(const ::mdbx::error &)
void throw_exception() const
fatal(const exception &src) noexcept
Definition mdbx.h++:519
no_data(const ::mdbx::error &)
transaction_full(const ::mdbx::error &)
exception(exception &&)=default
db_too_large(const ::mdbx::error &)
bad_map_id(const ::mdbx::error &)
transaction_overlapping(const ::mdbx::error &)
void panic(const char *context_where_when, const char *func_who_what) const noexcept
Panics on unrecoverable errors inside destructors etc.
static void success_or_throw(int error_code)
Definition mdbx.h++:488
db_full(const ::mdbx::error &)
duplicated_lck_file(const ::mdbx::error &)
const ::mdbx::error error() const noexcept
Definition mdbx.h++:510
error(const error &)=default
virtual ~fatal() noexcept
something_busy(const ::mdbx::error &)
fatal & operator=(fatal &&)=default
const char * what() const noexcept
Returns message for MDBX's errors only and "SYSTEM" for others.
fatal(const fatal &src) noexcept
Definition mdbx.h++:521
MDBX_CXX11_CONSTEXPR friend bool operator==(const error &a, const error &b) noexcept
Definition mdbx.h++:4674
transaction_ousted(const ::mdbx::error &)
key_mismatch(const ::mdbx::error &)
db_invalid(const ::mdbx::error &)
exception & operator=(exception &&)=default
db_wanna_write_for_recovery(const ::mdbx::error &)
error & operator=(error &&)=default
bad_transaction(const ::mdbx::error &)
internal_problem(const ::mdbx::error &)
multivalue(const ::mdbx::error &)
fatal(fatal &&src) noexcept
Definition mdbx.h++:522
fatal & operator=(const fatal &)=default
max_readers_reached(const ::mdbx::error &)
db_version_mismatch(const ::mdbx::error &)
exception_thunk() noexcept=default
exception & operator=(const exception &)=default
exception(const ::mdbx::error &) noexcept
db_unable_extend(const ::mdbx::error &)
error & operator=(const error &)=default
virtual ~exception() noexcept
thread_mismatch(const ::mdbx::error &)
db_corrupted(const ::mdbx::error &)
internal_page_full(const ::mdbx::error &)
mvcc_retarded(const ::mdbx::error &)
max_maps_reached(const ::mdbx::error &)
bad_value_size(const ::mdbx::error &)
Implements error information and throwing corresponding exceptions.
Definition mdbx.h++:447
Transfers C++ exceptions thru C callbacks.
Definition mdbx.h++:432
LIBMDBX_API void throw_allocators_mismatch()
#define MDBX_DECLARE_EXCEPTION(NAME)
Definition mdbx.h++:528
LIBMDBX_API void throw_incomparable_cursors()
LIBMDBX_API void throw_out_range()
LIBMDBX_API void throw_bad_value_size()
LIBMDBX_API void throw_max_length_exceeded()
LIBMDBX_API void throw_too_small_target_buffer()
uint64_t mdbx_key_from_int64(const int64_t i64)
Definition mdbx.h:4685
LIBMDBX_API uint32_t mdbx_key_from_ptrfloat(const float *const ieee754_32bit)
LIBMDBX_API uint64_t mdbx_key_from_double(const double ieee754_64bit)
LIBMDBX_API uint32_t mdbx_key_from_float(const float ieee754_32bit)
LIBMDBX_API uint64_t mdbx_key_from_ptrdouble(const double *const ieee754_64bit)
uint32_t mdbx_key_from_int32(const int32_t i32)
Definition mdbx.h:4689
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)
#define MDBX_CXX20_CONSTEXPR
Definition mdbx.h++:174
#define MDBX_CXX17_FALLTHROUGH
Definition mdbx.h++:232
#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, API_TYPENAME)
Definition mdbx.h++:112
#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE)
Definition mdbx.h++:272
#define MDBX_LIKELY(cond)
Definition mdbx.h++:207
#define MDBX_CXX11_CONSTEXPR_ENUM
Definition mdbx.h++:184
#define MDBX_UNLIKELY(cond)
Definition mdbx.h++:215
#define MDBX_CXX17_CONSTEXPR
Definition mdbx.h++:163
#define MDBX_CONSTEXPR_ASSERT(expr)
Definition mdbx.h++:202
#define MDBX_IF_CONSTEXPR
Definition mdbx.h++:223
#define MDBX_CXX01_CONSTEXPR_ENUM
Definition mdbx.h++:183
#define MDBX_CXX20_LIKELY
Definition mdbx.h++:238
The libmdbx C API header file.
constexpr bool allocator_is_always_equal() noexcept
Definition mdbx.h++:1059
The libmdbx C++ API namespace.
Definition mdbx.h++:305
estimate_result(const cursor &cursor, move_operation operation)
Definition mdbx.h++:4245
estimate_result & operator=(const estimate_result &) noexcept=default
ptrdiff_t approximate_quantity
Definition mdbx.h++:4244
estimate_result(const estimate_result &) noexcept=default
estimate_result(const cursor &cursor, move_operation operation, const slice &key)
Definition mdbx.h++:4247
move_result & operator=(const move_result &) noexcept=default
move_result(const move_result &) noexcept=default
move_result(cursor &cursor, move_operation operation, const slice &key, bool throw_notfound)
Definition mdbx.h++:4235
move_result(cursor &cursor, move_operation operation, bool throw_notfound)
Definition mdbx.h++:4233
Tagged type for output to std::ostream.
Definition mdbx.h++:3073
MDBX_CXX11_CONSTEXPR size(intptr_t bytes) noexcept
Definition mdbx.h++:3075
intptr_t bytes
Definition mdbx.h++:3074
Database geometry for size management.
Definition mdbx.h++:3049
MDBX_CXX11_CONSTEXPR geometry() noexcept
Definition mdbx.h++:3113
intptr_t size_upper
The upper bound of database size in bytes.
Definition mdbx.h++:3097
intptr_t pagesize
The database page size for new database creation or default_value otherwise.
Definition mdbx.h++:3109
@ GB
bytes (0x3B9A_CA00)
Definition mdbx.h++:3056
@ minimal_value
Means "minimal acceptable".
Definition mdbx.h++:3052
@ MB
bytes (0x000F_4240)
Definition mdbx.h++:3055
@ GiB
bytes (0x4000_0000)
Definition mdbx.h++:3064
@ maximal_value
Means "maximal acceptable".
Definition mdbx.h++:3053
@ default_value
Means "keep current or use default".
Definition mdbx.h++:3051
@ kB
bytes (0x03E8)
Definition mdbx.h++:3054
@ MiB
bytes (0x0010_0000)
Definition mdbx.h++:3063
@ KiB
bytes (0x0400)
Definition mdbx.h++:3062
intptr_t growth_step
The growth step in bytes, must be greater than zero to allow the database to grow.
Definition mdbx.h++:3100
MDBX_CXX11_CONSTEXPR geometry(const geometry &) noexcept=default
intptr_t size_now
The size in bytes to setup the database size for now.
Definition mdbx.h++:3085
intptr_t shrink_threshold
The shrink threshold in bytes, must be greater than zero to allow the database to shrink.
Definition mdbx.h++:3103
intptr_t size_lower
The lower bound of database size in bytes.
Definition mdbx.h++:3080
MDBX_CXX11_CONSTEXPR geometry(intptr_t size_lower, intptr_t size_now=default_value, intptr_t size_upper=default_value, intptr_t growth_step=default_value, intptr_t shrink_threshold=default_value, intptr_t pagesize=default_value) noexcept
Definition mdbx.h++:3116
Operate options.
Definition mdbx.h++:3153
bool disable_readahead
Definition mdbx.h++:3162
bool enable_validation
Definition mdbx.h++:3166
bool no_sticky_threads
Definition mdbx.h++:3155
bool disable_clear_memory
Definition mdbx.h++:3164
bool exclusive
Definition mdbx.h++:3160
bool nested_write_transactions
Разрешает вложенные транзакции ценой отключения MDBX_WRITEMAP и увеличением накладных расходов.
Definition mdbx.h++:3158
operate_options(MDBX_env_flags_t) noexcept
MDBX_CXX14_CONSTEXPR operate_options & operator=(const operate_options &) noexcept=default
MDBX_CXX11_CONSTEXPR operate_options() noexcept
Definition mdbx.h++:3167
MDBX_CXX11_CONSTEXPR operate_options(const operate_options &) noexcept=default
Operate parameters.
Definition mdbx.h++:3175
env::durability durability
Definition mdbx.h++:3183
MDBX_CXX14_CONSTEXPR operate_parameters & operator=(const operate_parameters &) noexcept=default
env::operate_options options
Definition mdbx.h++:3185
static env::mode mode_from_flags(MDBX_env_flags_t) noexcept
MDBX_CXX11_CONSTEXPR operate_parameters(const unsigned max_maps, const unsigned max_readers=0, const env::mode mode=env::mode::write_mapped_io, env::durability durability=env::durability::robust_synchronous, const env::reclaiming_options &reclaiming=env::reclaiming_options(), const env::operate_options &options=env::operate_options()) noexcept
Definition mdbx.h++:3189
MDBX_CXX11_CONSTEXPR operate_parameters(const operate_parameters &) noexcept=default
MDBX_CXX11_CONSTEXPR operate_parameters() noexcept
Definition mdbx.h++:3187
unsigned max_readers
The maximum number of threads/reader slots for the environment. Zero means default value.
Definition mdbx.h++:3181
env::reclaiming_options reclaiming
Definition mdbx.h++:3184
env::mode mode
Definition mdbx.h++:3182
static env::durability durability_from_flags(MDBX_env_flags_t) noexcept
unsigned max_maps
The maximum number of named tables/maps for the environment. Zero means default value.
Definition mdbx.h++:3178
MDBX_env_flags_t make_flags(bool accede=true, bool use_subdirectory=false) const
Reader information.
Definition mdbx.h++:3555
mdbx_tid_t thread
The reader thread ID.
Definition mdbx.h++:3558
uint64_t transaction_lag
Definition mdbx.h++:3561
size_t bytes_used
Definition mdbx.h++:3565
uint64_t transaction_id
Definition mdbx.h++:3559
int slot
The reader lock table slot number.
Definition mdbx.h++:3556
mdbx_pid_t pid
The reader process ID.
Definition mdbx.h++:3557
size_t bytes_retained
Definition mdbx.h++:3568
Garbage reclaiming options.
Definition mdbx.h++:3140
MDBX_CXX11_CONSTEXPR reclaiming_options(const reclaiming_options &) noexcept=default
bool coalesce
Definition mdbx.h++:3144
reclaiming_options(MDBX_env_flags_t) noexcept
MDBX_CXX11_CONSTEXPR reclaiming_options() noexcept
Definition mdbx.h++:3145
MDBX_CXX14_CONSTEXPR reclaiming_options & operator=(const reclaiming_options &) noexcept=default
bool lifo
Definition mdbx.h++:3142
Additional parameters for creating a new database.
Definition mdbx.h++:3664
mdbx_mode_t file_mode_bits
Definition mdbx.h++:3666
MDBX_CXX11_CONSTEXPR create_parameters() noexcept=default
bool use_subdirectory
Definition mdbx.h++:3667
env::geometry geometry
Definition mdbx.h++:3665
map_handle::state state
Definition mdbx.h++:2989
info(const info &) noexcept=default
map_handle::flags flags
Definition mdbx.h++:2988
info & operator=(const info &) noexcept=default
capacity_holder capacity_
Definition mdbx.h++:1555
constexpr bool is_inplace() const noexcept
Definition mdbx.h++:1566
static constexpr size_t advise_capacity(const size_t current, const size_t wanna)
Definition mdbx.h++:1656
constexpr bin & operator=(const bin &ditto) noexcept
Definition mdbx.h++:1633
constexpr bin(size_t capacity_bytes=0) noexcept
Definition mdbx.h++:1605
static constexpr bool is_suitable_for_inplace(size_t capacity_bytes) noexcept
Definition mdbx.h++:1558
byte buffer_[inplace_size - sizeof(byte)]
Definition mdbx.h++:1550
constexpr bool is_allocated() const noexcept
Definition mdbx.h++:1573
inplace_flag_holder inplace_
Definition mdbx.h++:1556
constexpr bin(bin &&ditto) noexcept
Definition mdbx.h++:1619
allocator_pointer allocated_ptr_
Definition mdbx.h++:1554
constexpr bin(allocator_pointer ptr, size_t capacity_bytes) noexcept
Definition mdbx.h++:1610
size_t stub_capacity_bytes_
Definition mdbx.h++:1532
constexpr size_t capacity() const noexcept
Definition mdbx.h++:1671
byte pad_[inplace_size - sizeof(allocator_pointer)]
Definition mdbx.h++:1545
size_t bytes_
Definition mdbx.h++:1546
constexpr ~bin()
Definition mdbx.h++:1614
constexpr const byte * address() const noexcept
Definition mdbx.h++:1665
constexpr byte * make_allocated(allocator_pointer ptr, size_t capacity_bytes) noexcept
Definition mdbx.h++:1590
@ inplace_size
Definition mdbx.h++:1540
@ inplace_signature_limit
Definition mdbx.h++:1537
@ inplace_size_rounding
Definition mdbx.h++:1539
constexpr byte * address() noexcept
Definition mdbx.h++:1668
constexpr bin & operator=(bin &&ditto) noexcept
Definition mdbx.h++:1649
@ lastbyte_poison
Definition mdbx.h++:1535
@ lastbyte_inplace_signature
Definition mdbx.h++:1535
constexpr byte * make_inplace() noexcept
Definition mdbx.h++:1575
byte lastbyte_
Definition mdbx.h++:1551
allocator_pointer ptr_
Definition mdbx.h++:1531