libmdbx  0.11.6.39 (2022-04-13T11:05:50+03:00)
One of the fastest compact embeddable key-value ACID database without WAL.
mdbx::cursor_managed Class Reference

Managed cursor. More...

#include <mdbx.h++>

Inherits mdbx::cursor.

Public Member Functions

 cursor_managed ()
 Creates a new managed cursor with underlying object. More...
 
void close ()
 Explicitly closes the cursor. More...
 
 cursor_managed (cursor_managed &&)=default
 
cursor_managedoperator= (cursor_managed &&other)
 
 cursor_managed (const cursor_managed &)=delete
 
cursor_managedoperator= (const cursor_managed &)=delete
 
 ~cursor_managed () noexcept
 
- Public Member Functions inherited from mdbx::cursor
MDBX_CXX11_CONSTEXPR cursor () noexcept=default
 
 cursor (const cursor &) noexcept=default
 
cursoroperator= (cursor &&other) noexcept
 
 cursor (cursor &&other) noexcept
 
 ~cursor () noexcept
 
MDBX_CXX14_CONSTEXPR operator bool () const noexcept
 
MDBX_CXX14_CONSTEXPR operator const MDBX_cursor * () const
 
MDBX_CXX14_CONSTEXPR operator MDBX_cursor * ()
 
move_result move (move_operation operation, bool throw_notfound)
 
move_result to_first (bool throw_notfound=true)
 
move_result to_previous (bool throw_notfound=true)
 
move_result to_previous_last_multi (bool throw_notfound=true)
 
move_result to_current_first_multi (bool throw_notfound=true)
 
move_result to_current_prev_multi (bool throw_notfound=true)
 
move_result current (bool throw_notfound=true) const
 
move_result to_current_next_multi (bool throw_notfound=true)
 
move_result to_current_last_multi (bool throw_notfound=true)
 
move_result to_next_first_multi (bool throw_notfound=true)
 
move_result to_next (bool throw_notfound=true)
 
move_result to_last (bool throw_notfound=true)
 
move_result move (move_operation operation, const slice &key, bool throw_notfound)
 
move_result find (const slice &key, bool throw_notfound=true)
 
move_result lower_bound (const slice &key, bool throw_notfound=true)
 
move_result move (move_operation operation, const slice &key, const slice &value, bool throw_notfound)
 
move_result find_multivalue (const slice &key, const slice &value, bool throw_notfound=true)
 
move_result lower_bound_multivalue (const slice &key, const slice &value, bool throw_notfound=false)
 
bool seek (const slice &key)
 
bool move (move_operation operation, slice &key, slice &value, bool throw_notfound)
 
size_t count_multivalue () const
 Return count of duplicates for current key. More...
 
bool eof () const
 
bool on_first () const
 
bool on_last () const
 
ptrdiff_t estimate (slice key, slice value) const
 
ptrdiff_t estimate (slice key) const
 
ptrdiff_t estimate (move_operation operation) const
 
void renew (::mdbx::txn &txn)
 Renew/bind a cursor with a new transaction and previously used key-value map handle. More...
 
void bind (::mdbx::txn &txn, ::mdbx::map_handle map_handle)
 Bind/renew a cursor with a new transaction and specified key-value map handle. More...
 
inline ::mdbx::txn txn () const
 Returns the cursor's transaction. More...
 
map_handle map () const
 
 operator::mdbx::txn () const
 
 operator::mdbx::map_handle () const
 
MDBX_error_t put (const slice &key, slice *value, MDBX_put_flags_t flags) noexcept
 
void insert (const slice &key, slice value)
 
value_result try_insert (const slice &key, slice value)
 
slice insert_reserve (const slice &key, size_t value_length)
 
value_result try_insert_reserve (const slice &key, size_t value_length)
 
void upsert (const slice &key, const slice &value)
 
slice upsert_reserve (const slice &key, size_t value_length)
 
void update (const slice &key, const slice &value)
 
bool try_update (const slice &key, const slice &value)
 
slice update_reserve (const slice &key, size_t value_length)
 
value_result try_update_reserve (const slice &key, size_t value_length)
 
bool erase (bool whole_multivalue=false)
 Removes single key-value pair or all multi-values at the current cursor position. More...
 
bool erase (const slice &key, bool whole_multivalue=true)
 Seeks and removes first value or whole multi-value of the given key. More...
 
bool erase (const slice &key, const slice &value)
 Seeks and removes the particular multi-value entry of the key. More...
 

Friends

class txn
 

Additional Inherited Members

- Public Types inherited from mdbx::cursor
enum  move_operation {
  first = MDBX_FIRST, last = MDBX_LAST, next = MDBX_NEXT, previous = MDBX_PREV,
  get_current = MDBX_GET_CURRENT, multi_prevkey_lastvalue = MDBX_PREV_NODUP, multi_currentkey_firstvalue = MDBX_FIRST_DUP, multi_currentkey_prevvalue = MDBX_PREV_DUP,
  multi_currentkey_nextvalue = MDBX_NEXT_DUP, multi_currentkey_lastvalue = MDBX_LAST_DUP, multi_nextkey_firstvalue = MDBX_NEXT_NODUP, multi_find_pair = MDBX_GET_BOTH,
  multi_exactkey_lowerboundvalue = MDBX_GET_BOTH_RANGE, find_key = MDBX_SET, key_exact = MDBX_SET_KEY, key_lowerbound = MDBX_SET_RANGE
}
 
- Protected Member Functions inherited from mdbx::cursor
MDBX_CXX11_CONSTEXPR cursor (MDBX_cursor *ptr) noexcept
 
bool move (move_operation operation, MDBX_val *key, MDBX_val *value, bool throw_notfound) const
 
ptrdiff_t estimate (move_operation operation, MDBX_val *key, MDBX_val *value) const
 
- Protected Attributes inherited from mdbx::cursor
MDBX_cursorhandle_ {nullptr}
 

Detailed Description

Managed cursor.

As other managed classes, cursor_managed destroys the represented underlying object from the own class destructor, but disallows copying and assignment for instances.

See also
mdbx_cursor_create()
mdbx_cursor_bind()
mdbx_cursor_close()

Constructor & Destructor Documentation

◆ cursor_managed() [1/3]

mdbx::cursor_managed::cursor_managed ( )
inline

Creates a new managed cursor with underlying object.

◆ cursor_managed() [2/3]

mdbx::cursor_managed::cursor_managed ( cursor_managed &&  )
default

◆ cursor_managed() [3/3]

mdbx::cursor_managed::cursor_managed ( const cursor_managed )
delete

◆ ~cursor_managed()

mdbx::cursor_managed::~cursor_managed ( )
inlinenoexcept

Member Function Documentation

◆ close()

void mdbx::cursor_managed::close ( )

Explicitly closes the cursor.

◆ operator=() [1/2]

cursor_managed& mdbx::cursor_managed::operator= ( const cursor_managed )
delete

◆ operator=() [2/2]

cursor_managed& mdbx::cursor_managed::operator= ( cursor_managed &&  other)
inline

Friends And Related Function Documentation

◆ txn

friend class txn
friend

The documentation for this class was generated from the following file: