44#if defined(__SIZEOF_INT128__) && !defined(__GLIBCXX_TYPE_INT_N_0) && defined(__clang__) && __clang_major__ < 4
45#define __GLIBCXX_BITSIZE_INT_N_0 128
46#define __GLIBCXX_TYPE_INT_N_0 __int128
49#if !defined(__cplusplus) || __cplusplus < 201103L
50#if !defined(_MSC_VER) || _MSC_VER < 1900
51#error "C++11 compiler or better is required"
53#error "Please add `/Zc:__cplusplus` to MSVC compiler options to enforce it conform ISO C++"
57#if (defined(_WIN32) || defined(_WIN64)) && MDBX_WITHOUT_MSVC_CRT && !defined(__CODEGEARC__)
58#error "CRT is required for C++ API, the MDBX_WITHOUT_MSVC_CRT option must be disabled"
62#define __has_include(header) (0)
65#if __has_include(<version>)
87#if defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L
88#include <memory_resource>
91#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
95#ifndef MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM
96#ifdef INCLUDE_STD_FILESYSTEM_EXPERIMENTAL
97#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 1
98#elif defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && __cplusplus >= 201703L
99#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 0
100#elif (!defined(_MSC_VER) || __cplusplus >= 201403L || \
101 (defined(_MSC_VER) && defined(_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING) && __cplusplus >= 201403L))
102#if defined(__cpp_lib_experimental_filesystem) && __cpp_lib_experimental_filesystem >= 201406L
103#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 1
104#elif defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L && __has_include(<experimental/filesystem>)
105#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 1
107#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 0
110#define MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM 0
114#if MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM
115#include <experimental/filesystem>
116#elif defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L
120#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
124#if !defined(_MSC_VER) || defined(__clang__)
125#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, ...) extern template class API_ATTRIBUTES __VA_ARGS__
126#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, ...) template class __VA_ARGS__
128#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES, ...) extern template class __VA_ARGS__
129#define MDBX_INSTALL_API_TEMPLATE(API_ATTRIBUTES, ...) template class API_ATTRIBUTES __VA_ARGS__
132#if defined(_MSC_VER) && _MSC_VER >= 1900
133#define MDBX_MSVC_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
135#define MDBX_MSVC_DECLSPEC_EMPTY_BASES
138#if __cplusplus >= 201103L
145#if (defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L) || \
146 (defined(__cpp_lib_endian) && __cpp_lib_endian >= 201907L) || \
147 (defined(__cpp_lib_bitops) && __cpp_lib_bitops >= 201907L) || \
148 (defined(__cpp_lib_int_pow2) && __cpp_lib_int_pow2 >= 202002L)
150#elif !(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__))
151#if defined(__BYTE_ORDER) && defined(__LITTLE_ENDIAN) && defined(__BIG_ENDIAN)
152#define __ORDER_LITTLE_ENDIAN__ __LITTLE_ENDIAN
153#define __ORDER_BIG_ENDIAN__ __BIG_ENDIAN
154#define __BYTE_ORDER__ __BYTE_ORDER
155#elif defined(_BYTE_ORDER) && defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
156#define __ORDER_LITTLE_ENDIAN__ _LITTLE_ENDIAN
157#define __ORDER_BIG_ENDIAN__ _BIG_ENDIAN
158#define __BYTE_ORDER__ _BYTE_ORDER
160#define __ORDER_LITTLE_ENDIAN__ 1234
161#define __ORDER_BIG_ENDIAN__ 4321
162#if defined(__LITTLE_ENDIAN__) || (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || defined(__ARMEL__) || \
163 defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(__MIPSEL__) || defined(_MIPSEL) || defined(__MIPSEL) || \
164 defined(_M_ARM) || defined(_M_ARM64) || defined(__e2k__) || defined(__elbrus_4c__) || defined(__elbrus_8c__) || \
165 defined(__bfin__) || defined(__BFIN__) || defined(__ia64__) || defined(_IA64) || defined(__IA64__) || \
166 defined(__ia64) || defined(_M_IA64) || defined(__itanium__) || defined(__ia32__) || defined(__CYGWIN__) || \
167 defined(_WIN64) || defined(_WIN32) || defined(__TOS_WIN__) || defined(__WINDOWS__)
168#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
169#elif defined(__BIG_ENDIAN__) || (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || defined(__ARMEB__) || \
170 defined(__THUMBEB__) || defined(__AARCH64EB__) || defined(__MIPSEB__) || defined(_MIPSEB) || defined(__MIPSEB) || \
171 defined(__m68k__) || defined(M68000) || defined(__hppa__) || defined(__hppa) || defined(__HPPA__) || \
172 defined(__sparc__) || defined(__sparc) || defined(__370__) || defined(__THW_370__) || defined(__s390__) || \
173 defined(__s390x__) || defined(__SYSC_ZARCH__)
174#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
181#define MDBX_CXX17_CONSTEXPR constexpr
182#elif defined(__cpp_constexpr) && __cpp_constexpr >= 201603L && \
183 ((defined(_MSC_VER) && _MSC_VER >= 1915) || (defined(__clang__) && __clang_major__ > 5) || \
184 (defined(__GNUC__) && __GNUC__ > 7) || (!defined(__GNUC__) && !defined(__clang__) && !defined(_MSC_VER)))
185#define MDBX_CXX17_CONSTEXPR constexpr
187#define MDBX_CXX17_CONSTEXPR inline
192#define MDBX_CXX20_CONSTEXPR constexpr
193#elif defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L && \
194 defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 201907L
195#define MDBX_CXX20_CONSTEXPR constexpr
197#define MDBX_CXX20_CONSTEXPR inline
200#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
201#define MDBX_CXX01_CONSTEXPR_ENUM MDBX_CXX01_CONSTEXPR
202#define MDBX_CXX11_CONSTEXPR_ENUM MDBX_CXX11_CONSTEXPR
203#define MDBX_CXX14_CONSTEXPR_ENUM MDBX_CXX14_CONSTEXPR
204#define MDBX_CXX17_CONSTEXPR_ENUM MDBX_CXX17_CONSTEXPR
205#define MDBX_CXX20_CONSTEXPR_ENUM MDBX_CXX20_CONSTEXPR
207#define MDBX_CXX01_CONSTEXPR_ENUM inline
208#define MDBX_CXX11_CONSTEXPR_ENUM inline
209#define MDBX_CXX14_CONSTEXPR_ENUM inline
210#define MDBX_CXX17_CONSTEXPR_ENUM inline
211#define MDBX_CXX20_CONSTEXPR_ENUM inline
215#if defined(CONSTEXPR_ASSERT)
216#define MDBX_CONSTEXPR_ASSERT(expr) CONSTEXPR_ASSERT(expr)
217#elif defined(NDEBUG) && (!defined(MDBX_CHECKING) || !MDBX_CHECKING) && (!defined(MDBX_DEBUG) || !MDBX_DEBUG)
218#define MDBX_CONSTEXPR_ASSERT(expr) void(0)
220#define MDBX_CONSTEXPR_ASSERT(expr) ((expr) ? void(0) : [] { assert(!#expr); }())
225#define MDBX_IF_CONSTEXPR constexpr
226#elif defined(__cpp_if_constexpr) && __cpp_if_constexpr >= 201606L
227#define MDBX_IF_CONSTEXPR constexpr
229#define MDBX_IF_CONSTEXPR
232#if defined(DOXYGEN) || (__has_cpp_attribute(fallthrough) && (!defined(__clang__) || __clang__ > 4)) || \
233 __cplusplus >= 201703L
234#define MDBX_CXX17_FALLTHROUGH [[fallthrough]]
236#define MDBX_CXX17_FALLTHROUGH
239#if defined(DOXYGEN) || (__has_cpp_attribute(likely) >= 201803L && (!defined(__GNUC__) || __GNUC__ > 9))
240#define MDBX_CXX20_LIKELY [[likely]]
242#define MDBX_CXX20_LIKELY
245#ifndef MDBX_CXX20_UNLIKELY
246#if defined(DOXYGEN) || (__has_cpp_attribute(unlikely) >= 201803L && (!defined(__GNUC__) || __GNUC__ > 9))
247#define MDBX_CXX20_UNLIKELY [[unlikely]]
249#define MDBX_CXX20_UNLIKELY
253#ifndef MDBX_HAVE_CXX20_CONCEPTS
254#if defined(__cpp_concepts) && __cpp_concepts >= 202002L && defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
256#define MDBX_HAVE_CXX20_CONCEPTS 1
257#elif defined(DOXYGEN)
258#define MDBX_HAVE_CXX20_CONCEPTS 1
260#define MDBX_HAVE_CXX20_CONCEPTS 0
264#ifndef MDBX_CXX20_CONCEPT
265#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN)
266#define MDBX_CXX20_CONCEPT(CONCEPT, NAME) CONCEPT NAME
268#define MDBX_CXX20_CONCEPT(CONCEPT, NAME) typename NAME
272#ifndef MDBX_ASSERT_CXX20_CONCEPT_SATISFIED
273#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN)
274#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE) static_assert(CONCEPT<TYPE>)
276#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, NAME) \
277 static_assert(true, MDBX_STRINGIFY(CONCEPT) "<" MDBX_STRINGIFY(TYPE) ">")
282#pragma warning(push, 4)
283#pragma warning(disable : 4127)
284#pragma warning(disable : 4251)
286#pragma warning(disable : 4275)
291#pragma warning(disable : 4702)
294#if defined(__LCC__) && __LCC__ >= 126
295#pragma diagnostic push
297#pragma diag_suppress 3058
299#pragma diag_suppress 3060
329#if defined(DOXYGEN) || (defined(__cpp_char8_t) && __cpp_char8_t >= 201811)
333using byte =
unsigned char;
336#if defined(__cpp_lib_endian) && __cpp_lib_endian >= 201907L
337using endian = ::std::endian;
338#elif defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && defined(__ORDER_BIG_ENDIAN__)
339enum class endian { little = __ORDER_LITTLE_ENDIAN__, big = __ORDER_BIG_ENDIAN__, native = __BYTE_ORDER__ };
341#error "Please use a C++ compiler provides byte order information or C++20 support"
368#define MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR 1
369#elif !defined(MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR)
370#if defined(__cpp_lib_memory_resource) && __cpp_lib_memory_resource >= 201603L && \
371 (!defined(_GLIBCXX_USE_CXX11_ABI) || _GLIBCXX_USE_CXX11_ABI)
372#define MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR 1
374#define MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR 0
378#if defined(DOXYGEN) || MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR
388template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
401template <
class ALLOCATOR = default_allocator>
402using string = ::std::basic_string<char, ::std::char_traits<char>, ALLOCATOR>;
405#if MDBX_USING_CXX_EXPERIMETAL_FILESYSTEM
407namespace filesystem = ::std::experimental::filesystem::v1;
409namespace filesystem = ::std::experimental::filesystem;
411#define MDBX_STD_FILESYSTEM_PATH ::mdbx::filesystem::path
412#elif defined(DOXYGEN) || \
413 (defined(__cpp_lib_filesystem) && __cpp_lib_filesystem >= 201703L && defined(__cpp_lib_string_view) && \
414 __cpp_lib_string_view >= 201606L && \
415 (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) && \
416 (!defined(__IPHONE_OS_VERSION_MIN_REQUIRED) || __IPHONE_OS_VERSION_MIN_REQUIRED >= 130100)) && \
417 (!defined(_MSC_VER) || __cplusplus >= 201703L)
418namespace filesystem = ::std::filesystem;
424#define MDBX_STD_FILESYSTEM_PATH ::mdbx::filesystem::path
427#ifdef MDBX_STD_FILESYSTEM_PATH
430#elif defined(_WIN32) || defined(_WIN64)
431using path = ::std::wstring;
434using path = ::std::string;
439#if defined(__SIZEOF_INT128__) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 128)
440#ifndef MDBX_U128_TYPE
441#define MDBX_U128_TYPE __uint128_t
443#ifndef MDBX_I128_TYPE
444#define MDBX_I128_TYPE __int128_t
448#if __cplusplus >= 201103L || defined(DOXYGEN)
450using duration = ::std::chrono::duration<unsigned, ::std::ratio<1, 65536>>;
461 ::std::exception_ptr captured_;
469 inline
bool is_clean() const noexcept;
470 inline
void capture() noexcept;
498 const
char *
what() const noexcept;
514 static inline void throw_on_failure(
int error_code);
515 static inline bool boolean_or_throw(
int error_code);
516 static inline void success_or_throw(
int error_code,
const exception_thunk &);
517 static inline bool boolean_or_throw(
int error_code,
const exception_thunk &);
523 using base = ::std::runtime_error;
541 fatal(const ::mdbx::error &)
noexcept;
551#define MDBX_DECLARE_EXCEPTION(NAME) \
552 struct LIBMDBX_API_TYPE NAME : public exception { \
553 NAME(const ::mdbx::error &); \
554 virtual ~NAME() noexcept; \
589#undef MDBX_DECLARE_EXCEPTION
605 return check_length(check_length(headroom) + check_length(payload));
609 return check_length(check_length(headroom, payload) + check_length(tailroom));
651 template <
class CHAR,
class T,
class A>
660#if defined(DOXYGEN) || (defined(__cpp_lib_span) && __cpp_lib_span >= 202002L)
662 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
663 "Must be a standard layout type!");
666 template <
typename POD> MDBX_CXX14_CONSTEXPR ::std::span<const POD>
as_span()
const {
667 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
668 "Must be a standard layout type!");
671 return ::std::span<const POD>(
static_cast<const POD *
>(
data()),
size() /
sizeof(POD));
675 template <
typename POD> MDBX_CXX14_CONSTEXPR ::std::span<POD>
as_span() {
676 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
677 "Must be a standard layout type!");
680 return ::std::span<POD>(
static_cast<POD *
>(
data()),
size() /
sizeof(POD));
690#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
692 template <
class CHAR,
class T>
695 template <
class CHAR,
class T>
slice(::std::basic_string_view<CHAR, T> &&sv) :
slice(sv) { sv = {}; }
701 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
702 "Must be a standard layout type!");
703 return slice(&pod,
sizeof(pod));
706 inline slice &assign(
const void *ptr,
size_t bytes);
707 inline slice &assign(
const slice &src)
noexcept;
708 inline slice &assign(const ::MDBX_val &src);
711 inline slice &assign(
const void *begin,
const void *end);
712 template <
class CHAR,
class T,
class ALLOCATOR>
slice &
assign(const ::std::basic_string<CHAR, T, ALLOCATOR> &str) {
713 return assign(str.data(), str.length() *
sizeof(CHAR));
715 inline slice &assign(
const char *c_str);
716#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
717 template <
class CHAR,
class T>
slice &
assign(const ::std::basic_string_view<CHAR, T> &view) {
718 return assign(view.begin(), view.end());
720 template <
class CHAR,
class T>
slice &
assign(::std::basic_string_view<CHAR, T> &&view) {
731 operator const MDBX_val *()
const noexcept {
return this; }
733#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
734 template <
class CHAR,
class T>
slice &
operator=(const ::std::basic_string_view<CHAR, T> &view) {
738 template <
class CHAR,
class T>
slice &
operator=(::std::basic_string_view<CHAR, T> &&view) {
return assign(view); }
741 template <
class CHAR =
char,
class T = ::std::
char_traits<CHAR>>
742 MDBX_CXX11_CONSTEXPR ::std::basic_string_view<CHAR, T>
string_view() const noexcept {
743 static_assert(
sizeof(CHAR) == 1,
"Must be single byte characters");
748 template <
class CHAR,
class T>
754 template <
class CHAR =
char,
class T = ::std::
char_traits<CHAR>,
class ALLOCATOR = default_allocator>
755 MDBX_CXX20_CONSTEXPR ::std::basic_string<CHAR, T, ALLOCATOR>
as_string(
const ALLOCATOR &alloc = ALLOCATOR())
const {
756 static_assert(
sizeof(CHAR) == 1,
"Must be single byte characters");
757 return ::std::basic_string<CHAR, T, ALLOCATOR>(
char_ptr(),
length(), alloc);
760 template <
class CHAR,
class T,
class ALLOCATOR>
766 template <
class ALLOCATOR = default_allocator>
767 inline string<ALLOCATOR> as_hex_string(
bool uppercase =
false,
unsigned wrap_width = 0,
768 const ALLOCATOR &alloc = ALLOCATOR())
const;
772 template <
class ALLOCATOR = default_allocator>
773 inline string<ALLOCATOR> as_base58_string(
unsigned wrap_width = 0,
const ALLOCATOR &alloc = ALLOCATOR())
const;
777 template <
class ALLOCATOR = default_allocator>
778 inline string<ALLOCATOR> as_base64_string(
unsigned wrap_width = 0,
const ALLOCATOR &alloc = ALLOCATOR())
const;
781 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
783 const ALLOCATOR &alloc = ALLOCATOR())
const;
787 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
789 const ALLOCATOR &alloc = ALLOCATOR())
const;
793 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
795 const ALLOCATOR &alloc = ALLOCATOR())
const;
798 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
800 const ALLOCATOR &alloc = ALLOCATOR())
const;
804 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
806 const ALLOCATOR &alloc = ALLOCATOR())
const;
810 template <
class ALLOCATOR = default_allocator,
class CAPACITY_POLICY = default_capacity_policy>
812 const ALLOCATOR &alloc = ALLOCATOR())
const;
841#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
842 template <
class CHAR,
class T>
void swap(::std::basic_string_view<CHAR, T> &view)
noexcept {
843 static_assert(
sizeof(CHAR) == 1,
"Must be single byte characters");
844 const auto temp = ::std::basic_string_view<CHAR, T>(*
this);
909 inline
void remove_prefix(
size_t n) noexcept;
913 inline
void remove_suffix(
size_t n) noexcept;
917 inline
void safe_remove_prefix(
size_t n);
921 inline
void safe_remove_suffix(
size_t n);
983 const
slice &b) noexcept;
990#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L
999 return slice( ~
size_t(0));
1006 static_assert(::std::is_standard_layout<POD>::value && !::std::is_pointer<POD>::value,
1007 "Must be a standard layout type!");
1011 memcpy(&r,
data(),
sizeof(r));
1017#ifdef MDBX_U128_TYPE
1025#ifdef MDBX_I128_TYPE
1033#ifdef MDBX_U128_TYPE
1041#ifdef MDBX_I128_TYPE
1076 key.assign(std::move(couple.key));
1077 value.assign(std::move(couple.value));
1087 key.assign(couple.first);
1088 value.assign(couple.second);
1092 key.assign(std::move(couple.first));
1093 value.assign(std::move(couple.second));
1102 const pair &b)
noexcept;
1109#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L
1129#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN)
1134template <
typename T>
1136 { a.is_empty() } -> std::same_as<bool>;
1137 { a.envisage_result_length() } -> std::same_as<size_t>;
1138 { a.write_bytes(&array[0],
size_t(42)) } -> std::same_as<char *>;
1144template <
typename T>
1146 { a.is_empty() } -> std::same_as<bool>;
1147 { a.envisage_result_length() } -> std::same_as<size_t>;
1148 { a.write_bytes(&array[0],
size_t(42)) } -> std::same_as<char *>;
1154template <
typename T>
1157 { a.is_erroneous() } -> std::same_as<bool>;
1173 template <
class ALLOCATOR = default_allocator>
1177 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1183 const size_t bytes =
source.length() << 1;
1193 ::std::ostream &
output(::std::ostream &out)
const;
1216 template <
class ALLOCATOR = default_allocator>
1221 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1227 const size_t bytes = (
source.length() * 11 + 7) / 8;
1237 ::std::ostream &
output(::std::ostream &out)
const;
1258 template <
class ALLOCATOR = default_allocator>
1263 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1269 const size_t bytes = (
source.length() + 2) / 3 * 4;
1281 ::std::ostream &
output(::std::ostream &out)
const;
1302 template <
class ALLOCATOR = default_allocator>
1306 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1337 template <
class ALLOCATOR = default_allocator>
1342 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1376 template <
class ALLOCATOR = default_allocator>
1381 template <
class ALLOCATOR = default_allocator,
typename CAPACITY_POLICY = default_capacity_policy>
1406#if defined(__cpp_lib_allocator_traits_is_always_equal) && __cpp_lib_allocator_traits_is_always_equal >= 201411L
1407 return ::std::allocator_traits<A>::is_always_equal::value;
1409 return ::std::is_empty<A>::value;
1413template <
typename T,
typename A =
typename T::allocator_type,
1414 bool PoCMA = ::std::allocator_traits<A>::propagate_on_container_move_assignment::value>
1423 return target->get_allocator() == source.get_allocator();
1428template <
typename T,
typename A>
struct move_assign_alloc<T, A, true> {
1429 static constexpr bool is_nothrow() noexcept { return ::std::is_nothrow_move_assignable<A>::value; }
1430 static constexpr bool is_moveable(T *, T &)
noexcept {
return true; }
1432 target->get_allocator() = ::std::move(source.get_allocator());
1436template <
typename T,
typename A =
typename T::allocator_type,
1437 bool PoCCA = ::std::allocator_traits<A>::propagate_on_container_copy_assignment::value>
1441 static constexpr bool is_nothrow() noexcept {
return false; }
1445template <
typename T,
typename A>
struct copy_assign_alloc<T, A, true> {
1446 static constexpr bool is_nothrow() noexcept {
1447 return allocator_is_always_equal<A>() || ::std::is_nothrow_copy_assignable<A>::value;
1449 static MDBX_CXX20_CONSTEXPR void propagate(T *target,
const T &source)
noexcept(is_nothrow()) {
1451 if (
MDBX_UNLIKELY(target->get_allocator() != source.get_allocator()))
1452 MDBX_CXX20_UNLIKELY target->get_allocator() =
1453 ::std::allocator_traits<A>::select_on_container_copy_construction(source.get_allocator());
1462template <
typename T,
typename A =
typename T::allocator_type,
1463 bool PoCS = ::std::allocator_traits<A>::propagate_on_container_swap::value>
1466template <
typename T,
typename A>
struct swap_alloc<T, A, false> {
1470 if (
MDBX_UNLIKELY(left.get_allocator() != right.get_allocator()))
1480template <
typename T,
typename A>
struct swap_alloc<T, A, true> {
1481 static constexpr bool is_nothrow() noexcept {
1482 return allocator_is_always_equal<A>() ||
1483#if defined(__cpp_lib_is_swappable) && __cpp_lib_is_swappable >= 201603L
1484 ::std::is_nothrow_swappable<A>() ||
1486 (::std::is_nothrow_move_constructible<A>::value && ::std::is_nothrow_move_assignable<A>::value);
1490 MDBX_CXX20_UNLIKELY ::std::swap(left.get_allocator(), right.get_allocator());
1511 static_assert(
pettiness_threshold >=
sizeof(uint64_t),
"pettiness_threshold must be > 7");
1520 if (wanna <= inplace && (current <= inplace || current >= std::max(inplace + inplace,
size_t(
pettiness_threshold))))
1523 if (wanna > current)
1527 if (current - wanna >
1531 return round(wanna);
1542template <
class ALLOCATOR,
typename CAPACITY_POLICY>
1546#if !defined(_MSC_VER) || _MSC_VER > 1900
1547 using allocator_type = typename ::std::allocator_traits<ALLOCATOR>::template rebind_alloc<uint64_t>;
1549 using allocator_type =
typename ALLOCATOR::template rebind<uint64_t>::other;
1559 ?
alignof(max_align_t) * 2
1573 using allocator_pointer =
typename allocator_traits::pointer;
1574 using allocator_const_pointer =
typename allocator_traits::const_pointer;
1576 MDBX_CXX20_CONSTEXPR ::std::pair<allocator_pointer, size_t> allocate_storage(
size_t bytes) {
1578 constexpr size_t unit =
sizeof(
typename allocator_type::value_type);
1579 static_assert((unit & (unit - 1)) == 0,
"size of ALLOCATOR::value_type should be a power of 2");
1580 static_assert(unit > 0,
"size of ALLOCATOR::value_type must be > 0");
1581 const size_t n = (bytes + unit - 1) / unit;
1582 return ::std::make_pair(allocator_traits::allocate(get_allocator(), n), n * unit);
1586 constexpr size_t unit =
sizeof(
typename allocator_type::value_type);
1588 allocator_traits::deallocate(get_allocator(), ptr, bytes / unit);
1591 MDBX_CXX20_CONSTEXPR ::std::pair<allocator_pointer, size_t> provide_storage(
size_t bytes) {
1592 const size_t capacity = bin::advise_capacity(0, bytes);
1593 return bin::is_suitable_for_inplace(capacity) ? ::std::pair<allocator_pointer, size_t>(
nullptr, capacity)
1594 : allocate_storage(capacity);
1598#if defined(__cpp_lib_to_address) && __cpp_lib_to_address >= 201711L
1599 return static_cast<void *
>(::std::to_address(ptr));
1601 return static_cast<void *
>(::std::addressof(*ptr));
1606#if defined(__cpp_lib_to_address) && __cpp_lib_to_address >= 201711L
1607 return static_cast<const void *
>(::std::to_address(ptr));
1609 return static_cast<const void *
>(::std::addressof(*ptr));
1614#pragma warning(push)
1615#pragma warning(disable : 4324)
1618 union alignas(max_align_t)
bin {
1629 << (
sizeof(
size_t ) - 1) * CHAR_BIT,
1652 static_assert((size_t(reservation_policy::inplace_storage_size_rounding) &
1653 (size_t(reservation_policy::inplace_storage_size_rounding) - 1)) == 0,
1654 "CAPACITY_POLICY::inplace_storage_size_rounding must be power of 2");
1661 static_assert(std::numeric_limits<size_t>::max() - (std::numeric_limits<size_t>::max() >> CHAR_BIT) ==
1679 template <
bool construct_ptr>
1682 if (construct_ptr) {
1695 if (::std::is_trivial<allocator_pointer>::value)
1704 const size_t advised = reservation_policy::advise(current, wanna,
inplace_capacity());
1726 constexpr bool is_inplace(
const void *ptr)
const noexcept {
return bin_.is_inplace(ptr); }
1729 if (bin_.is_allocated()) {
1730 deallocate_storage(bin_.allocated_ptr_, bin_.capacity_.bytes_);
1732 bin_.allocated_ptr_.~allocator_pointer();
1733 bin_.inplace_.lastbyte_ = bin::lastbyte_inplace_signature;
1737 template <
bool external_content>
1739 const void *
const content,
const size_t length) {
1741 const size_t old_capacity = bin_.capacity();
1742 const size_t new_capacity = bin::advise_capacity(old_capacity, wanna_capacity);
1746 byte *
const new_place = bin_.address() + wanna_headroom;
1749 if (external_content)
1750 memcpy(new_place, content, length);
1752 const size_t old_headroom = bin_.address() -
static_cast<const byte *
>(content);
1755 MDBX_CXX20_UNLIKELY ::std::memmove(new_place, content, length);
1761 if (bin::is_suitable_for_inplace(new_capacity)) {
1763 const auto old_allocated = ::std::move(bin_.allocated_ptr_);
1765 byte *
const new_place = bin_.template make_inplace<true>() + wanna_headroom;
1768 deallocate_storage(old_allocated, old_capacity);
1772 if (bin_.is_inplace()) {
1773 const auto pair = allocate_storage(new_capacity);
1775 byte *
const new_place =
static_cast<byte *
>(to_address(pair.first)) + wanna_headroom;
1778 bin_.template make_allocated<true>(pair);
1782 const auto old_allocated = ::std::move(bin_.allocated_ptr_);
1783 if (external_content)
1784 deallocate_storage(old_allocated, old_capacity);
1785 const auto pair = allocate_storage(new_capacity);
1787 byte *
const new_place = bin_.template make_allocated<false>(pair) + wanna_headroom;
1790 if (!external_content)
1791 deallocate_storage(old_allocated, old_capacity);
1797 return bin_.address() + offset;
1801 return bin_.address() + offset;
1805 return static_cast<byte *
>(memcpy(get(offset), ptr, length));
1810 MDBX_CXX20_CONSTEXPR silo(
const allocator_type &alloc = allocator_type()) noexcept : allocator_type(alloc) {}
1811 MDBX_CXX20_CONSTEXPR silo(
size_t capacity,
const allocator_type &alloc = allocator_type()) : silo(alloc) {
1812 if (!bin::is_suitable_for_inplace(capacity))
1813 bin_.template make_allocated<true>(provide_storage(capacity));
1816 silo(silo &&other) =
delete;
1818 silo(silo &&other,
bool is_reference =
false) noexcept(::std::is_nothrow_move_constructible<allocator_type>::value)
1819 : allocator_type(::std::move(other.get_allocator())) {
1820 if (!is_reference) {
1821 if (other.bin_.is_inplace()) {
1822 memcpy(&bin_, &other.bin_,
sizeof(bin));
1826 new (&bin_.allocated_ptr_) allocator_pointer(::std::move(other.bin_.allocated_ptr_));
1828 bin_.capacity_.bytes_ = other.bin_.capacity_.bytes_;
1836 other.bin_.allocated_ptr_.~allocator_pointer();
1837 other.bin_.inplace_.lastbyte_ = bin::lastbyte_inplace_signature;
1844 switch (other_modality) {
1845 case modality::inplace:
1846 memcpy(&bin_, &other.bin_,
sizeof(bin));
1849 case modality::allocated:
1850 new (&bin_.allocated_ptr_) allocator_pointer(::std::move(other.bin_.allocated_ptr_));
1851 bin_.capacity_.bytes_ = other.bin_.capacity_.bytes_;
1859 other.bin_.allocated_ptr_.~allocator_pointer();
1860 other.bin_.inplace_.lastbyte_ = bin::lastbyte_inplace_signature;
1870 exchange(silo &left,
const modality left_modality, silo &right,
const modality right_modality)
noexcept(
1871 allocation_aware_details::swap_alloc<silo, allocator_type>::is_nothrow()) {
1872 allocation_aware_details::swap_alloc<silo, allocator_type>::propagate(left, right);
1873 bool left_need_fixup =
false, right_need_fixup =
false;
1874 if (left_modality == modality::reference || right_modality == modality::reference) {
1875 left_need_fixup = left.move_content(right, right_modality);
1876 right_need_fixup = right.move_content(left, left_modality);
1878 silo temp(std::move(left),
false);
1879 left_need_fixup = left.move_content(right, right_modality);
1880 right_need_fixup = right.move_content(temp, left_modality);
1882 return std::make_pair(left_need_fixup, right_need_fixup);
1886 const allocator_type &alloc = allocator_type())
1887 : silo(capacity, alloc) {
1890 put(headroom, ptr, length);
1893 MDBX_CXX20_CONSTEXPR silo(
const void *ptr,
size_t length,
const allocator_type &alloc = allocator_type())
1894 : silo(length, 0, ptr, length, alloc) {}
1896 ~silo() { release(); }
1900 MDBX_CXX20_CONSTEXPR void *assign(
size_t headroom,
const void *ptr,
size_t length,
size_t tailroom) {
1901 return reshape<true>(headroom + length + tailroom, headroom, ptr, length);
1904 MDBX_CXX20_CONSTEXPR void *assign(
const void *ptr,
size_t length) {
return assign(0, ptr, length, 0); }
1908 return reshape<false>(whole_capacity, headroom,
nullptr, 0);
1912 content.iov_base = reshape<false>(capacity, headroom, content.iov_base, content.iov_len);
1923 auto ptr = inherited::byte_ptr();
1924 if (src.is_inplace(ptr)) {
1926 intptr_t offset = &silo_.bin_.inplace_.buffer_[0] - &src.inplace_.buffer_[0];
1927 iov_base = ptr + offset;
1936 iov_base = silo_.assign(iov_base, iov_len);
1940 return static_cast<const byte *
>(silo_.data());
1944 return silo_begin() + silo_.capacity();
1947 struct data_preserver :
public exception_thunk {
1949 data_preserver(allocator_type &alloc) : data(alloc) {}
1950 static int callback(
void *context,
MDBX_val *target,
const void *src,
size_t bytes)
noexcept {
1951 auto self =
static_cast<data_preserver *
>(context);
1952 assert(self->is_clean());
1953 assert(&self->data == target);
1956 self->data.assign(src, bytes,
false);
2113 template <
class CHAR,
class T,
class A>
buffer(const ::std::basic_string<CHAR, T, A> &) =
delete;
2114 template <
class CHAR,
class T,
class A>
buffer(const ::std::basic_string<CHAR, T, A> &&) =
delete;
2119#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2120 template <
class CHAR,
class T>
2138 template <
class CHAR,
class T,
class A>
2146#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2147 template <
class CHAR,
class T>
2154 : silo_(check_length(head_room, tail_room), alloc) {
2155 iov_base = silo_.get();
2160 iov_base = silo_.get();
2165 : silo_(check_length(head_room, src.
length(), tail_room), alloc) {
2166 iov_base = memcpy(silo_.get(), src.
data(), iov_len = src.
length());
2171 buffer(
buffer &&src)
noexcept(
noexcept(::std::is_nothrow_move_constructible<allocator_type>::value))
2178 fixup_imported_inplace(src.silo_.bin_);
2188 template <
typename POD>
2194 static buffer hex(
const slice &source,
bool uppercase =
false,
unsigned wrap_width = 0,
2211 template <
typename POD>
2212 static buffer hex(
const POD &pod,
bool uppercase =
false,
unsigned wrap_width = 0,
2219 template <
typename POD>
2226 template <
typename POD>
2271 return hex_decode(*
this, ignore_spaces, alloc);
2287 void reserve(
size_t wanna_headroom,
size_t wanna_tailroom) {
2288 wanna_headroom = ::std::min(
2289 ::std::max(
headroom(), wanna_headroom),
2291 wanna_tailroom = ::std::min(
2292 ::std::max(
tailroom(), wanna_tailroom),
2294 const size_t wanna_capacity = check_length(wanna_headroom,
length(), wanna_tailroom);
2295 silo_.resize(wanna_capacity, wanna_headroom, *
this);
2318 const auto pair = silo::exchange(silo_,
asset(), other.silo_, other.asset());
2321 fixup_imported_inplace(other.silo_.bin_);
2323 other.fixup_imported_inplace(silo_.bin_);
2336 allocator_traits::select_on_container_copy_construction(
get_allocator()));
2344 if MDBX_IF_CONSTEXPR (!allocation_aware_details::template allocator_is_always_equal<allocator_type>()) {
2345 if (
MDBX_UNLIKELY(silo_.get_allocator() != src.silo_.get_allocator()))
2346 MDBX_CXX20_UNLIKELY {
2352 iov_base = silo_.template reshape<true>(whole_capacity,
headroom, src.
data(), src.
length());
2356 iov_base = silo_.template reshape<false>(whole_capacity,
headroom, src.
data(), src.
length());
2365 if MDBX_IF_CONSTEXPR (!allocation_aware_details::template allocator_is_always_equal<allocator_type>()) {
2366 if (
MDBX_UNLIKELY(silo_.get_allocator() != src.silo_.get_allocator()))
2367 MDBX_CXX20_UNLIKELY {
2373 if (make_reference) {
2375 iov_base = src.iov_base;
2377 iov_base = silo_.template reshape<true>(src.
length(), 0, src.
data(), src.
length());
2389 const auto kind = src.
asset();
2391 if (!move_assign_alloc::is_moveable(&silo_, src.silo_) && kind == modality::allocated) {
2392 iov_base = silo_.template reshape<true>(src.silo_.capacity(), src.
headroom(), src.
data(), src.
length());
2396 move_assign_alloc::propagate(&silo_, src.silo_);
2397 if (silo_.move_content(src.silo_, kind))
2398 fixup_imported_inplace(src.silo_.bin_);
2412 return assign(src.iov_base, src.iov_len, make_reference);
2422 assign(src.iov_base, src.iov_len, make_reference);
2423 src.iov_base =
nullptr;
2428 return assign(begin,
static_cast<const byte *
>(
end) -
static_cast<const byte *
>(begin), make_reference);
2431 template <
class CHAR,
class T,
class A>
2432 buffer &
assign(const ::std::basic_string<CHAR, T, A> &str,
bool make_reference =
false) {
2433 return assign(str.data(), str.length(), make_reference);
2437 return assign(c_str, strlen(c_str), make_reference);
2440#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
2441 template <
class CHAR,
class T>
2442 buffer &assign(const ::std::basic_string_view<CHAR, T> &view,
bool make_reference =
false) {
2443 return assign(view.data(), view.length(), make_reference);
2446 template <
class CHAR,
class T> buffer &assign(::std::basic_string_view<CHAR, T> &&view,
bool make_reference =
false) {
2447 assign(view.data(), view.length(), make_reference);
2461#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2462 template <
class CHAR,
class T>
buffer &
operator=(const ::std::basic_string_view<CHAR, T> &view)
noexcept {
2463 return assign(view.begin(), view.length());
2466 template <
class CHAR,
class T>
buffer &
append(const ::std::basic_string_view<CHAR, T> &view) {
2467 return append(view.data(), view.size());
2471 template <
class CHAR,
class T,
class A>
2476 template <
class CHAR,
class T,
class A>
buffer &
append(const ::std::basic_string<CHAR, T, A> &str) {
2477 return append(str.data(), str.size());
2520 const size_t wanna_bytes = producer.envisage_result_length();
2527 const size_t wanna_bytes = producer.envisage_result_length();
2571 ptr[0] = uint8_t(u16);
2572 ptr[1] = uint8_t(u16 >> 8);
2581 ptr[0] = uint8_t(u24);
2582 ptr[1] = uint8_t(u24 >> 8);
2583 ptr[2] = uint8_t(u24 >> 16);
2592 ptr[0] = uint8_t(u32);
2593 ptr[1] = uint8_t(u32 >> 8);
2594 ptr[2] = uint8_t(u32 >> 16);
2595 ptr[3] = uint8_t(u32 >> 24);
2604 ptr[0] = uint8_t(u48);
2605 ptr[1] = uint8_t(u48 >> 8);
2606 ptr[2] = uint8_t(u48 >> 16);
2607 ptr[3] = uint8_t(u48 >> 24);
2608 ptr[4] = uint8_t(u48 >> 32);
2609 ptr[5] = uint8_t(u48 >> 40);
2618 ptr[0] = uint8_t(u64);
2619 ptr[1] = uint8_t(u64 >> 8);
2620 ptr[2] = uint8_t(u64 >> 16);
2621 ptr[3] = uint8_t(u64 >> 24);
2622 ptr[4] = uint8_t(u64 >> 32);
2623 ptr[5] = uint8_t(u64 >> 40);
2624 ptr[6] = uint8_t(u64 >> 48);
2625 ptr[7] = uint8_t(u64 >> 56);
2632 template <
size_t SIZE>
static buffer key_from(
const char (&text)[SIZE],
bool make_reference =
true) {
2636#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
2637 template <
class CHAR,
class T>
2638 static buffer key_from(const ::std::basic_string_view<CHAR, T> &src,
bool make_reference =
false) {
2639 return buffer(src, make_reference);
2645 template <
class CHAR,
class T,
class A>
2646 static buffer key_from(const ::std::basic_string<CHAR, T, A> &src,
bool make_reference =
false) {
2647 return buffer(src, make_reference);
2692 using stl_pair = ::std::pair<buffer_type, buffer_type>;
2735 key.assign(std::move(src.key));
2736 value.assign(std::move(src.value));
2746 key.assign(std::move(src.key));
2747 value.assign(std::move(src.value));
2751 key.assign(src.first);
2752 value.assign(src.second);
2756 key.assign(std::move(src.first));
2757 value.assign(std::move(src.second));
2764 return key.is_freestanding() &&
value.is_freestanding();
2769 return key.is_reference() ||
value.is_reference();
2775 key.make_freestanding();
2776 value.make_freestanding();
2797 mdbx::memcpy(
this, &ce,
sizeof(*
this));
2853#if CONSTEXPR_ENUM_FLAGS_OPERATIONS || defined(DOXYGEN)
2935 operator bool() const noexcept {
return dbi != 0; }
2938#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L
2940 return a.dbi <=> b.dbi;
2944 return a.dbi == b.dbi;
2947 return a.dbi < b.dbi;
2950 return a.dbi > b.dbi;
2953 return a.dbi <= b.dbi;
2956 return a.dbi >= b.dbi;
2959 return a.dbi != b.dbi;
3007 env &operator=(const
env &) noexcept = default;
3008 inline
env &operator=(
env &&) noexcept;
3009 inline
env(
env &&) noexcept;
3010 inline ~
env() noexcept;
3035#if INTPTR_MAX > 0x7fffFFFFl
3043#if INTPTR_MAX > 0x7fffFFFFl
3089 inline geometry &make_fixed(intptr_t size)
noexcept;
3090 inline geometry &make_dynamic(intptr_t lower = default_value, intptr_t upper = default_value)
noexcept;
3178 bool use_subdirectory =
false
3214 static inline
size_t dbsize_min(intptr_t pagesize);
3216 static inline
size_t dbsize_max(intptr_t pagesize);
3295#ifdef MDBX_STD_FILESYSTEM_PATH
3298#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3299 env &
copy(const ::std::wstring &destination,
bool compactify,
bool force_dynamic_size =
false);
3300 env &
copy(
const wchar_t *destination,
bool compactify,
bool force_dynamic_size =
false);
3302 env &
copy(const ::std::string &destination,
bool compactify,
bool force_dynamic_size =
false);
3303 env &
copy(
const char *destination,
bool compactify,
bool force_dynamic_size =
false);
3325#ifdef MDBX_STD_FILESYSTEM_PATH
3328#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3348 inline info get_info()
const;
3351 inline stat get_stat(
const txn &)
const;
3354 inline info get_info(
const txn &)
const;
3379 inline unsigned max_readers()
const;
3383 inline unsigned max_maps()
const;
3386 inline void *get_context() const noexcept;
3389 inline
env &set_context(
void *your_context);
3405 inline
env &set_sync_threshold(
size_t bytes);
3412 inline
size_t sync_threshold() const;
3414#if __cplusplus >= 201103L || defined(DOXYGEN)
3515 inline env &set_extra_option(extra_runtime_option option, uint64_t value);
3518 inline uint64_t extra_option(extra_runtime_option option)
const;
3524 inline env &set_geometry(
const geometry &size);
3529 inline bool sync_to_disk(
bool force =
true,
bool nonblock =
false);
3578 size_t used,
size_t retained)
noexcept;
3644 using inherited =
env;
3653#ifdef MDBX_STD_FILESYSTEM_PATH
3656#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3675#ifdef MDBX_STD_FILESYSTEM_PATH
3677 bool accede =
true);
3679#if defined(_WIN32) || defined(_WIN64) || defined(DOXYGEN)
3681 bool accede =
true);
3683 bool accede =
true);
3726 txn &operator=(const
txn &) noexcept = default;
3727 inline
txn &operator=(
txn &&) noexcept;
3728 inline
txn(
txn &&) noexcept;
3729 inline ~
txn() noexcept;
3740 inline ::mdbx::env
env() const noexcept;
3744 inline uint64_t
id() const;
3747 inline
void *get_context() const noexcept;
3750 inline
txn &set_context(
void *your_context);
3753 inline
bool is_dirty(const
void *ptr) const;
3766 inline info get_info(
bool scan_reader_lock_table =
false)
const;
3775 return size_t(
get_info().txn_space_dirty);
3781 inline void reset_reading();
3784 inline void renew_reading();
3787 inline txn_managed clone(
void *context =
nullptr)
const;
3790 inline void clone(
txn_managed &txn_for_renew_into_clone,
void *context =
nullptr)
const;
3793 inline void make_broken();
3796 inline void park_reading(
bool autounpark =
true);
3800 inline bool unpark_reading(
bool restart_if_ousted =
true);
3831 inline map_handle open_map_accede(
const char *name)
const;
3833 inline map_handle open_map_accede(const ::std::string &name)
const;
3852 bool drop_map(
const char *name,
bool throw_if_absent =
false);
3856 inline bool drop_map(const ::std::string &name,
bool throw_if_absent =
false);
3866 bool clear_map(
const char *name,
bool throw_if_absent =
false);
3869 inline bool clear_map(const ::std::string &name,
bool throw_if_absent =
false);
3883 bool rename_map(
const char *old_name,
const char *new_name,
bool throw_if_absent =
false);
3887 bool rename_map(const ::std::string &old_name, const ::std::string &new_name,
bool throw_if_absent =
false);
3893#if defined(DOXYGEN) || (defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L)
3911 bool drop_map(const ::std::string_view &name,
bool throw_if_absent =
false) {
3916 bool clear_map(const ::std::string_view &name,
bool throw_if_absent =
false) {
3924 bool rename_map(const ::std::string_view &old_name, const ::std::string_view &new_name,
3925 bool throw_if_absent =
false) {
4006 template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4013 template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4019 template <
class ALLOCATOR,
typename CAPACITY_POLICY>
4041 inline void append(
map_handle map,
const slice &key,
const slice &value,
bool multivalue_order_preserved =
true);
4043 return append(map, kv.
key, kv.
value, multivalue_order_preserved);
4046 inline size_t put_multiple_samelength(
map_handle map,
const slice &key,
const size_t value_length,
4047 const void *values_array,
size_t values_count,
put_mode mode,
4048 bool allow_partial =
false);
4049 template <
typename VALUE>
4051 put_mode mode,
bool allow_partial =
false) {
4052 static_assert(::std::is_standard_layout<VALUE>::value && !::std::is_pointer<VALUE>::value &&
4053 !::std::is_array<VALUE>::value,
4054 "Must be a standard layout type!");
4057 template <
typename VALUE>
4064 inline ptrdiff_t estimate_from_first(
map_handle map,
const slice &to)
const;
4065 inline ptrdiff_t estimate_to_last(
map_handle map,
const slice &from)
const;
4077 using inherited =
txn;
4085 txn_managed(txn_managed &&) = default;
4086 txn_managed &operator=(txn_managed &&other) noexcept;
4087 txn_managed(const txn_managed &) = delete;
4088 txn_managed &operator=(const txn_managed &) = delete;
4133 return std::make_pair(result, latency);
4172 inline ~
cursor() noexcept;
4181 return a.handle_ == b.handle_;
4184 return a.handle_ != b.handle_;
4211 inline void *get_context() const noexcept;
4214 inline
cursor &set_context(
void *your_context);
4276 bool throw_notfound);
4299 template <
typename CALLABLE_PREDICATE>
4302 static int probe(
void *context,
MDBX_val *key,
MDBX_val *value,
void *arg)
noexcept {
4303 auto thunk =
static_cast<wrapper *
>(context);
4304 assert(thunk->is_clean());
4305 auto &predicate = *
static_cast<CALLABLE_PREDICATE *
>(arg);
4319 template <
typename CALLABLE_PREDICATE>
bool fullscan(CALLABLE_PREDICATE predicate,
bool backward =
false) {
4323 template <
typename CALLABLE_PREDICATE>
4327 static int probe(
void *context,
MDBX_val *key,
MDBX_val *value,
void *arg)
noexcept {
4328 auto thunk =
static_cast<wrapper *
>(context);
4329 assert(thunk->is_clean());
4330 auto &predicate = *
static_cast<CALLABLE_PREDICATE *
>(arg);
4344 template <
typename CALLABLE_PREDICATE>
4348 static int probe(
void *context,
MDBX_val *key,
MDBX_val *value,
void *arg)
noexcept {
4349 auto thunk =
static_cast<wrapper *
>(context);
4350 assert(thunk->is_clean());
4351 auto &predicate = *
static_cast<CALLABLE_PREDICATE *
>(arg);
4366 return move_result(*
this, operation, throw_notfound);
4372 return move_result(*
this, operation, key, value, throw_notfound);
4375 return move(operation, &key, &value, throw_notfound);
4454 inline bool seek(
const slice &key);
4455 inline move_result find(
const slice &key,
bool throw_notfound =
true);
4456 inline move_result lower_bound(
const slice &key,
bool throw_notfound =
false);
4457 inline move_result upper_bound(
const slice &key,
bool throw_notfound =
false);
4460 inline size_t count_multivalue()
const;
4462 inline move_result find_multivalue(
const slice &key,
const slice &value,
bool throw_notfound =
true);
4463 inline move_result lower_bound_multivalue(
const slice &key,
const slice &value,
bool throw_notfound =
false);
4464 inline move_result upper_bound_multivalue(
const slice &key,
const slice &value,
bool throw_notfound =
false);
4482 inline bool eof()
const;
4483 inline bool on_first()
const;
4484 inline bool on_last()
const;
4485 inline bool on_first_multival()
const;
4486 inline bool on_last_multival()
const;
4489 inline estimate_result
estimate(move_operation operation)
const;
4493 unsigned deepness = 42);
4495 unsigned deepness = 42)
const {
4508 inline bool scroll(intptr_t distable,
unsigned deepness = 42,
4509 bool throw_notfound =
true);
4511 static inline bool distribute(
const cursor from,
const cursor to,
cursor *cursors_array, intptr_t cursors_array_size,
4512 unsigned deepness = 42);
4514 static inline bool distribute(
const cursor from,
const cursor to,
const std::vector<cursor> &cursors,
4515 unsigned deepness = 42);
4517 static inline bool distribute(
const cursor from,
const cursor to,
const std::vector<cursor_managed> &cursors,
4518 unsigned deepness = 42);
4529 inline void unbind();
4532 inline ::mdbx::txn
txn()
const;
4535 inline operator ::mdbx::txn()
const {
return txn(); }
4536 inline operator ::mdbx::map_handle()
const {
return map(); }
4540 inline void insert(
const slice &key,
slice value);
4542 inline slice insert_reserve(
const slice &key,
size_t value_length);
4546 inline slice upsert_reserve(
const slice &key,
size_t value_length);
4564 inline bool erase(
bool whole_multivalue =
false);
4568 inline bool erase(
const slice &key,
bool whole_multivalue =
true);
4572 inline bool erase(
const slice &key,
const slice &value);
4574 inline size_t put_multiple_samelength(
const slice &key,
const size_t value_length,
const void *values_array,
4575 size_t values_count,
put_mode mode,
bool allow_partial =
false);
4576 template <
typename VALUE>
4578 bool allow_partial =
false) {
4579 static_assert(::std::is_standard_layout<VALUE>::value && !::std::is_pointer<VALUE>::value &&
4580 !::std::is_array<VALUE>::value,
4581 "Must be a standard layout type!");
4584 template <
typename VALUE>
4598 using inherited =
cursor;
4636#if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
4637 if (::std::is_constant_evaluated()) {
4645#if defined(__cpp_lib_string_view) && __cpp_lib_string_view >= 201606L
4646 return c_str ? ::std::string_view(c_str).length() : 0;
4648 return c_str ? ::std::strlen(c_str) : 0;
4653#if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
4654 if (::std::is_constant_evaluated()) {
4655 for (
size_t i = 0; i < bytes; ++i)
4656 static_cast<byte *
>(dest)[i] =
static_cast<const byte *
>(src)[i];
4660 return ::std::memcpy(dest, src, bytes);
4664#if defined(__cpp_lib_is_constant_evaluated) && __cpp_lib_is_constant_evaluated >= 201811L
4665 if (::std::is_constant_evaluated()) {
4666 for (
size_t i = 0; i < bytes; ++i) {
4667 const int diff = int(
static_cast<const byte *
>(a)[i]) - int(
static_cast<const byte *
>(b)[i]);
4674 return ::std::memcmp(a, b, bytes);
4694 captured_ = ::std::current_exception();
4699 MDBX_CXX20_UNLIKELY ::std::rethrow_exception(captured_);
4757 MDBX_CXX20_UNLIKELY
error(error_code).throw_exception();
4766 error rc(error_code);
4771 switch (error_code) {
4795 : ::
MDBX_val({
const_cast<void *
>(ptr), check_length(
bytes)}) {}
4798 :
slice(begin, static_cast<const
byte *>(
end) - static_cast<const
byte *>(begin)) {}
4809 iov_base =
const_cast<void *
>(ptr);
4810 iov_len = check_length(
bytes);
4815 iov_base = src.iov_base;
4816 iov_len = src.iov_len;
4829 assign(src.iov_base, src.iov_len);
4830 src.iov_base =
nullptr;
4835 return assign(begin,
static_cast<const byte *
>(
end) -
static_cast<const byte *
>(begin));
4871 iov_len = check_length(
bytes);
4896 assert(n <=
size());
4897 iov_base =
static_cast<byte *
>(iov_base) + n;
4908 assert(n <=
size());
4919 return length() >= prefix.length() && memcmp(
data(), prefix.data(), prefix.length()) == 0;
4923 return length() >= suffix.length() &&
4924 memcmp(
byte_ptr() +
length() - suffix.length(), suffix.data(), suffix.length()) == 0;
4928 size_t h =
length() * 3977471;
4929 for (
size_t i = 0; i <
length(); ++i)
4930 h = (h ^
static_cast<const uint8_t *
>(
data())[i]) * 1664525 + 1013904223;
4931 return h ^ 3863194411 * (h >> 11);
4981 const intptr_t diff = intptr_t(a.length()) - intptr_t(b.length());
4983 :
MDBX_UNLIKELY(a.length() == 0 || a.data() == b.data()) ? 0
4984 : memcmp(a.data(), b.data(), a.length());
4988 const size_t shortest = ::std::min(a.length(), b.length());
4991 const intptr_t diff = memcmp(a.data(), b.data(), shortest);
4995 return intptr_t(a.length()) - intptr_t(b.length());
5022#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L
5025 return (cmp < 0) ? std::strong_ordering::less
5026 : (cmp > 0) ? std::strong_ordering::greater
5027 :
std::strong_ordering::equal;
5031template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5035 if (!make_reference)
5039template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5042 :
buffer(src, !transaction.is_dirty(src.
data()), alloc) {}
5044template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5049#if !(defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)) || defined(LIBMDBX_EXPORTS)
5052#if MDBX_CXX_HAS_POLYMORPHIC_ALLOCATOR
5062template <
class ALLOCATOR,
class CAPACITY_POLICY, MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER)>
5073template <
class ALLOCATOR,
class CAPACITY_POLICY, MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER)>
5084template <
class ALLOCATOR, MDBX_CXX20_CONCEPT(MutableByteProducer, PRODUCER)>
5089 result.resize(producer.envisage_result_length());
5090 result.resize(producer.write_bytes(
const_cast<char *
>(result.data()), result.capacity()) - result.data());
5095template <
class ALLOCATOR, MDBX_CXX20_CONCEPT(ImmutableByteProducer, PRODUCER)>
5100 result.resize(producer.envisage_result_length());
5101 result.resize(producer.write_bytes(
const_cast<char *
>(result.data()), result.capacity()) - result.data());
5110template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5119template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5128template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5137template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5146template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5155template <
class ALLOCATOR,
typename CAPACITY_POLICY>
5160template <
class ALLOCATOR>
5162 return to_hex(*
this, uppercase, wrap_width).
as_string<ALLOCATOR>(alloc);
5165template <
class ALLOCATOR>
5170template <
class ALLOCATOR>
5175template <
class ALLOCATOR,
class CAPACITY_POLICY>
5177 const ALLOCATOR &alloc)
const {
5178 return to_hex(*
this, uppercase, wrap_width).
as_buffer<ALLOCATOR, CAPACITY_POLICY>(alloc);
5181template <
class ALLOCATOR,
class CAPACITY_POLICY>
5186template <
class ALLOCATOR,
class CAPACITY_POLICY>
5191template <
class ALLOCATOR,
class CAPACITY_POLICY>
5193 return from_hex(*
this, ignore_spaces).
as_buffer<ALLOCATOR, CAPACITY_POLICY>(alloc);
5196template <
class ALLOCATOR,
class CAPACITY_POLICY>
5201template <
class ALLOCATOR,
class CAPACITY_POLICY>
5219 return a.key.length() == b.key.length() && a.value.length() == b.value.length() &&
5220 memcmp(a.key.data(), b.key.data(), a.key.length()) == 0 &&
5221 memcmp(a.value.data(), b.value.data(), a.value.length()) == 0;
5241 return a.key.length() != b.key.length() || a.value.length() != b.value.length() ||
5242 memcmp(a.key.data(), b.key.data(), a.key.length()) != 0 ||
5243 memcmp(a.value.data(), b.value.data(), a.value.length()) != 0;
5246#if defined(__cpp_impl_three_way_comparison) && __cpp_impl_three_way_comparison >= 201907L
5253template <
typename BUFFER>
5282 if (
this != &other) {
5284 other.handle_ =
nullptr;
5292#if (defined(MDBX_CHECKING) && MDBX_CHECKING > 0) || (defined(MDBX_DEBUG) && MDBX_DEBUG > 0)
5326 return static_cast<size_t>(result);
5333 return static_cast<size_t>(result);
5344 return static_cast<size_t>(result);
5355 return static_cast<size_t>(result);
5368 return static_cast<size_t>(result);
5379 return static_cast<size_t>(result);
5388 return static_cast<size_t>(result);
5399 return static_cast<size_t>(result);
5410 return static_cast<size_t>(result);
5421 return static_cast<size_t>(result);
5432 return static_cast<size_t>(result);
5531 unsigned seconds_16dot16;
5533 return seconds_16dot16;
5542#if __cplusplus >= 201103L
5587 size_t retained) noexcept
5595 size_t used,
size_t retained)
noexcept {
5596 reader_visitor_thunk *thunk =
static_cast<reader_visitor_thunk *
>(ctx);
5597 assert(thunk->is_clean());
5608 reader_visitor_thunk thunk(visitor);
5610 thunk.rethrow_captured();
5618 return static_cast<unsigned>(dead_count);
5662 if (
this != &other) {
5664 other.handle_ =
nullptr;
5672#if (defined(MDBX_CHECKING) && MDBX_CHECKING > 0) || (defined(MDBX_DEBUG) && MDBX_DEBUG > 0)
5850 unsigned flags, state;
5883 return ::mdbx_dcmp(
handle_, map.
dbi, &a, &b);
5913 return value_at_absence;
5926 return value_at_absence;
5975 const int err =
put(map, key, &value ,
5988 slice result(
nullptr, value_length);
5997 slice result(
nullptr, value_length);
6000 const int err =
put(map, key, &result ,
6019 slice result(
nullptr, value_length);
6047 slice result(
nullptr, value_length);
6055 slice result(
nullptr, value_length);
6098template <
class ALLOCATOR,
typename CAPACITY_POLICY>
6102 typename buffer<ALLOCATOR, CAPACITY_POLICY>::data_preserver result(alloc);
6108template <
class ALLOCATOR,
typename CAPACITY_POLICY>
6112 typename buffer<ALLOCATOR, CAPACITY_POLICY>::data_preserver result(alloc);
6119template <
class ALLOCATOR,
typename CAPACITY_POLICY>
6123 typename buffer<ALLOCATOR, CAPACITY_POLICY>::data_preserver result(alloc);
6136 const void *values_array,
size_t values_count,
put_mode mode,
6137 bool allow_partial) {
6138 MDBX_val args[2] = {{
const_cast<void *
>(values_array), value_length}, {
nullptr, values_count}};
6151 return args[1].iov_len ;
6186 if (
this != &other) {
6188 other.handle_ =
nullptr;
6196#if (defined(MDBX_CHECKING) && MDBX_CHECKING > 0) || (defined(MDBX_DEBUG) && MDBX_DEBUG > 0)
6226 bool throw_notfound)
6228 this->
done =
cursor.move(operation, &this->key, &this->value, throw_notfound);
6239 if (!throw_notfound)
6329 return ::mdbx::txn(
txn);
6366 slice result(
nullptr, value_length);
6373 slice result(
nullptr, value_length);
6374 const int err =
put(key, &result ,
6391 slice result(
nullptr, value_length);
6413 slice result(
nullptr, value_length);
6419 slice result(
nullptr, value_length);
6444 bool found =
seek(key);
6445 return found ?
erase(whole_multivalue) : found;
6454 size_t values_count,
put_mode mode,
bool allow_partial) {
6455 MDBX_val args[2] = {{
const_cast<void *
>(values_array), value_length}, {
nullptr, values_count}};
6468 return args[1].iov_len ;
6472 intptr_t distance = PTRDIFF_MIN;
6477inline bool cursor::scroll(intptr_t distance,
unsigned deepness,
bool throw_notfound) {
6483 if (!throw_notfound)
6492 unsigned deepness) {
6493 static_assert(
sizeof(cursors_array[0]) ==
sizeof(
MDBX_cursor *),
"oops");
6499 unsigned deepness) {
6502 cursors_array.size(), deepness);
6507 unsigned deepness) {
6510 cursors_array.size(), deepness);
6550template <
class ALLOCATOR,
typename CAPACITY_POLICY>
6551inline string to_string(const ::mdbx::buffer<ALLOCATOR, CAPACITY_POLICY> &buffer) {
6563inline string to_string(const ::mdbx::env::geometry &value) {
6569inline string to_string(const ::mdbx::env::operate_parameters &value) {
6581inline string to_string(const ::mdbx::env::durability &value) {
6587inline string to_string(const ::mdbx::env::reclaiming_options &value) {
6593inline string to_string(const ::mdbx::env::operate_options &value) {
6599inline string to_string(const ::mdbx::env_managed::create_parameters &value) {
6633template <>
struct hash<::
mdbx::env> :
public std::hash<const MDBX_env *> {
6635 size_t operator()(const ::mdbx::env &env)
const noexcept {
return inherited::operator()(env); }
6638template <>
struct hash<::
mdbx::txn> :
public std::hash<const MDBX_txn *> {
6640 size_t operator()(const ::mdbx::txn &txn)
const noexcept {
return inherited::operator()(txn); }
6643template <>
struct hash<::
mdbx::cursor> :
public std::hash<const MDBX_cursor *> {
6645 size_t operator()(const ::mdbx::cursor &cursor)
const noexcept {
return inherited::operator()(cursor); }
6648template <
class ALLOCATOR,
typename CAPACITY_POLICY>
struct hash<::
mdbx::buffer<ALLOCATOR, CAPACITY_POLICY>> {
6650 return buffer.hash_value();
6656#if defined(__LCC__) && __LCC__ >= 126
6657#pragma diagnostic pop
#define MDBX_CXX11_CONSTEXPR
Definition mdbx.h:458
#define MDBX_LIKELY(cond)
Definition mdbx.h:590
#define MDBX_MAYBE_UNUSED
Definition mdbx.h:524
#define MDBX_INLINE_API_ASSERT(expr)
Definition mdbx.h:605
#define MDBX_UNLIKELY(cond)
Definition mdbx.h:598
#define MDBX_CXX14_CONSTEXPR
Definition mdbx.h:477
#define MDBX_NOTHROW_PURE_FUNCTION
The pure nothrow function attribute for optimization.
Definition mdbx.h:274
mode_t mdbx_mode_t
Definition mdbx.h:187
#define LIBMDBX_API
Definition mdbx.h:634
#define LIBMDBX_API_TYPE
Definition mdbx.h:649
struct iovec MDBX_val
Generic structure used for passing keys and data in and out of the table. .
Definition mdbx.h:808
pthread_t mdbx_tid_t
Definition mdbx.h:186
struct MDBX_env MDBX_env
Opaque structure for a database environment.
Definition mdbx.h:741
int mdbx_filehandle_t
Definition mdbx.h:184
pid_t mdbx_pid_t
Definition mdbx.h:185
@ MDBX_MAX_PAGESIZE
Definition mdbx.h:822
@ MDBX_MAXDATASIZE
Definition mdbx.h:816
@ MDBX_MAX_DBI
Definition mdbx.h:813
@ MDBX_MIN_PAGESIZE
Definition mdbx.h:819
libmdbx build information
Definition mdbx.h:677
Lightweight transparent cache entry structure used by mdbx_cache_get().
Definition mdbx.h:5263
The fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h:4756
Latency of commit stages in 1/65536 of seconds units.
Definition mdbx.h:4162
Information about the environment.
Definition mdbx.h:2856
Statistics for a table in the environment.
Definition mdbx.h:2810
Information about the transaction.
Definition mdbx.h:4060
libmdbx version information,
Definition mdbx.h:659
LIBMDBX_API int mdbx_cursor_del(MDBX_cursor *cursor, MDBX_put_flags_t flags)
Delete current key/data pair.
int(* MDBX_preserve_func)(void *context, MDBX_val *target, const void *src, size_t bytes)
A data preservation callback for using within mdbx_replace_ex().
Definition mdbx.h:5556
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_cursor_scan(MDBX_cursor *cursor, MDBX_predicate_func predicate, void *context, MDBX_cursor_op start_op, MDBX_cursor_op turn_op, void *arg)
Scans the table using the passed predicate, reducing the associated overhead.
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_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:1653
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)
Replaces item in a table using preservation callback for an original data.
LIBMDBX_API int mdbx_cursor_count(const MDBX_cursor *cursor, size_t *count)
Return count values (aka duplicates) for current key.
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:4816
void mdbx_cache_init(MDBX_cache_entry_t *entry)
Initializes the cache entry before the first use.
Definition mdbx.h:5277
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_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)
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:1690
@ MDBX_ALLDUPS
Definition mdbx.h:1673
@ MDBX_CURRENT
Definition mdbx.h:1668
@ MDBX_APPENDDUP
Definition mdbx.h:1686
@ MDBX_APPEND
Definition mdbx.h:1681
@ MDBX_UPSERT
Definition mdbx.h:1655
@ MDBX_RESERVE
Definition mdbx.h:1677
@ MDBX_NOOVERWRITE
Definition mdbx.h:1658
LIBMDBX_API int mdbx_cursor_on_first_dup(const MDBX_cursor *cursor)
Determines whether the cursor is on the first or single multi-value corresponding to the key.
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:1734
LIBMDBX_API int mdbx_cursor_compare(const MDBX_cursor *left, const MDBX_cursor *right, bool ignore_multival)
Compares the position of the cursors.
LIBMDBX_API int mdbx_cursor_on_last_dup(const MDBX_cursor *cursor)
Determines whether the cursor is on the last or single multi-value corresponding to the key.
LIBMDBX_API int mdbx_cursor_distribute(const MDBX_cursor *first, const MDBX_cursor *last, MDBX_cursor **array, intptr_t count, unsigned deepness)
Distributes cursors for multithreaded range scanning.
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:771
LIBMDBX_API int mdbx_cursor_set_userctx(MDBX_cursor *cursor, void *ctx)
Set application information associated with the cursor.
LIBMDBX_API int mdbx_cursor_distance(const MDBX_cursor *first, const MDBX_cursor *last, intptr_t *distance, unsigned deepness)
Calculates the distance between the cursors at the specified B-tree level.
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_scroll(MDBX_cursor *cursor, intptr_t amount, unsigned deepness)
Scrolls the cursor to the specified number of positions at the specified B-tree level.
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 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:1853
@ MDBX_GET_CURRENT
Definition mdbx.h:1749
@ MDBX_GET_BOTH
Definition mdbx.h:1742
@ MDBX_TO_KEY_EQUAL
Definition mdbx.h:1830
@ MDBX_GET_BOTH_RANGE
Definition mdbx.h:1746
@ MDBX_SET_KEY
Definition mdbx.h:1789
@ MDBX_FIRST_DUP
Definition mdbx.h:1739
@ MDBX_TO_KEY_LESSER_OR_EQUAL
Definition mdbx.h:1829
@ MDBX_GET_MULTIPLE
Definition mdbx.h:1754
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN
Definition mdbx.h:1840
@ MDBX_NEXT_NODUP
Definition mdbx.h:1774
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL
Definition mdbx.h:1837
@ MDBX_TO_EXACT_KEY_VALUE_EQUAL
Definition mdbx.h:1838
@ MDBX_TO_PAIR_LESSER_OR_EQUAL
Definition mdbx.h:1845
@ MDBX_PREV_MULTIPLE
Definition mdbx.h:1797
@ MDBX_SET_RANGE
Definition mdbx.h:1792
@ MDBX_LAST_DUP
Definition mdbx.h:1760
@ MDBX_PREV
Definition mdbx.h:1777
@ MDBX_TO_PAIR_GREATER_OR_EQUAL
Definition mdbx.h:1847
@ MDBX_TO_PAIR_GREATER_THAN
Definition mdbx.h:1848
@ MDBX_LAST
Definition mdbx.h:1757
@ MDBX_TO_KEY_LESSER_THAN
Definition mdbx.h:1828
@ MDBX_PREV_DUP
Definition mdbx.h:1780
@ MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN
Definition mdbx.h:1836
@ MDBX_SET
Definition mdbx.h:1786
@ MDBX_NEXT
Definition mdbx.h:1763
@ MDBX_TO_KEY_GREATER_OR_EQUAL
Definition mdbx.h:1831
@ MDBX_TO_PAIR_LESSER_THAN
Definition mdbx.h:1844
@ MDBX_NEXT_MULTIPLE
Definition mdbx.h:1771
@ MDBX_PREV_NODUP
Definition mdbx.h:1783
@ MDBX_TO_PAIR_EQUAL
Definition mdbx.h:1846
@ MDBX_NEXT_DUP
Definition mdbx.h:1766
@ MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL
Definition mdbx.h:1839
@ MDBX_TO_KEY_GREATER_THAN
Definition mdbx.h:1832
@ MDBX_FIRST
Definition mdbx.h:1736
LIBMDBX_API int mdbx_dbi_rename(MDBX_txn *txn, MDBX_dbi dbi, const char *name)
Renames the table using the DBI descriptor.
LIBMDBX_API int mdbx_dbi_rename2(MDBX_txn *txn, MDBX_dbi dbi, const MDBX_val *name)
Renames the table using the DBI descriptor.
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:764
MDBX_db_flags_t
Table flags.
Definition mdbx.h:1603
@ MDBX_INTEGERDUP
Definition mdbx.h:1627
@ MDBX_DB_ACCEDE
Definition mdbx.h:1645
@ MDBX_DB_DEFAULTS
Definition mdbx.h:1605
@ MDBX_REVERSEKEY
Definition mdbx.h:1608
@ MDBX_DUPFIXED
Definition mdbx.h:1622
@ MDBX_INTEGERKEY
Definition mdbx.h:1618
@ MDBX_REVERSEDUP
Definition mdbx.h:1630
@ MDBX_CREATE
Definition mdbx.h:1633
@ MDBX_DUPSORT
Definition mdbx.h:1611
MDBX_log_level_t
Definition mdbx.h:884
MDBX_debug_flags_t
Runtime debug flags.
Definition mdbx.h:942
MDBX_error_t
Errors and return codes.
Definition mdbx.h:1861
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:6983
@ MDBX_FIRST_LMDB_ERRCODE
Definition mdbx.h:1875
@ MDBX_BAD_TXN
Definition mdbx.h:1938
@ MDBX_LAST_LMDB_ERRCODE
Definition mdbx.h:1952
@ MDBX_SUCCESS
Definition mdbx.h:1863
@ MDBX_NOTFOUND
Definition mdbx.h:1878
@ MDBX_RESULT_TRUE
Definition mdbx.h:1869
@ MDBX_BUSY
Definition mdbx.h:1956
@ MDBX_EINVAL
Definition mdbx.h:2032
@ MDBX_ENOMEM
Definition mdbx.h:2034
@ MDBX_FIRST_ADDED_ERRCODE
Definition mdbx.h:1959
@ MDBX_RESULT_FALSE
Definition mdbx.h:1866
@ MDBX_LAST_ADDED_ERRCODE
Definition mdbx.h:2011
@ MDBX_KEYEXIST
Definition mdbx.h:1872
MDBX_env_flags_t
Environment flags.
Definition mdbx.h:1085
@ MDBX_WRITEMAP
Definition mdbx.h:1205
@ MDBX_EXCLUSIVE
Definition mdbx.h:1159
@ MDBX_RDONLY
Definition mdbx.h:1129
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:3101
MDBX_option_t
MDBX environment extra runtime options.
Definition mdbx.h:2135
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:3042
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:2240
@ MDBX_opt_subpage_room_threshold
Sets the minimum amount of free space on a leaf page in the absence of which the nested pages are pla...
Definition mdbx.h:2402
@ MDBX_opt_subpage_limit
Specifies the maximum size of nested pages used to accommodate a small number of multi-values associa...
Definition mdbx.h:2395
@ MDBX_opt_txn_dp_limit
Controls the in-process limit of dirty pages for a write transaction.
Definition mdbx.h:2236
@ MDBX_opt_prefer_waf_insteadof_balance
Controls the choice between striving for uniformity of page filling/density, either for reducing the ...
Definition mdbx.h:2381
@ 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:2340
@ MDBX_opt_max_db
Controls the maximum number of named tables for the environment.
Definition mdbx.h:2144
@ MDBX_opt_subpage_reserve_prereq
Sets the minimum amount of free space on the main page, if available, to reserve space in the subpage...
Definition mdbx.h:2416
@ MDBX_opt_sync_bytes
Controls interprocess/shared threshold to force flush the data buffers to disk, if MDBX_SAFE_NOSYNC i...
Definition mdbx.h:2167
@ MDBX_opt_spill_min_denominator
Controls the in-process how minimal part of the dirty pages should be spilled when necessary.
Definition mdbx.h:2272
@ 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:2295
@ MDBX_opt_split_reserve
Sets the space reservation in 1/65536 of page size when splitting page along the edge.
Definition mdbx.h:2444
@ 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:2207
@ 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:2194
@ MDBX_opt_max_readers
Defines the maximum number of threads/reader slots for all processes interacting with the database.
Definition mdbx.h:2161
@ MDBX_opt_subpage_reserve_limit
Sets the limit for reserving space on nested pages.
Definition mdbx.h:2422
@ MDBX_opt_spill_max_denominator
Controls the in-process how maximal part of the dirty pages may be spilled when necessary.
Definition mdbx.h:2256
@ MDBX_opt_sync_period
Controls interprocess/shared relative period since the last unsteady commit to force flush the data b...
Definition mdbx.h:2173
@ MDBX_opt_dp_reserve_limit
Controls the in-process limit of a pre-allocated memory items for dirty pages.
Definition mdbx.h:2221
@ MDBX_opt_writethrough_threshold
Controls the choosing between use write-through disk writes and usual ones with followed flush by the...
Definition mdbx.h:2335
@ MDBX_opt_gc_time_limit
Controls the in-process spending time limit of searching consecutive pages inside GC.
Definition mdbx.h:2359
@ MDBX_opt_merge_threshold
Controls the in-process threshold of semi-empty pages merge.
Definition mdbx.h:2307
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:3716
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:3121
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:3060
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:5078
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:3761
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 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_reader_list(const MDBX_env *env, MDBX_reader_list_func func, void *ctx)
Enumerate the entries in the reader lock table.
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_clone(const MDBX_txn *origin, MDBX_txn **in_out_clone, void *context)
Starts a read-only clone of a given transaction.
LIBMDBX_API int mdbx_txn_park(MDBX_txn *txn, bool autounpark)
Puts the reading transaction in a "parked" state.
LIBMDBX_API int mdbx_txn_unpark(MDBX_txn *txn, bool restart_if_ousted)
Unparks a previously parked reading transaction.
MDBX_txn_flags_t
Definition mdbx.h:1502
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:3977
struct MDBX_txn MDBX_txn
Opaque structure for a transaction handle.
Definition mdbx.h:752
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:1513
@ MDBX_TXN_RDONLY_PREPARE
Definition mdbx.h:1522
@ MDBX_TXN_READWRITE
Definition mdbx.h:1507
@ MDBX_TXN_TRY
Definition mdbx.h:1528
void commit(finalization_latency &latency)
ommits all changes of the transaction into a database with collecting latencies information.
Definition mdbx.h++:4113
constexpr const MDBX_env * handle() const noexcept
Definition mdbx.h++:3015
friend class env
Definition mdbx.h++:4078
env_managed(const char *pathname, const operate_parameters &, bool accede=true)
::MDBX_txn_info info
Definition mdbx.h++:3764
cursor_managed(void *your_context=nullptr)
Creates a new managed cursor with underlying object.
Definition mdbx.h++:4605
bool scan_until(CALLABLE_PREDICATE predicate, move_operation start=first, move_operation turn=next)
Definition mdbx.h++:4300
::MDBX_stat map_stat
Definition mdbx.h++:3930
bool drop_map(const slice &name, bool throw_if_absent=false)
Drop key-value map.
txn & operator=(const txn &) noexcept=default
env & set_sync_period(const duration &period)
Sets relative period since the last unsteady commit to force flush the data buffers to disk,...
bool amend(bool dont_wait=false)
Starts a writing transaction to amending data in the MVCC-snapshot used by the read-only transaction.
txn_managed start_nested()
Start nested write transaction.
extra_runtime_option
MDBX environment extra runtime options.
Definition mdbx.h++:3463
env_managed & operator=(env_managed &&other) noexcept
bool drop_map(const ::std::string_view &name, bool throw_if_absent=false)
Drop key-value map.
Definition mdbx.h++:3911
bool scan_until_from(CALLABLE_PREDICATE predicate, pair &from, move_operation start=pair_greater_or_equal, move_operation turn=next)
Definition mdbx.h++:4345
env_managed(const char *pathname, const create_parameters &, const operate_parameters &, bool accede=true)
map_handle(const map_handle &) noexcept=default
::MDBX_db_flags_t flags
Definition mdbx.h++:2962
move_result to_exact_key_value_lesser_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4422
move_result previous_multiple_samelength(bool throw_notfound=false)
Definition mdbx.h++:4478
friend constexpr bool operator==(const env &a, const env &b) noexcept
Definition mdbx.h++:3017
static bool remove(const ::std::wstring &pathname, const remove_mode mode=just_remove)
constexpr const MDBX_cursor * handle() const noexcept
Definition mdbx.h++:4178
constexpr txn() noexcept=default
constexpr map_handle() noexcept
Definition mdbx.h++:2931
durability
Durability level.
Definition mdbx.h++:3110
@ lazy_weak_tail
Definition mdbx.h++:3113
@ robust_synchronous
Definition mdbx.h++:3111
@ whole_fragile
Definition mdbx.h++:3114
@ half_synchronous_weak_last
Definition mdbx.h++:3112
friend constexpr bool operator!=(const cursor &a, const cursor &b) noexcept
Definition mdbx.h++:4183
void commit_embark_read()
Commits all the operations of a transaction into the database and then start read transaction.
friend constexpr bool operator!=(const map_handle &a, const map_handle &b) noexcept
Definition mdbx.h++:2958
size_t dbsize_min() const
Returns the minimal database size in bytes for the environment.
Definition mdbx.h++:3278
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...
move_result seek_multiple_samelength(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4466
bool checkpoint(finalization_latency &latency)
Commits all the operations of the transaction and immediately starts next without releasing any locks...
Definition mdbx.h++:4127
estimate_result estimate(move_operation operation, slice &key) const
constexpr cache_entry(const MDBX_cache_entry_t &ce) noexcept
Definition mdbx.h++:2795
cache_entry() noexcept
Definition mdbx.h++:2787
static bool remove(const char *pathname, const remove_mode mode=just_remove)
friend class cursor
Definition mdbx.h++:3719
move_result to_pair_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4441
ptrdiff_t distance_to_end(unsigned deepness=42) const
Definition mdbx.h++:4504
::MDBX_canary canary
Definition mdbx.h++:3939
std::pair< bool, finalization_latency > checkpoint_get_latency()
Commits all the operations of the transaction and immediately starts next without releasing any locks...
Definition mdbx.h++:4130
env & copy(const wchar_t *destination, bool compactify, bool force_dynamic_size=false)
bool is_readwrite() const
Checks whether the transaction is read-write.
Definition mdbx.h++:3762
void commit_embark_read(finalization_latency *latency)
Commits all the operations of a transaction into the database and then start read transaction.
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++:4371
friend constexpr bool operator!=(const txn &a, const txn &b) noexcept
Definition mdbx.h++:3737
void update_current(const slice &value)
Updates value associated with a key at the current cursor position.
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++:4435
bool clear_map(const char *name, bool throw_if_absent=false)
constexpr env() noexcept=default
move_result to_pair_exact(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4444
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.
constexpr cache_entry & operator=(const MDBX_cache_entry_t &ce) noexcept
Definition mdbx.h++:2796
env_managed(const ::mdbx::filesystem::path &pathname, const operate_parameters &, bool accede=true)
Open existing database.
void reset() noexcept
Definition mdbx.h++:2794
friend constexpr bool operator<=(const map_handle &a, const map_handle &b) noexcept
Definition mdbx.h++:2952
static bool remove(const ::std::string &pathname, const remove_mode mode=just_remove)
constexpr map_handle(MDBX_dbi dbi) noexcept
Definition mdbx.h++:2932
void put(const pair &kv, put_mode mode)
Definition mdbx.h++:4558
move_result current(bool throw_notfound=true) const
Definition mdbx.h++:4389
cursor_managed clone(void *your_context=nullptr) const
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++:4380
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.
cursor & operator=(const cursor &) noexcept=default
bool is_same_or_after_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4206
size_t unbind_all_cursors() const
Unbind all cursors.
Definition mdbx.h++:3818
void upsert(map_handle map, const pair &kv)
Definition mdbx.h++:3994
move_result to_key_greater_or_equal(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4412
bool is_same_position(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4198
bool is_after_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4202
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++:3903
constexpr MDBX_txn * handle() noexcept
Definition mdbx.h++:3735
static size_t default_pagesize() noexcept
Returns default page size for current system/platform.
Definition mdbx.h++:3205
move_result to_next_first_multi(bool throw_notfound=true)
Definition mdbx.h++:4396
MDBX_cursor * withdraw_handle() noexcept
Definition mdbx.h++:4616
MDBX_txn * handle_
Definition mdbx.h++:3720
void abort()
Abandon all the operations of the transaction instead of saving ones.
MDBX_commit_latency finalization_latency
Definition mdbx.h++:4092
const path_char * get_path() const
Return the path that was used for opening the environment.
move_result move(move_operation operation, const slice &key, bool throw_notfound)
Definition mdbx.h++:4368
mode
Operation mode.
Definition mdbx.h++:3102
@ write_mapped_io
Definition mdbx.h++:3105
@ nested_transactions
Definition mdbx.h++:3106
@ readonly
Definition mdbx.h++:3103
@ write_file_io
Definition mdbx.h++:3104
friend constexpr bool operator==(const cursor &a, const cursor &b) noexcept
Definition mdbx.h++:4180
bool is_writemap() const
Definition mdbx.h++:3371
move_result move(move_operation operation, bool throw_notfound)
Definition mdbx.h++:4365
::MDBX_envinfo info
Information about the environment.
Definition mdbx.h++:3339
operator::mdbx::txn() const
Definition mdbx.h++:4535
MDBX_env * handle_
Definition mdbx.h++:3001
slice reverse_current(size_t value_length)
Reserves and returns the space to storing a value associated with a key at the current cursor positio...
move_result to_exact_key_value_greater_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4428
bool is_same_or_before_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4194
move_result to_first(bool throw_notfound=true)
Definition mdbx.h++:4378
move_result to_last(bool throw_notfound=true)
Definition mdbx.h++:4398
cache_entry(cache_entry &&other) noexcept
Definition mdbx.h++:2790
bool is_nested_transactions_available() const
Definition mdbx.h++:3375
void close()
Explicitly closes the cursor.
constexpr MDBX_env * handle() noexcept
Definition mdbx.h++:3016
bool scan_until_from(CALLABLE_PREDICATE predicate, slice &from, move_operation start=key_greater_or_equal, move_operation turn=next)
Definition mdbx.h++:4324
void abort(finalization_latency &latency)
Abandon all the operations of the transaction instead of saving ones with collecting latencies inform...
Definition mdbx.h++:4099
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++:4409
bool is_readonly() const
Checks whether the transaction is read-only.
Definition mdbx.h++:3759
constexpr txn_managed() noexcept=default
bool clear_map(const slice &name, bool throw_if_absent=false)
move_result next_multiple_samelength(bool throw_notfound=false)
Definition mdbx.h++:4474
env_managed(const ::std::wstring &pathname, const operate_parameters &, bool accede=true)
ptrdiff_t distance_from_first(unsigned deepness=42) const
Definition mdbx.h++:4501
void append(map_handle map, const pair &kv, bool multivalue_order_preserved=true)
Definition mdbx.h++:4042
cursor_managed & operator=(const cursor_managed &)=delete
remove_mode
Deletion modes for remove().
Definition mdbx.h++:3309
@ ensure_unused
Make sure that the environment is not being used by other processes, or return an error otherwise.
Definition mdbx.h++:3319
@ wait_for_unused
Wait until other processes closes the environment before deletion.
Definition mdbx.h++:3321
@ just_remove
Just delete the environment's files and directory if any.
Definition mdbx.h++:3316
move_result to_current_first_multi(bool throw_notfound=true)
Definition mdbx.h++:4383
cursor_managed & operator=(cursor_managed &&other) noexcept
::MDBX_dbi_state_t state
Definition mdbx.h++:2963
env_managed(env_managed &&)=default
bool poll_sync_to_disk()
Performs non-blocking polling of sync-to-disk thresholds.
Definition mdbx.h++:3534
void put_multiple_samelength(const slice &key, const ::std::vector< VALUE > &vector, put_mode mode)
Definition mdbx.h++:4585
cursor_managed(cursor_managed &&)=default
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++:3284
move_result to_pair_lesser_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4438
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.
move_result get_multiple_samelength(bool throw_notfound=false)
Definition mdbx.h++:4470
ptrdiff_t distance_to(const cursor to, unsigned deepness=42) const
Definition mdbx.h++:4498
move_result to_key_lesser_than(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4400
move_result to_next(bool throw_notfound=true)
Definition mdbx.h++:4397
env_managed(const ::std::string &pathname, const operate_parameters &, bool accede=true)
operator::mdbx::map_handle() const
Definition mdbx.h++:4536
size_t dbsize_max() const
Returns the maximal database size in bytes for the environment.
Definition mdbx.h++:3280
friend constexpr bool operator>=(const map_handle &a, const map_handle &b) noexcept
Definition mdbx.h++:2955
size_t close_all_cursors() const
Close all cursors.
Definition mdbx.h++:3815
friend constexpr bool operator<(const map_handle &a, const map_handle &b) noexcept
Definition mdbx.h++:2946
void commit()
Commits all changes of the transaction into a database with collecting latencies information.
move_result to_key_greater_than(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4415
size_t get_pagesize() const
Returns pagesize of this MDBX environment.
Definition mdbx.h++:3345
void put(map_handle map, const pair &kv, put_mode mode)
Definition mdbx.h++:3991
env_managed(const ::std::string &pathname, const create_parameters &, const operate_parameters &, bool accede=true)
friend int compare_position(const cursor &left, const cursor &right, bool ignore_nested)
Definition mdbx.h++:6212
void put_multiple_samelength(map_handle map, const slice &key, const ::std::vector< VALUE > &vector, put_mode mode)
Definition mdbx.h++:4058
bool checkpoint()
Commits all the operations of the transaction and immediately starts next without releasing any locks...
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++:3291
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++:3896
friend constexpr bool operator==(const map_handle &a, const map_handle &b) noexcept
Definition mdbx.h++:2943
bool checkpoint(finalization_latency *latency)
Commits all the operations of the transaction and immediately starts next without releasing any locks...
void commit_embark_read(finalization_latency &latency)
Commits all the operations of a transaction into the database and then start read transaction.
Definition mdbx.h++:4141
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++:4050
finalization_latency commit_embark_read_get_latency()
Commits all the operations of a transaction into the database and then start read transaction.
Definition mdbx.h++:4144
void commit(finalization_latency *)
Commits all changes of the transaction into a database with collecting latencies information.
friend constexpr bool operator>(const map_handle &a, const map_handle &b) noexcept
Definition mdbx.h++:2949
bool rename_map(const ::std::string &old_name, const ::std::string &new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
bool is_empty() const
Checks whether the database is empty.
void close(bool dont_sync=false)
Explicitly closes the environment and release the memory map.
move_result to_pair_greater_than(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4450
env & copy(const ::std::string &destination, bool compactify, bool force_dynamic_size=false)
move_operation
Definition mdbx.h++:4216
@ multi_exactkey_lowerboundvalue
Definition mdbx.h++:4231
@ multi_exactkey_value_equal
Definition mdbx.h++:4248
@ pair_greater_or_equal
Definition mdbx.h++:4256
@ key_lesser_than
Definition mdbx.h++:4238
@ next
Definition mdbx.h++:4219
@ pair_exact
Definition mdbx.h++:4255
@ multi_exactkey_value_greater_or_equal
Definition mdbx.h++:4249
@ pair_lesser_or_equal
Definition mdbx.h++:4253
@ batch_samelength
Definition mdbx.h++:4259
@ seek_key
Definition mdbx.h++:4233
@ key_lowerbound
Definition mdbx.h++:4235
@ pair_lesser_than
Definition mdbx.h++:4252
@ pair_equal
Definition mdbx.h++:4254
@ key_greater_than
Definition mdbx.h++:4242
@ batch_samelength_next
Definition mdbx.h++:4260
@ multi_find_pair
Definition mdbx.h++:4230
@ key_greater_or_equal
Definition mdbx.h++:4241
@ key_exact
Definition mdbx.h++:4234
@ key_equal
Definition mdbx.h++:4240
@ multi_currentkey_prevvalue
Definition mdbx.h++:4225
@ key_lesser_or_equal
Definition mdbx.h++:4239
@ multi_nextkey_firstvalue
Definition mdbx.h++:4228
@ get_current
Definition mdbx.h++:4221
@ multi_exactkey_value_lesser_or_equal
Definition mdbx.h++:4247
@ multi_prevkey_lastvalue
Definition mdbx.h++:4223
@ previous
Definition mdbx.h++:4220
@ last
Definition mdbx.h++:4218
@ pair_greater_than
Definition mdbx.h++:4257
@ multi_exactkey_value_lesser_than
Definition mdbx.h++:4246
@ multi_currentkey_firstvalue
Definition mdbx.h++:4224
@ first
Definition mdbx.h++:4217
@ batch_samelength_previous
Definition mdbx.h++:4261
@ multi_currentkey_nextvalue
Definition mdbx.h++:4226
@ seek_and_batch_samelength
Definition mdbx.h++:4262
@ multi_exactkey_value_greater
Definition mdbx.h++:4250
@ multi_currentkey_lastvalue
Definition mdbx.h++:4227
finalization_latency commit_get_latency()
Commits all changes of the transaction into a database and return latency information.
Definition mdbx.h++:4116
bool move(move_operation operation, slice &key, slice &value, bool throw_notfound)
Definition mdbx.h++:4374
void insert(const pair &kv)
Definition mdbx.h++:4559
bool is_dirty(const slice &item) const
Checks whether the given slice is on a dirty page.
Definition mdbx.h++:3756
cursor_managed(const cursor_managed &)=delete
env & operator=(const env &) noexcept=default
env_managed(const ::std::wstring &pathname, const create_parameters &, const operate_parameters &, bool accede=true)
void upsert(const pair &kv)
Definition mdbx.h++:4561
move_result to_current_prev_multi(bool throw_notfound=true)
Definition mdbx.h++:4386
constexpr const MDBX_txn * handle() const noexcept
Definition mdbx.h++:3734
bool is_cooperative() const
Definition mdbx.h++:3369
bool clear_map(const ::std::string_view &name, bool throw_if_absent=false)
Definition mdbx.h++:3916
move_result to_exact_key_value_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4425
bool rename_map(const char *old_name, const char *new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
env_managed(const env_managed &)=delete
move_result to_current_last_multi(bool throw_notfound=true)
Definition mdbx.h++:4393
bool is_readonly() const
Definition mdbx.h++:3365
value_result try_insert(const pair &kv)
Definition mdbx.h++:4560
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++:4577
constexpr cursor() noexcept=default
bool is_exclusive() const
Definition mdbx.h++:3367
move_result to_key_lesser_or_equal(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4403
finalization_latency abort_get_latency()
Abandon all the operations of the transaction instead of saving ones with collecting latencies inform...
Definition mdbx.h++:4102
constexpr MDBX_cursor * handle() noexcept
Definition mdbx.h++:4179
bool is_readwrite() const
Definition mdbx.h++:3373
move_result to_pair_greater_or_equal(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4447
size_t value_max(value_mode mode) const
Returns the maximal value size in bytes for specified values mode.
Definition mdbx.h++:3288
MDBX_cursor * handle_
Definition mdbx.h++:4163
MDBX_dbi dbi
Definition mdbx.h++:2930
move_result to_exact_key_value_lesser_than(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:4419
friend constexpr bool operator!=(const env &a, const env &b) noexcept
Definition mdbx.h++:3018
move_result to_current_next_multi(bool throw_notfound=true)
Definition mdbx.h++:4390
size_t size_max() const
Returns maximal write transaction size (i.e. limit for summary volume of dirty pages) in bytes.
Definition mdbx.h++:3770
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++:4431
ptrdiff_t distance_from(const cursor from, unsigned deepness=42) const
Definition mdbx.h++:4494
::MDBX_stat stat
Statistics for a database in the MDBX environment.
Definition mdbx.h++:3336
size_t value_min(value_mode mode) const noexcept
Returns the minimal value size in bytes for specified values mode.
Definition mdbx.h++:3286
cache_entry(const cache_entry &) noexcept=default
value_result try_insert(map_handle map, const pair &kv)
Definition mdbx.h++:3993
void insert(map_handle map, const pair &kv)
Definition mdbx.h++:3992
env_managed(const ::mdbx::filesystem::path &pathname, const create_parameters &, const operate_parameters &, bool accede=true)
Create new or open existing database.
txn_managed start_nested(bool readonly)
Start nested transaction.
cache_entry & operator=(const cache_entry &) noexcept=default
bool rename_map(const ::std::string_view &old_name, const ::std::string_view &new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
Definition mdbx.h++:3924
move_result to_key_equal(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:4406
bool rename_map(const slice &old_name, const slice &new_name, bool throw_if_absent=false)
Переименовывает таблицу ключ-значение.
move_result to_previous(bool throw_notfound=true)
Definition mdbx.h++:4379
friend class txn
Definition mdbx.h++:2998
bool is_before_than(const cursor &other, bool ignore_nested=false) const
Definition mdbx.h++:4190
friend constexpr bool operator==(const txn &a, const txn &b) noexcept
Definition mdbx.h++:3736
size_t key_min(key_mode mode) const noexcept
Returns the minimal key size in bytes for specified keys mode.
Definition mdbx.h++:3282
size_t size_current() const
Returns current write transaction size (i.e.summary volume of dirty pages) in bytes.
Definition mdbx.h++:3773
constexpr env_managed() noexcept=default
bool fullscan(CALLABLE_PREDICATE predicate, bool backward=false)
Definition mdbx.h++:4319
Unmanaged cursor.
Definition mdbx.h++:4161
Managed cursor.
Definition mdbx.h++:4597
Unmanaged database environment.
Definition mdbx.h++:2997
Managed database environment.
Definition mdbx.h++:3643
Unmanaged database transaction.
Definition mdbx.h++:3717
Managed database transaction.
Definition mdbx.h++:4076
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++:5336
static constexpr intptr_t compare_fast(const pair &a, const pair &b) noexcept
Three-way fast non-lexicographically length-based comparison.
Definition mdbx.h++:5208
constexpr slice & set_end(const void *ptr)
Sets the length by specifying the end of the slice data.
Definition mdbx.h++:4875
polymorphic_allocator default_allocator
Definition mdbx.h++:381
constexpr size_t size() const noexcept
Returns the number of bytes.
Definition mdbx.h++:4884
constexpr slice safe_tail(size_t n) const
Returns the last "n" bytes of the slice.
Definition mdbx.h++:4966
buffer< ALLOCATOR, CAPACITY_POLICY > encode_base58(unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a buffer with a Base58 dump of the slice content.
Definition mdbx.h++:5182
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a buffer with a Base58 dump of a passed slice.
Definition mdbx.h++:5120
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a buffer with a hexadecimal dump of a passed slice.
Definition mdbx.h++:5111
void * get_context() const noexcept
Returns the application context associated with the transaction.
Definition mdbx.h++:5677
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++:5364
static constexpr intptr_t compare_fast(const slice &a, const slice &b) noexcept
Three-way fast non-lexicographically length-based comparison.
Definition mdbx.h++:4980
constexpr MDBX_error_t code() const noexcept
Returns error code.
Definition mdbx.h++:4725
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++:6093
void renew(::mdbx::txn &txn)
Renew/bind a cursor with a new transaction and previously used key-value map handle.
Definition mdbx.h++:6319
value_mode
Kind of the values and sorted multi-values with corresponding comparison.
Definition mdbx.h++:2844
constexpr const void * end() const noexcept
Return a pointer to the ending of the referenced data.
Definition mdbx.h++:4862
MDBX_CXX11_CONSTEXPR_ENUM mdbx::key_mode key_mode() const noexcept
Definition mdbx.h++:4682
constexpr slice safe_head(size_t n) const
Returns the first "n" bytes of the slice.
Definition mdbx.h++:4960
void reset_reading()
Reset read-only transaction.
Definition mdbx.h++:5710
class MDBX_MSVC_DECLSPEC_EMPTY_BASES buffer
Definition mdbx.h++:389
constexpr const char * char_ptr() const noexcept
Returns casted to pointer to char an address of data.
Definition mdbx.h++:4852
void rethrow_captured() const
Definition mdbx.h++:4697
constexpr const void * data() const noexcept
Return a pointer to the beginning of the referenced data.
Definition mdbx.h++:4860
move_result find_multivalue(const slice &key, const slice &value, bool throw_notfound=true)
Definition mdbx.h++:6277
ptrdiff_t estimate(move_operation operation, MDBX_val *key, MDBX_val *value) const
Definition mdbx.h++:6253
static size_t dbsize_max(intptr_t pagesize)
Returns the maximal database size in bytes for specified page size.
Definition mdbx.h++:5329
geometry & make_dynamic(intptr_t lower=default_value, intptr_t upper=default_value) noexcept
Definition mdbx.h++:5303
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a buffer with a Base64 dump of a passed slice.
Definition mdbx.h++:5129
value_result try_update_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:6054
value_result try_insert_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5996
void close_map(const map_handle &)
Close a key-value map (aka table) handle. Normally unnecessary.
Definition mdbx.h++:5583
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++:5514
move_result(const cursor &cursor, bool throw_notfound)
Definition mdbx.h++:6221
string< ALLOCATOR > as_hex_string(bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a string with a hexadecimal dump of the slice content.
Definition mdbx.h++:5161
::mdbx::filesystem::path::string_type path_string
Definition mdbx.h++:429
constexpr bool is_null() const noexcept
Checks whether the slice data pointer is nullptr.
Definition mdbx.h++:4882
ptrdiff_t estimate_from_first(map_handle map, const slice &to) const
Definition mdbx.h++:6166
buffer< ALLOCATOR, CAPACITY_POLICY > encode_base64(unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a buffer with a Base64 dump of the slice content.
Definition mdbx.h++:5187
void remove_suffix(size_t n) noexcept
Drops the last "n" bytes from this slice.
Definition mdbx.h++:4907
slice & assign(const void *ptr, size_t bytes)
Definition mdbx.h++:4808
void unbind()
Unbind cursor from a transaction.
Definition mdbx.h++:6325
::std::chrono::duration< unsigned, ::std::ratio< 1, 65536 > > duration
Duration in 1/65536 units of second.
Definition mdbx.h++:450
slice insert_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:5987
constexpr cursor(MDBX_cursor *ptr) noexcept
Definition mdbx.h++:6178
void rename_map(map_handle map, const char *new_name)
Переименовывает таблицу ключ-значение.
Definition mdbx.h++:5807
void throw_on_failure() const
Definition mdbx.h++:4737
bool try_update(const slice &key, const slice &value)
Definition mdbx.h++:6400
void update(const slice &key, const slice &value)
Definition mdbx.h++:6396
constexpr info(map_handle::flags flags, map_handle::state state) noexcept
Definition mdbx.h++:4679
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++:5878
constexpr buffer(const struct slice &src, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:5032
constexpr slice & set_length(size_t bytes)
Set slice length.
Definition mdbx.h++:4870
::MDBX_cmp_func comparator
Definition mdbx.h++:2975
buffer< ALLOCATOR, CAPACITY_POLICY > encode_hex(bool uppercase=false, unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a buffer with a hexadecimal dump of the slice content.
Definition mdbx.h++:5176
txn & set_context(void *your_context)
Sets the application context associated with the transaction.
Definition mdbx.h++:5679
txn_managed start_write(txn &parent)
Starts write (read-write) transaction.
Definition mdbx.h++:5650
int compare_position_nothrow(const cursor &left, const cursor &right, bool ignore_nested=false) noexcept
Definition mdbx.h++:6208
constexpr bool operator>(const slice &a, const slice &b) noexcept
Definition mdbx.h++:5006
env::durability get_durability() const
Returns current durability mode.
Definition mdbx.h++:5447
uint64_t sequence(map_handle map) const
Reads sequence generator associated with a key-value map (aka table).
Definition mdbx.h++:5866
void upsert(const slice &key, const slice &value)
Definition mdbx.h++:6386
bool is_clean() const noexcept
Definition mdbx.h++:4690
MDBX_CXX01_CONSTEXPR_ENUM bool is_reverse(key_mode mode) noexcept
Definition mdbx.h++:2837
static bool boolean_or_throw(int error_code)
Definition mdbx.h++:4770
string< ALLOCATOR > as_base58_string(unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a string with a Base58 dump of the slice content.
Definition mdbx.h++:5166
path_string::value_type path_char
Definition mdbx.h++:437
env::operate_parameters get_operation_parameters() const
Returns current operation parameters.
Definition mdbx.h++:5437
MDBX_CXX01_CONSTEXPR_ENUM bool is_msgpack(key_mode mode) noexcept
Definition mdbx.h++:2841
::std::basic_string< char, ::std::char_traits< char >, ALLOCATOR > string
Default single-byte string.
Definition mdbx.h++:402
MDBX_env_flags_t get_flags() const
Returns environment flags.
Definition mdbx.h++:5489
static size_t dbsize_min(intptr_t pagesize)
Returns the minimal database size in bytes for specified page size.
Definition mdbx.h++:5322
constexpr slice tail(size_t n) const noexcept
Returns the last "n" bytes of the slice.
Definition mdbx.h++:4950
constexpr error(MDBX_error_t error_code) noexcept
Definition mdbx.h++:4704
buffer< ALLOCATOR, CAPACITY_POLICY > hex_decode(bool ignore_spaces=false, const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes hexadecimal dump from the slice content to returned buffer.
Definition mdbx.h++:5192
constexpr const version_info & get_version() noexcept
Returns libmdbx version information.
Definition mdbx.h++:4632
buffer< ALLOCATOR, CAPACITY_POLICY > make_buffer(PRODUCER &producer, const ALLOCATOR &alloc)
Definition mdbx.h++:5063
buffer< ALLOCATOR, CAPACITY_POLICY > replace_reserve(map_handle map, const slice &key, slice &new_value, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &alloc=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type())
Definition mdbx.h++:6121
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++:5621
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++:5586
void insert(const slice &key, slice value)
Definition mdbx.h++:6347
move_result lower_bound_multivalue(const slice &key, const slice &value, bool throw_notfound=false)
Definition mdbx.h++:6281
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++:5762
buffer_pair< default_buffer > default_buffer_pair
Default pair of buffers.
Definition mdbx.h++:5257
::std::pmr::string::allocator_type polymorphic_allocator
Default polymorphic allocator for modern code.
Definition mdbx.h++:380
MDBX_CXX01_CONSTEXPR_ENUM bool is_usual(key_mode mode) noexcept
Definition mdbx.h++:2825
buffer< ALLOCATOR, CAPACITY_POLICY > base64_decode(bool ignore_spaces=false, const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes Base64 dump from the slice content to returned buffer.
Definition mdbx.h++:5202
constexpr slice() noexcept
Create an empty slice.
Definition mdbx.h++:4792
~cursor() noexcept
Definition mdbx.h++:6195
~txn() noexcept
Definition mdbx.h++:5671
size_t sync_threshold() const
Gets threshold used to force flush the data buffers to disk, for non-sync durability modes.
Definition mdbx.h++:5519
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes Base64 dump from a passed slice to returned buffer.
Definition mdbx.h++:5156
move_result upper_bound(const slice &key, bool throw_notfound=false)
Definition mdbx.h++:6273
uint64_t txnid
Transaction ID and MVCC-snapshot number.
Definition mdbx.h++:398
constexpr void invalidate() noexcept
Depletes content of slice and make it invalid.
Definition mdbx.h++:4888
inline ::mdbx::txn txn() const
Returns the cursor's transaction.
Definition mdbx.h++:6327
value_result try_insert_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6372
static env::operate_options options_from_flags(MDBX_env_flags_t flags) noexcept
Definition mdbx.h++:5314
map_handle map() const
Definition mdbx.h++:6332
unsigned sync_period__seconds_16dot16() const
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk...
Definition mdbx.h++:5530
MDBX_CXX11_CONSTEXPR_ENUM mdbx::value_mode value_mode() const noexcept
Definition mdbx.h++:4686
move_result find(const slice &key, bool throw_notfound=true)
Definition mdbx.h++:6265
map_handle open_map_accede(const char *name) const
Open existing key-value map.
Definition mdbx.h++:5778
move_result upper_bound_multivalue(const slice &key, const slice &value, bool throw_notfound=false)
Definition mdbx.h++:6285
MDBX_CXX01_CONSTEXPR_ENUM bool is_multi(value_mode mode) noexcept
Definition mdbx.h++:2905
void success_or_throw() const
Definition mdbx.h++:4742
void renew_reading()
Renew read-only transaction.
Definition mdbx.h++:5714
constexpr bool ends_with(const slice &suffix) const noexcept
Checks if the data ends with the given suffix.
Definition mdbx.h++:4922
bool sync_to_disk(bool force=true, bool nonblock=false)
Flush the environment data buffers.
Definition mdbx.h++:5570
constexpr bool operator<=(const slice &a, const slice &b) noexcept
Definition mdbx.h++:5010
int compare_position(const cursor &left, const cursor &right, bool ignore_nested=false)
Definition mdbx.h++:6212
size_t count_multivalue() const
Return count of duplicates for current key.
Definition mdbx.h++:6291
constexpr bool starts_with(const slice &prefix) const noexcept
Checks if the data starts with the given prefix.
Definition mdbx.h++:4918
static size_t pagesize_max() noexcept
Returns the maximal database page size in bytes.
Definition mdbx.h++:5320
constexpr size_t hash_value() const noexcept
Returns the hash value of referenced data.
Definition mdbx.h++:4927
bool is_dirty(const void *ptr) const
Checks whether the given data is on a dirty page.
Definition mdbx.h++:5684
slice upsert_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6390
env::mode get_mode() const
Returns current operation mode.
Definition mdbx.h++:5445
MDBX_CXX01_CONSTEXPR_ENUM bool is_samelength(key_mode mode) noexcept
Definition mdbx.h++:2833
void capture() noexcept
Definition mdbx.h++:4692
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes hexadecimal dump from a passed slice to returned buffer.
Definition mdbx.h++:5138
bool scroll(intptr_t distable, unsigned deepness=42, bool throw_notfound=true)
Definition mdbx.h++:6477
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++:5843
bool try_update(map_handle map, const slice &key, const slice &value)
Definition mdbx.h++:6032
void safe_remove_prefix(size_t n)
Drops the first "n" bytes from this slice.
Definition mdbx.h++:4901
comparator default_comparator(key_mode mode) noexcept
Definition mdbx.h++:2976
slice insert_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6365
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++:5626
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++:5384
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++:5525
ptrdiff_t estimate(map_handle map, const pair &from, const pair &to) const
Definition mdbx.h++:6154
env::reclaiming_options get_reclaiming() const
Returns current reclaiming options.
Definition mdbx.h++:5451
void drop_map(map_handle map)
Drops key-value map using handle.
Definition mdbx.h++:5803
ptrdiff_t estimate_to_last(map_handle map, const slice &from) const
Definition mdbx.h++:6172
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++:6130
env::operate_options get_options() const
Returns current operate options.
Definition mdbx.h++:5455
void park_reading(bool autounpark=true)
Park read-only transaction.
Definition mdbx.h++:5729
constexpr bool operator>=(const slice &a, const slice &b) noexcept
Definition mdbx.h++:5014
cursor & set_context(void *your_context)
Sets the application context associated with the cursor.
Definition mdbx.h++:6203
map_stat get_map_stat(map_handle map) const
Returns statistics for a table.
Definition mdbx.h++:5837
bool move(move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const
Definition mdbx.h++:6231
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++:5360
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++:5882
static env::reclaiming_options reclaiming_from_flags(MDBX_env_flags_t flags) noexcept
Definition mdbx.h++:5310
txn & put_canary(const canary &)
Set integers markers (aka "canary") associated with the environment.
Definition mdbx.h++:5855
slice upsert_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:6018
constexpr slice head(size_t n) const noexcept
Returns the first "n" bytes of the slice.
Definition mdbx.h++:4945
constexpr bool is_result_false() const noexcept
Definition mdbx.h++:4719
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++:5536
constexpr slice safe_middle(size_t from, size_t n) const
Returns the middle "n" bytes of the slice.
Definition mdbx.h++:4972
constexpr const byte * byte_ptr() const noexcept
Returns casted to pointer to byte an address of data.
Definition mdbx.h++:4844
bool on_first() const
Definition mdbx.h++:6299
::MDBX_version_info version_info
libmdbx version information,
Definition mdbx.h++:345
constexpr bool empty() const noexcept
Checks whether the slice is empty.
Definition mdbx.h++:4880
bool eof() const
Definition mdbx.h++:6297
void make_broken()
Marks transaction as broken to prevent further operations.
Definition mdbx.h++:5712
MDBX_txn_flags_t flags() const
Returns transaction's flags.
Definition mdbx.h++:5698
void * get_context() const noexcept
Returns the application context associated with the environment.
Definition mdbx.h++:5507
MDBX_error_t put(const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
Definition mdbx.h++:6339
txn_managed prepare_read() const
Creates but not start read transaction.
Definition mdbx.h++:5635
::MDBX_build_info build_info
libmdbx build information
Definition mdbx.h++:349
string< ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes Base64 dump from a passed slice to returned string.
Definition mdbx.h++:5151
constexpr txn(MDBX_txn *ptr) noexcept
Definition mdbx.h++:5659
void safe_remove_suffix(size_t n)
Drops the last "n" bytes from this slice.
Definition mdbx.h++:4912
bool seek(const slice &key)
Definition mdbx.h++:6289
env & alter_flags(MDBX_env_flags_t flags, bool on_off)
Alter environment flags.
Definition mdbx.h++:5559
env & set_context(void *your_context)
Sets the application context associated with the environment.
Definition mdbx.h++:5509
constexpr byte operator[](size_t n) const noexcept
Returns the nth byte in the referenced data.
Definition mdbx.h++:4934
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++:5428
void clear_map(map_handle map)
Clear key-value map.
Definition mdbx.h++:5805
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++:5548
bool is_base64(bool ignore_spaces=false) const noexcept
Checks whether the content of the slice is a Base64 dump.
Definition mdbx.h++:5273
void remove_prefix(size_t n) noexcept
Drops the first "n" bytes from this slice.
Definition mdbx.h++:4895
value_result try_insert(const slice &key, slice value)
Definition mdbx.h++:6352
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++:6453
static void throw_on_nullptr(const void *ptr, MDBX_error_t error_code)
Definition mdbx.h++:4755
constexpr bool operator!=(const error &a, const error &b) noexcept
Definition mdbx.h++:4713
inline ::mdbx::env env() const noexcept
Returns the transaction's environment.
Definition mdbx.h++:5696
put_mode
Key-value pairs put mode.
Definition mdbx.h++:2984
static constexpr intptr_t compare_lexicographically(const pair &a, const pair &b) noexcept
Three-way lexicographically comparison.
Definition mdbx.h++:5213
buffer< ALLOCATOR, CAPACITY_POLICY > base58_decode(bool ignore_spaces=false, const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes Base58 dump from the slice content to returned buffer.
Definition mdbx.h++:5197
double sync_period__seconds_double() const
Gets relative period since the last unsteady commit that used to force flush the data buffers to disk...
Definition mdbx.h++:5540
::mdbx_filehandle_t filehandle
Definition mdbx.h++:404
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++:5406
constexpr env(MDBX_env *ptr) noexcept
Definition mdbx.h++:5279
constexpr bool operator<(const slice &a, const slice &b) noexcept
Definition mdbx.h++:5002
char8_t byte
The byte-like type that don't presumes aliases for pointers as does the char.
Definition mdbx.h++:330
canary get_canary() const
Returns fours integers markers (aka "canary") associated with the environment.
Definition mdbx.h++:5860
bool erase(bool whole_multivalue=false)
Removes single key-value pair or all multi-values at the current cursor position.
Definition mdbx.h++:6431
stat get_stat() const
Returns snapshot statistics about the MDBX environment.
Definition mdbx.h++:5459
string< ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a string with a hexadecimal dump of a passed slice.
Definition mdbx.h++:5106
uint64_t id() const
Return the transaction's ID.
Definition mdbx.h++:5704
value_result try_insert(map_handle map, const slice &key, slice value)
Definition mdbx.h++:5972
::std::string::allocator_type legacy_allocator
Legacy allocator but it is recommended to use polymorphic_allocator.
Definition mdbx.h++:363
constexpr bool is_mdbx_error() const noexcept
Returns true for MDBX's errors.
Definition mdbx.h++:4727
string< ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes hexadecimal dump from a passed slice to returned string.
Definition mdbx.h++:5133
string< ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a string with a Base58 dump of a passed slice.
Definition mdbx.h++:5115
ptrdiff_t estimate(const cursor &from, const cursor &to)
Definition mdbx.h++:6259
static constexpr intptr_t compare_lexicographically(const slice &a, const slice &b) noexcept
Three-way lexicographically comparison.
Definition mdbx.h++:4987
string< ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a string with a Base64 dump of a passed slice.
Definition mdbx.h++:5124
static bool distribute(const cursor from, const cursor to, cursor *cursors_array, intptr_t cursors_array_size, unsigned deepness=42)
Definition mdbx.h++:6491
string< ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes Base58 dump from a passed slice to returned string.
Definition mdbx.h++:5142
slice update_reserve(map_handle map, const slice &key, size_t value_length)
Definition mdbx.h++:6046
bool is_base58(bool ignore_spaces=false) const noexcept
Checks whether the content of the slice is a Base58 dump.
Definition mdbx.h++:5269
~env() noexcept
Definition mdbx.h++:5291
loop_control
Loop control constants for readers enumeration functor and other cases.
Definition mdbx.h++:2806
slice get(map_handle map, const slice &key) const
Get value by key from a key-value map (aka table).
Definition mdbx.h++:5894
constexpr bool is_failure() const noexcept
Definition mdbx.h++:4721
constexpr void clear() noexcept
Makes the slice empty and referencing to nothing.
Definition mdbx.h++:4890
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++:6135
void update(map_handle map, const slice &key, const slice &value)
Definition mdbx.h++:6026
constexpr byte at(size_t n) const
Returns the nth byte in the referenced data with bounds checking.
Definition mdbx.h++:4939
key_mode
Kinds of the keys and corresponding modes of comparing it.
Definition mdbx.h++:2809
txn_managed start_read() const
Starts read (read-only) transaction.
Definition mdbx.h++:5628
::mdbx::filesystem::path path
Definition mdbx.h++:428
bool on_last_multival() const
Definition mdbx.h++:6305
unsigned max_maps() const
Returns the maximum number of named tables for the environment.
Definition mdbx.h++:5501
void insert(map_handle map, const slice &key, slice value)
Definition mdbx.h++:5965
unsigned max_readers() const
Returns the maximum number of threads/reader slots for the environment.
Definition mdbx.h++:5495
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++:5340
int enumerate_readers(VISITOR &visitor)
Enumerate readers.
Definition mdbx.h++:5591
void * get_context() const noexcept
Returns the application context associated with the cursor.
Definition mdbx.h++:6201
static size_t max_map_handles(void)
Returns the maximum opened map handles, aka DBI-handles.
Definition mdbx.h++:5435
cursor_managed open_cursor(map_handle map) const
Opens cursor for specified key-value map handle.
Definition mdbx.h++:5741
MDBX_CXX01_CONSTEXPR_ENUM bool is_ordinal(key_mode mode) noexcept
Definition mdbx.h++:2829
bool unpark_reading(bool restart_if_ousted=true)
Resume parked read-only transaction.
Definition mdbx.h++:5731
uint64_t extra_option(extra_runtime_option option) const
Gets the value of extra runtime options from an environment.
Definition mdbx.h++:5553
constexpr const build_info & get_build() noexcept
Returns libmdbx build information.
Definition mdbx.h++:4633
bool on_first_multival() const
Definition mdbx.h++:6303
MDBX_error_t put(map_handle map, const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
Definition mdbx.h++:5953
inline ::std::ostream & operator<<(::std::ostream &out, const buffer< ALLOCATOR, CAPACITY_POLICY > &it)
Definition mdbx.h++:5045
constexpr slice middle(size_t from, size_t n) const noexcept
Returns the middle "n" bytes of the slice.
Definition mdbx.h++:4955
info get_info() const
Return snapshot information about the MDBX environment.
Definition mdbx.h++:5471
void upsert(map_handle map, const slice &key, const slice &value)
Definition mdbx.h++:6012
static size_t pagesize_min() noexcept
Returns the minimal database page size in bytes.
Definition mdbx.h++:5318
string< ALLOCATOR > as_base64_string(unsigned wrap_width=0, const ALLOCATOR &alloc=ALLOCATOR()) const
Returns a string with a Base58 dump of the slice content.
Definition mdbx.h++:5171
slice update_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6412
txn_managed clone(void *context=nullptr) const
Clone read transaction.
Definition mdbx.h++:5716
move_result lower_bound(const slice &key, bool throw_notfound=false)
Definition mdbx.h++:6269
constexpr const byte * end_byte_ptr() const noexcept
Returns casted to pointer to byte an end of data.
Definition mdbx.h++:4846
constexpr size_t length() const noexcept
Returns the number of bytes.
Definition mdbx.h++:4868
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++:5254
unsigned check_readers()
Checks for stale readers in the lock table and return number of cleared slots.
Definition mdbx.h++:5614
bool erase(map_handle map, const slice &key)
Removes all values for given key.
Definition mdbx.h++:6069
constexpr bool is_result_true() const noexcept
Definition mdbx.h++:4717
bool on_last() const
Definition mdbx.h++:6301
buffer< ALLOCATOR, CAPACITY_POLICY > extract(map_handle map, const slice &key, const typename buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type &alloc=buffer< ALLOCATOR, CAPACITY_POLICY >::allocator_type())
Removes and return a value of the key.
Definition mdbx.h++:6100
#define MDBX_STD_FILESYSTEM_PATH
Defined if mdbx::filesystem::path is available.
Definition mdbx.h++:424
filehandle get_filehandle() const
Returns the file descriptor for the DXB file of MDBX environment.
Definition mdbx.h++:5483
env & set_geometry(const geometry &size)
Set all size-related parameters of environment.
Definition mdbx.h++:5564
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++:6321
buffer< ALLOCATOR, CAPACITY_POLICY > as_buffer(const ALLOCATOR &alloc=ALLOCATOR()) const
Decodes Base58 dump from a passed slice to returned buffer.
Definition mdbx.h++:5147
geometry & make_fixed(intptr_t size) noexcept
Definition mdbx.h++:5297
size_t release_all_cursors(bool unbind) const
Unbind or close all cursors.
Definition mdbx.h++:5747
constexpr bool operator==(const error &a, const error &b) noexcept
Definition mdbx.h++:4711
string< ALLOCATOR > make_string(PRODUCER &producer, const ALLOCATOR &alloc)
Definition mdbx.h++:5085
constexpr bool is_success() const noexcept
Definition mdbx.h++:4715
value_result try_update_reserve(const slice &key, size_t value_length)
Definition mdbx.h++:6418
buffer< default_allocator, default_capacity_policy > default_buffer
Default buffer.
Definition mdbx.h++:5058
cursor & assign(const cursor &)
Definition mdbx.h++:6180
txn_managed try_start_write()
Tries to start write (read-write) transaction without blocking.
Definition mdbx.h++:5657
bool is_hex(bool ignore_spaces=false) const noexcept
Checks whether the content of the slice is a hexadecimal dump.
Definition mdbx.h++:5265
info get_info(bool scan_reader_lock_table=false) const
Returns information about the MDBX transaction.
Definition mdbx.h++:5735
static ptrdiff_t distance_between(const cursor from, const cursor to, unsigned deepness=42)
Definition mdbx.h++:6471
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++:5794
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++:5932
map_handle::info get_map_flags(map_handle map) const
Returns information about key-value map (aka table) handle.
Definition mdbx.h++:5849
constexpr const char * end_char_ptr() const noexcept
Returns casted to pointer to char an end of data.
Definition mdbx.h++:4854
@ multi_reverse_samelength
Definition mdbx.h++:2877
@ multi_samelength
Definition mdbx.h++:2862
@ multi_ordinal
Definition mdbx.h++:2869
@ msgpack
Definition mdbx.h++:2892
@ single
Definition mdbx.h++:2845
@ multi
Definition mdbx.h++:2847
@ multi_reverse
Definition mdbx.h++:2854
@ upsert
Insert or update.
Definition mdbx.h++:2986
@ update
Update existing, don't insert new.
Definition mdbx.h++:2987
@ insert_unique
Insert only unique keys.
Definition mdbx.h++:2985
@ continue_loop
Definition mdbx.h++:2806
@ exit_loop
Definition mdbx.h++:2806
@ usual
Definition mdbx.h++:2810
@ ordinal
Definition mdbx.h++:2815
@ reverse
Definition mdbx.h++:2812
@ msgpack
Definition mdbx.h++:2820
A handle for an individual table (aka key-value space, maps or sub-database) in the environment.
Definition mdbx.h++:2929
buffer & assign(const void *begin, const void *end, bool make_reference=false)
Definition mdbx.h++:2427
constexpr buffer(const ::std::basic_string_view< CHAR, T > &view, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2121
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++:1996
modality
Data storage modality.
Definition mdbx.h++:1565
buffer_pair_spec & operator=(const buffer_pair_spec &)=default
constexpr byte * byte_ptr() noexcept
Returns casted to pointer to byte an address of data.
Definition mdbx.h++:2026
constexpr ::std::span< byte > bytes()
Definition mdbx.h++:685
constexpr buffer & set_end(const void *ptr)
Sets the length by specifying the end of the data.
Definition mdbx.h++:2091
buffer_pair_spec(const buffer_pair_spec &)=default
constexpr allocator_type get_allocator() const
Definition mdbx.h++:1979
static constexpr slice wrap(const char(&text)[SIZE])
Definition mdbx.h++:698
constexpr slice(const ::std::span< POD > &span)
Definition mdbx.h++:661
static buffer base64_decode(const slice &source, bool ignore_spaces=false, const allocator_type &alloc=allocator_type())
Decodes Base64 dump from the slice content to returned buffer.
Definition mdbx.h++:2263
void reserve_tailroom(size_t wanna_tailroom)
Reserves space after the payload.
Definition mdbx.h++:2304
constexpr slice(const ::std::basic_string< CHAR, T, A > &str)
Create a slice that refers to the contents of "str".
Definition mdbx.h++:652
const slice source
Definition mdbx.h++:1249
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid Base58 dump, and therefore there could be dec...
static buffer key_from(const double *ieee754_64bit)
Definition mdbx.h++:2656
static buffer hex(const POD &pod, bool uppercase=false, unsigned wrap_width=0, const allocator_type &alloc=allocator_type())
Returns a new buffer with a hexadecimal dump of the given pod.
Definition mdbx.h++:2212
slice & assign(::std::basic_string_view< CHAR, T > &&view)
Definition mdbx.h++:720
constexpr const char * end_char_ptr() const noexcept
Returns casted to const pointer to char an end of data.
Definition mdbx.h++:2042
int8_t as_int8_adapt() const
constexpr buffer make_inplace_or_reference() const
Definition mdbx.h++:2334
constexpr const char * char_ptr() const noexcept
Returns casted to const pointer to char an address of data.
Definition mdbx.h++:2039
buffer & assign(const char *c_str, bool make_reference=false)
Definition mdbx.h++:2436
void reserve(size_t wanna_headroom, size_t wanna_tailroom)
Reserves storage space.
Definition mdbx.h++:2287
constexpr size_t tailroom() const noexcept
Returns the number of bytes that available in currently allocated storage after the data.
Definition mdbx.h++:2014
constexpr buffer(const ::std::basic_string_view< CHAR, T > &view, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2148
buffer & assign(const struct slice &src, bool make_reference=false)
Definition mdbx.h++:2407
void reserve_headroom(size_t wanna_headroom)
Reserves space before the payload.
Definition mdbx.h++:2301
constexpr byte * end_byte_ptr() noexcept
Returns casted to pointer to byte an end of data.
Definition mdbx.h++:2033
buffer & append(const ::std::basic_string_view< CHAR, T > &view)
Definition mdbx.h++:2466
buffer(size_t head_room, size_t tail_room, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2153
buffer< ALLOCATOR, CAPACITY_POLICY > buffer_type
Definition mdbx.h++:2688
::std::allocator_traits< allocator_type > allocator_traits
Definition mdbx.h++:1551
constexpr uint16_t as_uint16() const
Definition mdbx.h++:1022
constexpr size_t envisage_result_length() const noexcept
Returns the buffer size in bytes needed for Base58 dump of passed slice.
Definition mdbx.h++:1226
constexpr buffer & assign(size_t headroom, const buffer &src, size_t tailroom)
Definition mdbx.h++:2339
constexpr void * data() noexcept
Return a pointer to the beginning of the referenced data.
Definition mdbx.h++:2066
buffer & append_decoded_hex(const struct slice &data, bool ignore_spaces=false)
Definition mdbx.h++:2545
constexpr const void * end() const noexcept
Return a const pointer to the end of the referenced data.
Definition mdbx.h++:2062
buffer & append(const byte c)
Definition mdbx.h++:2499
buffer & assign_freestanding(const void *ptr, size_t bytes)
Definition mdbx.h++:2312
slice & operator=(::std::basic_string_view< CHAR, T > &&view)
Definition mdbx.h++:738
static constexpr slice null() noexcept
Build a null slice which zero length and refers to null address.
Definition mdbx.h++:1003
constexpr void swap(buffer &other) noexcept(swap_alloc::is_nothrow())
Definition mdbx.h++:2317
buffer & operator=(const buffer &src)
Definition mdbx.h++:2453
constexpr uint32_t as_uint32() const
Definition mdbx.h++:1021
buffer & append_u16(uint_fast16_t u16)
Definition mdbx.h++:2567
constexpr size_t headroom() const noexcept
Returns the number of bytes available in the currently allocated storage in front of the data.
Definition mdbx.h++:2009
buffer_pair_spec(buffer_pair_spec &&pair) noexcept(buffer_type::move_assign_alloc::is_nothrow())
Definition mdbx.h++:2730
constexpr int64_t as_int64() const
Definition mdbx.h++:1028
constexpr const void * data() const noexcept
Return a const pointer to the beginning of the referenced data.
Definition mdbx.h++:2059
static buffer key_from(const ::std::basic_string< CHAR, T, A > &src, bool make_reference=false)
Definition mdbx.h++:2646
static buffer hex(const slice &source, bool uppercase=false, unsigned wrap_width=0, const allocator_type &alloc=allocator_type())
Returns a new buffer with a hexadecimal dump of the slice content.
Definition mdbx.h++:2194
const bool ignore_spaces
Definition mdbx.h++:1329
void swap(::std::basic_string_view< CHAR, T > &view) noexcept
Definition mdbx.h++:842
buffer base58_decode(bool ignore_spaces=false, const allocator_type &alloc=allocator_type()) const
Decodes Base58 dump from the buffer content to new returned buffer.
Definition mdbx.h++:2276
buffer hex_decode(bool ignore_spaces=false, const allocator_type &alloc=allocator_type()) const
Decodes hexadecimal dump from the buffer content to new returned buffer.
Definition mdbx.h++:2270
static buffer wrap(const POD &pod, bool make_reference=false, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2189
value_result & operator=(const value_result &) noexcept=default
buffer_type value
Definition mdbx.h++:2693
buffer & add_header(const void *src, size_t bytes)
Definition mdbx.h++:2509
buffer encode_hex(bool uppercase=false, unsigned wrap_width=0, const allocator_type &alloc=allocator_type()) const
Definition mdbx.h++:2232
bool is_printable(bool disable_utf8=false) const noexcept
Checks whether the content of the slice is printable.
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.
pair & operator=(stl_pair &&couple)
Definition mdbx.h++:1091
constexpr ::std::basic_string< CHAR, T, ALLOCATOR > as_string(const ALLOCATOR &alloc=ALLOCATOR()) const
Definition mdbx.h++:755
buffer_pair_spec(const buffer_type &key, const buffer_type &value, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2699
constexpr int16_t as_int16() const
Definition mdbx.h++:1030
slice value
Definition mdbx.h++:1055
::std::ostream & output(::std::ostream &out) const
Output Base64 dump of passed slice to the std::ostream.
buffer_pair_spec(const buffer_type &key, const buffer_type &value, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2701
buffer & assign(const ::std::basic_string< CHAR, T, A > &str, bool make_reference=false)
Definition mdbx.h++:2432
static buffer base58_decode(const slice &source, bool ignore_spaces=false, const allocator_type &alloc=allocator_type())
Decodes Base58 dump from the slice content to returned buffer.
Definition mdbx.h++:2256
constexpr bool is_reference() const noexcept
Definition mdbx.h++:2768
static buffer key_from_jsonInteger(const int64_t json_integer)
Definition mdbx.h++:2666
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1197
buffer base64_decode(bool ignore_spaces=false, const allocator_type &alloc=allocator_type()) const
Decodes Base64 dump from the buffer content to new returned buffer.
Definition mdbx.h++:2282
static constexpr buffer invalid() noexcept
Build an invalid buffer which non-zero length and refers to null address.
Definition mdbx.h++:2186
slice value
Definition mdbx.h++:1069
::std::pair< buffer_type, buffer_type > stl_pair
Definition mdbx.h++:2692
::std::ostream & output(::std::ostream &out) const
Output hexadecimal dump of passed slice to the std::ostream.
pair_result(const pair_result &) noexcept=default
allocation_aware_details::swap_alloc< struct silo, allocator_type > swap_alloc
Definition mdbx.h++:1974
static buffer key_from(const float ieee754_32bit)
Definition mdbx.h++:2672
const slice source
Definition mdbx.h++:1328
buffer_pair_spec(const slice &key, const slice &value, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2710
const slice source
Definition mdbx.h++:1164
static buffer base58(const POD &pod, unsigned wrap_width=0, const allocator_type &alloc=allocator_type())
Returns a new buffer with a Base58 dump of the given pod.
Definition mdbx.h++:2220
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++:1311
const unsigned wrap_width
Definition mdbx.h++:1166
buffer & operator=(const ::std::basic_string_view< CHAR, T > &view) noexcept
Definition mdbx.h++:2462
constexpr buffer() noexcept=default
static buffer key_from_double(const double ieee754_64bit)
Definition mdbx.h++:2652
slice & assign(const ::std::basic_string< CHAR, T, ALLOCATOR > &str)
Definition mdbx.h++:712
constexpr bool is_freestanding() const noexcept
Definition mdbx.h++:2763
const slice & slice() const noexcept
Definition mdbx.h++:2684
buffer & assign(struct slice &&src, bool make_reference=false)
Definition mdbx.h++:2415
const bool ignore_spaces
Definition mdbx.h++:1295
constexpr POD as_pod() const
Definition mdbx.h++:1005
constexpr buffer & assign(buffer &&src) noexcept(move_assign_alloc::is_nothrow())
Definition mdbx.h++:2386
char * write_bytes(char *dest, size_t dest_size) const
Fills the destination with data decoded from Base58 dump from a passed slice.
constexpr pair_result() noexcept
Definition mdbx.h++:1118
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++:1395
buffer_pair_spec(const stl_pair &pair, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2705
buffer & assign(const void *ptr, size_t bytes, bool make_reference=false)
Definition mdbx.h++:2403
constexpr buffer(const buffer &src)
Definition mdbx.h++:2131
static buffer hex_decode(const slice &source, bool ignore_spaces=false, const allocator_type &alloc=allocator_type())
Decodes hexadecimal dump from the slice content to returned buffer.
Definition mdbx.h++:2249
constexpr uint128_t as_uint128() const
Definition mdbx.h++:1018
void clear_and_reserve(size_t whole_capacity, size_t headroom=0) noexcept
Clears the contents and reserve storage.
Definition mdbx.h++:2484
uint16_t as_uint16_adapt() const
buffer_pair_spec & operator=(pair &&src)
Definition mdbx.h++:2745
constexpr size_t length() const noexcept
Returns the number of bytes.
Definition mdbx.h++:2079
static buffer key_from_u64(const uint64_t unsigned_int64)
Definition mdbx.h++:2658
constexpr friend void swap(buffer &left, buffer &right) noexcept(buffer::is_swap_nothrow())
Definition mdbx.h++:2326
constexpr to_hex(const slice &source, bool uppercase=false, unsigned wrap_width=0) noexcept
Definition mdbx.h++:1167
buffer_pair_spec(const stl_pair &pair, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2707
buffer & append_base64(const struct slice &data, unsigned wrap_width=0)
Definition mdbx.h++:2541
static buffer key_from(const ::std::basic_string_view< CHAR, T > &src, bool make_reference=false)
Definition mdbx.h++:2638
static constexpr size_t advise(const size_t current, const size_t wanna, const size_t inplace)
Definition mdbx.h++:1516
buffer(size_t head_room, const slice &src, size_t tail_room, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2164
slice & operator=(const ::std::basic_string_view< CHAR, T > &view)
Definition mdbx.h++:734
std::pair< slice, slice > stl_pair
Definition mdbx.h++:1068
buffer & append_byte(uint_fast8_t byte)
Definition mdbx.h++:2565
constexpr bool is_inplace() const noexcept
Checks whether data chunk stored in place within the buffer instance itself, without reference outsid...
Definition mdbx.h++:1991
value_result(const value_result &) noexcept=default
constexpr slice(const slice &) noexcept=default
@ pettiness_threshold
Definition mdbx.h++:1505
@ extra_inplace_storage
Definition mdbx.h++:1503
@ max_reserve
Definition mdbx.h++:1506
@ inplace_storage_size_rounding
Definition mdbx.h++:1504
static buffer key_from_float(const float ieee754_32bit)
Definition mdbx.h++:2670
constexpr ::std::span< POD > as_span()
Definition mdbx.h++:675
constexpr from_base58(const slice &source, bool ignore_spaces=false) noexcept
Definition mdbx.h++:1330
buffer & operator=(const struct slice &src)
Definition mdbx.h++:2457
buffer_type key
Definition mdbx.h++:2693
buffer & append_base58(const struct slice &data, unsigned wrap_width=0)
Definition mdbx.h++:2537
constexpr int8_t as_int8() const
Definition mdbx.h++:1031
constexpr ::std::span< char > chars()
Definition mdbx.h++:687
constexpr slice(size_t invalid_length) noexcept
Definition mdbx.h++:1050
constexpr size_t envisage_result_length() const noexcept
Returns the buffer size in bytes needed for Base64 dump of passed slice.
Definition mdbx.h++:1268
buffer(buffer &&src) noexcept(noexcept(::std::is_nothrow_move_constructible< allocator_type >::value))
Definition mdbx.h++:2171
buffer(const char *c_str, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2116
buffer(const txn &transaction, const slice &src, const allocator_type &alloc=allocator_type())
static constexpr size_t round(const size_t value)
Definition mdbx.h++:1509
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1240
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++:1386
value_result(const slice &value, bool done) noexcept
Definition mdbx.h++:1057
static buffer key_from(buffer &&src) noexcept
Definition mdbx.h++:2650
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1357
buffer encode_base64(unsigned wrap_width=0, const allocator_type &alloc=allocator_type()) const
Definition mdbx.h++:2244
buffer(size_t capacity, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2159
const slice source
Definition mdbx.h++:1207
constexpr pair(const stl_pair &couple) noexcept
Definition mdbx.h++:1071
buffer & assign(::MDBX_val &&src, bool make_reference=false)
Definition mdbx.h++:2421
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++:1983
static buffer key_from(const float *ieee754_32bit)
Definition mdbx.h++:2674
constexpr ::std::span< const char > chars() const
Definition mdbx.h++:686
constexpr from_base64(const slice &source, bool ignore_spaces=false) noexcept
Definition mdbx.h++:1369
buffer_pair_spec & operator=(buffer_pair_spec &&src)
Definition mdbx.h++:2734
buffer & append_u48(uint_fast64_t u48)
Definition mdbx.h++:2600
constexpr void swap(slice &other) noexcept
Definition mdbx.h++:850
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++:1201
CAPACITY_POLICY reservation_policy
Definition mdbx.h++:1552
uint8_t as_uint8_adapt() const
constexpr ::std::span< const POD > as_span() const
Definition mdbx.h++:666
static buffer key_from(const int64_t signed_int64)
Definition mdbx.h++:2664
constexpr buffer(const void *ptr, size_t bytes, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2110
buffer & operator=(struct slice &&src)
Definition mdbx.h++:2459
buffer_pair_spec & operator=(const stl_pair &src)
Definition mdbx.h++:2750
buffer & add_header(const struct slice &chunk)
Definition mdbx.h++:2517
buffer & append_u32(uint_fast32_t u32)
Definition mdbx.h++:2588
buffer & append_decoded_base58(const struct slice &data, bool ignore_spaces=false)
Definition mdbx.h++:2549
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++:1347
slice & assign(const ::std::basic_string_view< CHAR, T > &view)
Definition mdbx.h++:717
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++:742
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1318
int32_t as_int32_adapt() const
buffer_pair_spec & operator=(const pair &src)
Definition mdbx.h++:2740
@ max_length
Definition mdbx.h++:631
pair & operator=(pair &&couple) noexcept
Definition mdbx.h++:1075
static buffer base64(const POD &pod, unsigned wrap_width=0, const allocator_type &alloc=allocator_type())
Returns a new buffer with a Base64 dump of the given pod.
Definition mdbx.h++:2227
static buffer key_from_i32(const int32_t signed_int32)
Definition mdbx.h++:2680
slice inherited
Definition mdbx.h++:1545
constexpr pair_result(const slice &key, const slice &value, bool done) noexcept
Definition mdbx.h++:1119
constexpr from_hex(const slice &source, bool ignore_spaces=false) noexcept
Definition mdbx.h++:1296
static buffer key_from_u32(const uint32_t unsigned_int32)
Definition mdbx.h++:2676
char * write_bytes(char *dest, size_t dest_size) const
Fills the buffer by hexadecimal dump of a passed slice.
static buffer key_from(const uint32_t unsigned_int32)
Definition mdbx.h++:2678
buffer & assign_reference(const void *ptr, size_t bytes)
Definition mdbx.h++:2306
static constexpr pair invalid() noexcept
Definition mdbx.h++:1084
void make_freestanding()
Makes buffer owning the data.
Definition mdbx.h++:2099
buffer & assign(const ::MDBX_val &src, bool make_reference=false)
Definition mdbx.h++:2411
bool done
Definition mdbx.h++:1117
::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++:1243
constexpr ::std::span< const byte > bytes() const
Definition mdbx.h++:684
static constexpr slice wrap(const POD &pod)
Definition mdbx.h++:700
allocation_aware_details::move_assign_alloc< silo, allocator_type > move_assign_alloc
Definition mdbx.h++:1972
const bool uppercase
Definition mdbx.h++:1165
allocation_aware_details::copy_assign_alloc< silo, allocator_type > copy_assign_alloc
Definition mdbx.h++:1973
constexpr char * char_ptr() noexcept
Returns casted to pointer to char an address of data.
Definition mdbx.h++:2046
constexpr buffer & assign(const buffer &src, bool make_reference=false)
Definition mdbx.h++:2361
buffer & append(const struct slice &chunk)
Definition mdbx.h++:2507
buffer & append_decoded_base64(const struct slice &data, bool ignore_spaces=false)
Definition mdbx.h++:2553
buffer_pair_spec(const pair &pair, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2718
void make_freestanding()
Definition mdbx.h++:2774
constexpr char * end_char_ptr() noexcept
Returns casted to pointer to char an end of data.
Definition mdbx.h++:2053
const bool ignore_spaces
Definition mdbx.h++:1368
constexpr to_base64(const slice &source, unsigned wrap_width=0) noexcept
Definition mdbx.h++:1252
pair(const pair &) noexcept=default
static buffer key_from(const char(&text)[SIZE], bool make_reference=true)
Definition mdbx.h++:2632
static constexpr slice invalid() noexcept
Build an invalid slice which non-zero length and refers to null address.
Definition mdbx.h++:998
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
constexpr int128_t as_int128() const
Definition mdbx.h++:1026
buffer_pair_spec & operator=(stl_pair &&src)
Definition mdbx.h++:2755
slice key
Definition mdbx.h++:1069
buffer & append(const void *src, size_t bytes)
Definition mdbx.h++:2491
constexpr pair(const slice &key, const slice &value) noexcept
Definition mdbx.h++:1070
buffer_pair_spec(const txn &transaction, const pair &pair, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2724
const slice source
Definition mdbx.h++:1367
constexpr modality asset() const noexcept
Returns current data storage modality.
Definition mdbx.h++:1999
pair_result & operator=(const pair_result &) noexcept=default
void shrink_to_fit()
Reduces memory usage by freeing unused storage space.
Definition mdbx.h++:2489
bool is_empty() const noexcept
Checks whether a passed slice is empty, and therefore there will be no output bytes.
Definition mdbx.h++:1285
static buffer key_from(const int32_t signed_int32)
Definition mdbx.h++:2682
void clear() noexcept
Clears the contents and storage.
Definition mdbx.h++:2481
typename buffer_type::allocator_traits allocator_traits
Definition mdbx.h++:2690
char * write_bytes(char *dest, size_t dest_size) const
Fills the destination with data decoded from hexadecimal dump from a passed slice.
constexpr int32_t as_int32() const
Definition mdbx.h++:1029
static buffer base64(const slice &source, unsigned wrap_width=0, const allocator_type &alloc=allocator_type())
Returns a new buffer with a Base64 dump of the slice content.
Definition mdbx.h++:2206
constexpr buffer(const void *ptr, size_t bytes, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2135
typename ::std::allocator_traits< ALLOCATOR >::template rebind_alloc< uint64_t > allocator_type
Definition mdbx.h++:1547
static buffer key_from(const double ieee754_64bit)
Definition mdbx.h++:2654
constexpr const byte * byte_ptr() const noexcept
Returns casted to const pointer to byte an address of data.
Definition mdbx.h++:2019
pair & operator=(const stl_pair &couple)
Definition mdbx.h++:1086
int64_t as_int64_adapt() const
static buffer key_from_i64(const int64_t signed_int64)
Definition mdbx.h++:2662
constexpr const byte * end_byte_ptr() const noexcept
Returns casted to const pointer to byte an end of data.
Definition mdbx.h++:2022
static buffer base58(const slice &source, unsigned wrap_width=0, const allocator_type &alloc=allocator_type())
Returns a new buffer with a Base58 dump of the slice content.
Definition mdbx.h++:2201
static buffer clone(const buffer &src, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2330
buffer_pair_spec(const pair &pair, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2716
constexpr uint8_t as_uint8() const
Definition mdbx.h++:1023
CAPACITY_POLICY reservation_policy
Definition mdbx.h++:2691
constexpr buffer(const char *c_str, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2144
static constexpr bool is_swap_nothrow() noexcept
Definition mdbx.h++:1976
buffer & append(const ::std::basic_string< CHAR, T, A > &str)
Definition mdbx.h++:2476
buffer & append_u8(uint_fast8_t u8)
Definition mdbx.h++:2557
buffer & append_u24(uint_fast32_t u24)
Definition mdbx.h++:2577
constexpr uint64_t as_uint64() const
Definition mdbx.h++:1020
buffer(const ::std::basic_string< CHAR, T, A > &&)=delete
buffer_pair_spec(const slice &key, const slice &value, bool make_reference, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2712
static buffer key_from(const uint64_t unsigned_int64)
Definition mdbx.h++:2660
bool is_erroneous() const noexcept
Checks whether the content of a passed slice is a valid hexadecimal dump, and therefore there could b...
buffer encode_base58(unsigned wrap_width=0, const allocator_type &alloc=allocator_type()) const
Definition mdbx.h++:2239
buffer & append_u64(uint_fast64_t u64)
Definition mdbx.h++:2614
const unsigned wrap_width
Definition mdbx.h++:1208
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++:2533
static constexpr buffer null() noexcept
Build a null buffer which zero length and refers to null address.
Definition mdbx.h++:2183
const unsigned wrap_width
Definition mdbx.h++:1250
buffer & operator=(buffer &&src) noexcept(move_assign_alloc::is_nothrow())
Definition mdbx.h++:2455
uint32_t as_uint32_adapt() const
constexpr bool is_valid() const noexcept
Checks the slice is not refers to null address or has zero length.
Definition mdbx.h++:995
constexpr void * end() noexcept
Return a pointer to the end of the referenced data.
Definition mdbx.h++:2073
char * write_bytes(char *dest, size_t dest_size) const
Fills the buffer by Base64 dump of passed slice.
buffer & append_producer(PRODUCER &producer)
Definition mdbx.h++:2519
buffer_pair_spec(buffer_type &&key, buffer_type &&value) noexcept(buffer_type::move_assign_alloc::is_nothrow())
Definition mdbx.h++:2727
buffer_pair_spec(const txn &transaction, const slice &key, const slice &value, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2721
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++:693
buffer & append_producer(const PRODUCER &producer)
Definition mdbx.h++:2526
constexpr buffer(const ::std::basic_string< CHAR, T, A > &str, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2139
int16_t as_int16_adapt() const
static buffer key_from(const char *src, bool make_reference=false)
Definition mdbx.h++:2643
typename buffer_type::allocator_type allocator_type
Definition mdbx.h++:2689
@ pettiness_threshold
Definition mdbx.h++:1561
@ max_length
Definition mdbx.h++:1554
@ max_capacity
Definition mdbx.h++:1555
@ extra_inplace_storage
Definition mdbx.h++:1556
@ inplace_storage_size_rounding
Definition mdbx.h++:1557
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++:1289
uint64_t as_uint64_adapt() const
constexpr buffer_pair_spec() noexcept=default
constexpr to_base58(const slice &source, unsigned wrap_width=0) noexcept
Definition mdbx.h++:1210
friend class txn
Definition mdbx.h++:1568
constexpr buffer(const struct slice &src, const allocator_type &alloc=allocator_type())
Definition mdbx.h++:2127
slice(::std::basic_string_view< CHAR, T > &&sv)
Definition mdbx.h++:695
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++:1182
bool done
Definition mdbx.h++:1056
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++:1294
constexpr size_t capacity() const noexcept
Returns the number of bytes that can be held in currently allocated storage.
Definition mdbx.h++:2004
constexpr buffer & set_length(size_t bytes)
Set length of data.
Definition mdbx.h++:2084
The chunk of data stored inside the buffer or located outside it.
Definition mdbx.h++:1543
Type tag for delivered buffer template classes.
Definition mdbx.h++:1539
Base58 decoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1327
Base64 decoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1366
Hexadecimal decoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1293
Combines pair of slices for key and value to represent result of certain operations.
Definition mdbx.h++:1067
Combines pair of slices for key and value with boolean flag to represent result of certain operations...
Definition mdbx.h++:1116
References a data located outside the slice.
Definition mdbx.h++:626
Base58 encoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1206
Base64 encoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1248
Hexadecimal encoder which satisfy SliceTranscoder concept.
Definition mdbx.h++:1163
Combines data slice with boolean flag to represent result of certain operations.
Definition mdbx.h++:1054
incompatible_operation(const ::mdbx::error &)
fatal(exception &&src) noexcept
Definition mdbx.h++:543
remote_media(const ::mdbx::error &)
dangling_map_id(const ::mdbx::error &)
constexpr friend bool operator!=(const error &a, const error &b) noexcept
Definition mdbx.h++:4713
fatal(const ::mdbx::error &) noexcept
reader_slot_busy(const ::mdbx::error &)
exception(const exception &)=default
::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
Panics on unrecoverable errors inside destructors etc.
fatal(const exception &src) noexcept
Definition mdbx.h++:542
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 &)
static void success_or_throw(int error_code)
Definition mdbx.h++:513
laggard_reader(const ::mdbx::error &)
db_full(const ::mdbx::error &)
duplicated_lck_file(const ::mdbx::error &)
const ::mdbx::error error() const noexcept
Definition mdbx.h++:533
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++:544
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++:545
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 &)
constexpr friend bool operator==(const error &a, const error &b) noexcept
Definition mdbx.h++:4711
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++:475
Transfers C++ exceptions thru C callbacks.
Definition mdbx.h++:460
LIBMDBX_API void throw_allocators_mismatch()
#define MDBX_DECLARE_EXCEPTION(NAME)
Definition mdbx.h++:551
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:5017
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:5021
LIBMDBX_API uint64_t mdbx_key_from_jsonInteger(const int64_t json_integer)
#define MDBX_CXX20_CONSTEXPR
Definition mdbx.h++:192
#define MDBX_MSVC_DECLSPEC_EMPTY_BASES
Definition mdbx.h++:135
#define MDBX_CXX17_FALLTHROUGH
Definition mdbx.h++:234
#define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE)
Definition mdbx.h++:274
#define MDBX_EXTERN_API_TEMPLATE(API_ATTRIBUTES,...)
Definition mdbx.h++:125
#define MDBX_CXX11_CONSTEXPR_ENUM
Definition mdbx.h++:202
#define MDBX_CXX17_CONSTEXPR
Definition mdbx.h++:181
#define MDBX_CONSTEXPR_ASSERT(expr)
Definition mdbx.h++:220
#define MDBX_IF_CONSTEXPR
Definition mdbx.h++:225
#define MDBX_CXX01_CONSTEXPR_ENUM
Definition mdbx.h++:201
#define MDBX_CXX20_LIKELY
Definition mdbx.h++:240
The libmdbx C API header file.
constexpr bool allocator_is_always_equal() noexcept
Definition mdbx.h++:1405
The libmdbx C++ API namespace.
Definition mdbx.h++:307
string to_string(const ::mdbx::slice &value)
Definition mdbx.h++:6544
byte buffer_[inplace_size - sizeof(byte)]
Definition mdbx.h++:1641
constexpr inplace_flag_holder(byte signature)
Definition mdbx.h++:1643
byte lastbyte_
Definition mdbx.h++:1642
estimate_result(const cursor &cursor, move_operation operation)
Definition mdbx.h++:4283
estimate_result & operator=(const estimate_result &) noexcept=default
ptrdiff_t approximate_quantity
Definition mdbx.h++:4282
estimate_result(const estimate_result &) noexcept=default
estimate_result(const cursor &cursor, move_operation operation, const slice &key)
Definition mdbx.h++:4285
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++:4273
move_result(cursor &cursor, move_operation operation, bool throw_notfound)
Definition mdbx.h++:4271
Tagged type for output to std::ostream.
Definition mdbx.h++:3051
intptr_t bytes
Definition mdbx.h++:3052
constexpr size(intptr_t bytes) noexcept
Definition mdbx.h++:3053
Database geometry for size management.
Definition mdbx.h++:3027
constexpr geometry(const geometry &) noexcept=default
intptr_t size_upper
The upper bound of database size in bytes.
Definition mdbx.h++:3075
intptr_t pagesize
The database page size for new database creation or default_value otherwise.
Definition mdbx.h++:3087
@ GB
bytes (0x3B9A_CA00)
Definition mdbx.h++:3034
@ minimal_value
Means "minimal acceptable".
Definition mdbx.h++:3030
@ MB
bytes (0x000F_4240)
Definition mdbx.h++:3033
@ GiB
bytes (0x4000_0000)
Definition mdbx.h++:3042
@ maximal_value
Means "maximal acceptable".
Definition mdbx.h++:3031
@ default_value
Means "keep current or use default".
Definition mdbx.h++:3029
@ kB
bytes (0x03E8)
Definition mdbx.h++:3032
@ MiB
bytes (0x0010_0000)
Definition mdbx.h++:3041
@ KiB
bytes (0x0400)
Definition mdbx.h++:3040
constexpr geometry() noexcept
Definition mdbx.h++:3091
intptr_t growth_step
The growth step in bytes, must be greater than zero to allow the database to grow.
Definition mdbx.h++:3078
intptr_t size_now
The size in bytes to setup the database size for now.
Definition mdbx.h++:3063
intptr_t shrink_threshold
The shrink threshold in bytes, must be greater than zero to allow the database to shrink.
Definition mdbx.h++:3081
intptr_t size_lower
The lower bound of database size in bytes.
Definition mdbx.h++:3058
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++:3094
Operate options.
Definition mdbx.h++:3129
bool disable_readahead
Definition mdbx.h++:3138
bool enable_validation
Definition mdbx.h++:3142
bool no_sticky_threads
Definition mdbx.h++:3131
constexpr operate_options() noexcept
Definition mdbx.h++:3143
bool disable_clear_memory
Definition mdbx.h++:3140
constexpr operate_options & operator=(const operate_options &) noexcept=default
bool exclusive
Definition mdbx.h++:3136
constexpr operate_options(const operate_options &) noexcept=default
operate_options(MDBX_env_flags_t) noexcept
bool nested_transactions
Разрешает вложенные транзакции ценой отключения MDBX_WRITEMAP и увеличением накладных расходов.
Definition mdbx.h++:3134
Operate parameters.
Definition mdbx.h++:3151
env::durability durability
Definition mdbx.h++:3159
env::operate_options options
Definition mdbx.h++:3161
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++:3165
static env::mode mode_from_flags(MDBX_env_flags_t) noexcept
constexpr operate_parameters & operator=(const operate_parameters &) noexcept=default
unsigned max_readers
The maximum number of threads/reader slots for the environment. Zero means default value.
Definition mdbx.h++:3157
constexpr operate_parameters(const operate_parameters &) noexcept=default
env::reclaiming_options reclaiming
Definition mdbx.h++:3160
env::mode mode
Definition mdbx.h++:3158
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++:3154
constexpr operate_parameters() noexcept
Definition mdbx.h++:3163
MDBX_env_flags_t make_flags(bool accede=true, bool use_subdirectory=false) const
Reader information.
Definition mdbx.h++:3557
mdbx_tid_t thread
The reader thread ID.
Definition mdbx.h++:3560
uint64_t transaction_lag
Definition mdbx.h++:3563
size_t bytes_used
Definition mdbx.h++:3567
uint64_t transaction_id
Definition mdbx.h++:3561
int slot
The reader lock table slot number.
Definition mdbx.h++:3558
mdbx_pid_t pid
The reader process ID.
Definition mdbx.h++:3559
size_t bytes_retained
Definition mdbx.h++:3570
Garbage reclaiming options.
Definition mdbx.h++:3118
constexpr reclaiming_options(const reclaiming_options &) noexcept=default
reclaiming_options(MDBX_env_flags_t) noexcept
constexpr reclaiming_options & operator=(const reclaiming_options &) noexcept=default
constexpr reclaiming_options() noexcept
Definition mdbx.h++:3121
bool lifo
Definition mdbx.h++:3120
Additional parameters for creating a new database.
Definition mdbx.h++:3666
mdbx_mode_t file_mode_bits
Definition mdbx.h++:3668
constexpr create_parameters() noexcept=default
bool use_subdirectory
Definition mdbx.h++:3669
env::geometry geometry
Definition mdbx.h++:3667
map_handle::state state
Definition mdbx.h++:2966
info(const info &) noexcept=default
map_handle::flags flags
Definition mdbx.h++:2965
info & operator=(const info &) noexcept=default
size_t operator()(::mdbx::buffer< ALLOCATOR, CAPACITY_POLICY > const &buffer) const noexcept
Definition mdbx.h++:6649
size_t operator()(const ::mdbx::cursor &cursor) const noexcept
Definition mdbx.h++:6645
std::hash< const MDBX_cursor * > inherited
Definition mdbx.h++:6644
size_t operator()(const ::mdbx::env &env) const noexcept
Definition mdbx.h++:6635
std::hash< const MDBX_env * > inherited
Definition mdbx.h++:6634
constexpr size_t operator()(const ::mdbx::map_handle &handle) const noexcept
Definition mdbx.h++:6630
constexpr size_t operator()(const ::mdbx::slice &slice) const noexcept
Definition mdbx.h++:6626
std::hash< const MDBX_txn * > inherited
Definition mdbx.h++:6639
size_t operator()(const ::mdbx::txn &txn) const noexcept
Definition mdbx.h++:6640
capacity_holder capacity_
Definition mdbx.h++:1647
constexpr byte * make_allocated(const ::std::pair< allocator_pointer, size_t > &pair) noexcept
Definition mdbx.h++:1680
allocator_pointer stub_ptr_
Definition mdbx.h++:1622
constexpr bool is_inplace() const noexcept
Definition mdbx.h++:1659
static constexpr size_t advise_capacity(const size_t current, const size_t wanna)
Definition mdbx.h++:1700
static constexpr bool is_suitable_for_inplace(size_t capacity_bytes) noexcept
Definition mdbx.h++:1651
constexpr bool is_allocated() const noexcept
Definition mdbx.h++:1666
inplace_flag_holder inplace_
Definition mdbx.h++:1648
static constexpr size_t inplace_capacity() noexcept
Definition mdbx.h++:1650
allocator_pointer allocated_ptr_
Definition mdbx.h++:1646
size_t stub_capacity_bytes_
Definition mdbx.h++:1623
constexpr size_t capacity() const noexcept
Definition mdbx.h++:1719
byte pad_[inplace_size - sizeof(allocator_pointer)]
Definition mdbx.h++:1636
size_t bytes_
Definition mdbx.h++:1637
constexpr const byte * address() const noexcept
Definition mdbx.h++:1713
constexpr bin() noexcept
Definition mdbx.h++:1694
@ inplace_size
Definition mdbx.h++:1631
@ inplace_signature_limit
Definition mdbx.h++:1628
@ inplace_size_rounding
Definition mdbx.h++:1630
constexpr byte * address() noexcept
Definition mdbx.h++:1716
@ lastbyte_poison
Definition mdbx.h++:1626
@ lastbyte_inplace_signature
Definition mdbx.h++:1626
constexpr bool is_inplace(const void *ptr) const noexcept
Definition mdbx.h++:1709
constexpr byte * make_inplace() noexcept
Definition mdbx.h++:1668