From e51140fe48e7802ea4b11ee8ae6be0b5cbbd86e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Thu, 9 Feb 2023 20:05:11 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-doc:=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20doxygen-?= =?UTF-8?q?=D0=BE=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=B8=D1=8F=20C++=20API,?= =?UTF-8?q?=20=D0=B2=20=D0=BE=D1=81=D0=BE=D0=B1=D0=B5=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=20C++20=20concepts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdbx.h++ | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/mdbx.h++ b/mdbx.h++ index 47d2648f..8e5e5ecf 100644 --- a/mdbx.h++ +++ b/mdbx.h++ @@ -223,17 +223,18 @@ #endif /* MDBX_CXX20_UNLIKELY */ #ifndef MDBX_HAVE_CXX20_CONCEPTS -#if defined(DOXYGEN) || \ - (defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L) +#if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L #include #define MDBX_HAVE_CXX20_CONCEPTS 1 +#elif defined(DOXYGEN) +#define MDBX_HAVE_CXX20_CONCEPTS 1 #else #define MDBX_HAVE_CXX20_CONCEPTS 0 #endif /* */ #endif /* MDBX_HAVE_CXX20_CONCEPTS */ #ifndef MDBX_CXX20_CONCEPT -#if MDBX_HAVE_CXX20_CONCEPTS +#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN) #define MDBX_CXX20_CONCEPT(CONCEPT, NAME) CONCEPT NAME #else #define MDBX_CXX20_CONCEPT(CONCEPT, NAME) typename NAME @@ -241,7 +242,7 @@ #endif /* MDBX_CXX20_CONCEPT */ #ifndef MDBX_ASSERT_CXX20_CONCEPT_SATISFIED -#if MDBX_HAVE_CXX20_CONCEPTS +#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN) #define MDBX_ASSERT_CXX20_CONCEPT_SATISFIED(CONCEPT, TYPE) \ static_assert(CONCEPT) #else @@ -551,8 +552,11 @@ static MDBX_CXX14_CONSTEXPR size_t check_length(size_t headroom, size_t payload, /// \defgroup cxx_data slices and buffers /// @{ -#if MDBX_HAVE_CXX20_CONCEPTS +#if MDBX_HAVE_CXX20_CONCEPTS || defined(DOXYGEN) +/** \concept MutableByteProducer + * \interface MutableByteProducer + * \brief MutableByteProducer C++20 concept */ template concept MutableByteProducer = requires(T a, char array[42]) { { a.is_empty() } -> std::same_as; @@ -560,6 +564,9 @@ concept MutableByteProducer = requires(T a, char array[42]) { { a.write_bytes(&array[0], size_t(42)) } -> std::same_as; }; +/** \concept ImmutableByteProducer + * \interface ImmutableByteProducer + * \brief ImmutableByteProducer C++20 concept */ template concept ImmutableByteProducer = requires(const T &a, char array[42]) { { a.is_empty() } -> std::same_as; @@ -567,6 +574,9 @@ concept ImmutableByteProducer = requires(const T &a, char array[42]) { { a.write_bytes(&array[0], size_t(42)) } -> std::same_as; }; +/** \concept SliceTranscoder + * \interface SliceTranscoder + * \brief SliceTranscoder C++20 concept */ template concept SliceTranscoder = ImmutableByteProducer && requires(const slice &source, const T &a) { @@ -3106,10 +3116,12 @@ public: operate_parameters(const operate_parameters &) noexcept = default; MDBX_CXX14_CONSTEXPR operate_parameters & operator=(const operate_parameters &) noexcept = default; - MDBX_env_flags_t - make_flags(bool accede = true, ///< \copydoc MDBX_ACCEDE - bool use_subdirectory = - false ///< use subdirectory to place the DB files + MDBX_env_flags_t make_flags( + bool accede = true, ///< Allows accepting incompatible operating options + ///< in case the database is already being used by + ///< another process(es) \see MDBX_ACCEDE + bool use_subdirectory = + false ///< use subdirectory to place the DB files ) const; static env::mode mode_from_flags(MDBX_env_flags_t) noexcept; static env::durability durability_from_flags(MDBX_env_flags_t) noexcept;