mirror of
https://github.com/isar/libmdbx.git
synced 2025-04-02 15:22:58 +08:00
mdbx++: добавление mdbx::cursor_managed::withdraw_handle()
(backport).
This commit is contained in:
parent
58729a2fbd
commit
73d52c1963
8
mdbx.h++
8
mdbx.h++
@ -4155,9 +4155,9 @@ public:
|
|||||||
class LIBMDBX_API_TYPE cursor {
|
class LIBMDBX_API_TYPE cursor {
|
||||||
protected:
|
protected:
|
||||||
MDBX_cursor *handle_{nullptr};
|
MDBX_cursor *handle_{nullptr};
|
||||||
MDBX_CXX11_CONSTEXPR cursor(MDBX_cursor *ptr) noexcept;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
MDBX_CXX11_CONSTEXPR cursor(MDBX_cursor *ptr) noexcept;
|
||||||
MDBX_CXX11_CONSTEXPR cursor() noexcept = default;
|
MDBX_CXX11_CONSTEXPR cursor() noexcept = default;
|
||||||
cursor(const cursor &) noexcept = default;
|
cursor(const cursor &) noexcept = default;
|
||||||
inline cursor &operator=(cursor &&other) noexcept;
|
inline cursor &operator=(cursor &&other) noexcept;
|
||||||
@ -4561,6 +4561,12 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline MDBX_cursor *withdraw_handle() noexcept {
|
||||||
|
MDBX_cursor *handle = handle_;
|
||||||
|
handle_ = nullptr;
|
||||||
|
return handle;
|
||||||
|
}
|
||||||
|
|
||||||
cursor_managed(const cursor_managed &) = delete;
|
cursor_managed(const cursor_managed &) = delete;
|
||||||
cursor_managed &operator=(const cursor_managed &) = delete;
|
cursor_managed &operator=(const cursor_managed &) = delete;
|
||||||
~cursor_managed() noexcept { ::mdbx_cursor_close(handle_); }
|
~cursor_managed() noexcept { ::mdbx_cursor_close(handle_); }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user