mirror of
https://github.com/isar/libmdbx.git
synced 2025-08-19 19:39:26 +08:00
mdbx: использование const MDBX_txn
где это возможно в API.
This commit is contained in:
13
mdbx.h++
13
mdbx.h++
@@ -3839,7 +3839,7 @@ public:
|
||||
txn_managed start_nested();
|
||||
|
||||
/// \brief Opens cursor for specified key-value map handle.
|
||||
inline cursor_managed open_cursor(map_handle map);
|
||||
inline cursor_managed open_cursor(map_handle map) const;
|
||||
|
||||
/// \brief Unbind or close all cursors.
|
||||
inline size_t release_all_cursors(bool unbind) const;
|
||||
@@ -4226,11 +4226,11 @@ public:
|
||||
|
||||
/// \brief Renew/bind a cursor with a new transaction and previously used
|
||||
/// key-value map handle.
|
||||
inline void renew(::mdbx::txn &txn);
|
||||
inline void renew(const ::mdbx::txn &txn);
|
||||
|
||||
/// \brief Bind/renew a cursor with a new transaction and specified key-value
|
||||
/// map handle.
|
||||
inline void bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle);
|
||||
inline void bind(const ::mdbx::txn &txn, ::mdbx::map_handle map_handle);
|
||||
|
||||
/// \brief Unbind cursor from a transaction.
|
||||
inline void unbind();
|
||||
@@ -5469,7 +5469,7 @@ inline txn::info txn::get_info(bool scan_reader_lock_table) const {
|
||||
return r;
|
||||
}
|
||||
|
||||
inline cursor_managed txn::open_cursor(map_handle map) {
|
||||
inline cursor_managed txn::open_cursor(map_handle map) const {
|
||||
MDBX_cursor *ptr;
|
||||
error::success_or_throw(::mdbx_cursor_open(handle_, map.dbi, &ptr));
|
||||
return cursor_managed(ptr);
|
||||
@@ -6121,11 +6121,12 @@ inline ptrdiff_t cursor::estimate(move_operation operation) const {
|
||||
return estimate(operation, &unused_key, nullptr);
|
||||
}
|
||||
|
||||
inline void cursor::renew(::mdbx::txn &txn) {
|
||||
inline void cursor::renew(const ::mdbx::txn &txn) {
|
||||
error::success_or_throw(::mdbx_cursor_renew(txn, handle_));
|
||||
}
|
||||
|
||||
inline void cursor::bind(::mdbx::txn &txn, ::mdbx::map_handle map_handle) {
|
||||
inline void cursor::bind(const ::mdbx::txn &txn,
|
||||
::mdbx::map_handle map_handle) {
|
||||
error::success_or_throw(::mdbx_cursor_bind(txn, handle_, map_handle.dbi));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user