mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-19 19:39:26 +08:00
mdbx: добавление mdbx_txn_release_all_cursors()
в API.
This commit is contained in:
16
mdbx.h++
16
mdbx.h++
@@ -3841,6 +3841,15 @@ public:
|
||||
/// \brief Opens cursor for specified key-value map handle.
|
||||
inline cursor_managed open_cursor(map_handle map);
|
||||
|
||||
/// \brief Unbind or close all cursors.
|
||||
inline size_t release_all_cursors(bool unbind) const;
|
||||
|
||||
/// \brief Close all cursors.
|
||||
inline size_t close_all_cursors() const { return release_all_cursors(false); }
|
||||
|
||||
/// \brief Unbind all cursors.
|
||||
inline size_t unbind_all_cursors() const { return release_all_cursors(true); }
|
||||
|
||||
/// \brief Open existing key-value map.
|
||||
inline map_handle open_map(
|
||||
const char *name,
|
||||
@@ -5466,6 +5475,13 @@ inline cursor_managed txn::open_cursor(map_handle map) {
|
||||
return cursor_managed(ptr);
|
||||
}
|
||||
|
||||
inline size_t txn::release_all_cursors(bool unbind) const {
|
||||
int err = ::mdbx_txn_release_all_cursors(handle_, unbind);
|
||||
if (MDBX_UNLIKELY(err < 0))
|
||||
MDBX_CXX20_UNLIKELY error::throw_exception(err);
|
||||
return size_t(err);
|
||||
}
|
||||
|
||||
inline ::mdbx::map_handle
|
||||
txn::open_map(const char *name, const ::mdbx::key_mode key_mode,
|
||||
const ::mdbx::value_mode value_mode) const {
|
||||
|
Reference in New Issue
Block a user