Class mdbx::cursor
Unmanaged cursor. More...
#include <mdbx.h++>
Inherited by the following classes: mdbx::cursor_managed
Classes
| Type | Name |
|---|---|
| struct | estimate_result |
| struct | move_result |
Public Types
| Type | Name |
|---|---|
| enum | bunch_delete Modes for deleting bunches of neighboring items, see MDBX_bunch_action_t() . The EXCLUDING and INCLUDING suffixes mean correspondingly excluding and including deletion items in the current cursor position. |
| enum | move_operation |
Public Functions
| Type | Name |
|---|---|
| cursor_managed | clone (void * your_context=nullptr) const |
| move_result | current (bool throw_notfound=true) const |
| constexpr | cursor () noexcept |
| cursor (const cursor &) noexcept |
|
| ptrdiff_t | distance_from (const cursor from, unsigned deepness=42) const |
| ptrdiff_t | distance_from_first (unsigned deepness=42) const |
| ptrdiff_t | distance_to (const cursor to, unsigned deepness=42) const |
| ptrdiff_t | distance_to_end (unsigned deepness=42) const |
| bool | fullscan (CALLABLE_PREDICATE predicate, bool backward=false) |
| move_result | get_multiple_samelength (bool throw_notfound=false) |
| const MDBX_cursor * | handle () noexcept const |
| MDBX_cursor * | handle () noexcept |
| void | insert (const pair & kv) |
| bool | is_after_than (const cursor & other, bool ignore_nested=false) const |
| bool | is_before_than (const cursor & other, bool ignore_nested=false) const |
| bool | is_same_or_after_than (const cursor & other, bool ignore_nested=false) const |
| bool | is_same_or_before_than (const cursor & other, bool ignore_nested=false) const |
| bool | is_same_position (const cursor & other, bool ignore_nested=false) const |
| move_result | move (move_operation operation, bool throw_notfound) |
| move_result | move (move_operation operation, const slice & key, bool throw_notfound) |
| move_result | move (move_operation operation, const slice & key, const slice & value, bool throw_notfound) |
| bool | move (move_operation operation, slice & key, slice & value, bool throw_notfound) |
| move_result | next_multiple_samelength (bool throw_notfound=false) |
| constexpr | operator MDBX_cursor * () noexcept |
| constexpr | operator const MDBX_cursor * () noexcept const |
| map_handle () const |
|
| txn () const |
|
| cursor & | operator= (const cursor &) noexcept |
| move_result | previous_multiple_samelength (bool throw_notfound=false) |
| void | put (const pair & kv, put_mode mode) |
| size_t | put_multiple_samelength (const slice & key, const VALUE * values_array, size_t values_count, put_mode mode, bool allow_partial=false) |
| void | put_multiple_samelength (const slice & key, const ::std::vector< VALUE > & vector, put_mode mode) |
| slice | reserve_current (size_t value_length) Reserves and returns the space for storing a value associated with a key at the current cursor position. |
| slice | reverse_current (size_t value_length) Deprecated misspelling of reserve_current() . |
| bool | scan_until (CALLABLE_PREDICATE predicate, move_operation start=first, move_operation turn=next) |
| bool | scan_until_from (CALLABLE_PREDICATE predicate, slice & from, move_operation start=key_greater_or_equal, move_operation turn=next) |
| bool | scan_until_from (CALLABLE_PREDICATE predicate, pair & from, move_operation start=pair_greater_or_equal, move_operation turn=next) |
| move_result | seek_multiple_samelength (const slice & key, bool throw_notfound=true) |
| move_result | to_current_first_multi (bool throw_notfound=true) |
| move_result | to_current_last_multi (bool throw_notfound=true) |
| move_result | to_current_next_multi (bool throw_notfound=true) |
| move_result | to_current_prev_multi (bool throw_notfound=true) |
| move_result | to_exact_key_value_equal (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_exact_key_value_greater_or_equal (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_exact_key_value_greater_than (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_exact_key_value_lesser_or_equal (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_exact_key_value_lesser_than (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_first (bool throw_notfound=true) |
| move_result | to_key_equal (const slice & key, bool throw_notfound=true) |
| move_result | to_key_exact (const slice & key, bool throw_notfound=true) |
| move_result | to_key_greater_or_equal (const slice & key, bool throw_notfound=true) |
| move_result | to_key_greater_than (const slice & key, bool throw_notfound=true) |
| move_result | to_key_lesser_or_equal (const slice & key, bool throw_notfound=true) |
| move_result | to_key_lesser_than (const slice & key, bool throw_notfound=true) |
| move_result | to_last (bool throw_notfound=true) |
| move_result | to_next (bool throw_notfound=true) |
| move_result | to_next_first_multi (bool throw_notfound=true) |
| move_result | to_pair_equal (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_pair_exact (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_pair_greater_or_equal (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_pair_greater_than (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_pair_lesser_or_equal (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_pair_lesser_than (const slice & key, const slice & value, bool throw_notfound=true) |
| move_result | to_previous (bool throw_notfound=true) |
| move_result | to_previous_last_multi (bool throw_notfound=true) |
| value_result | try_insert (const pair & kv) |
| void | update_current (const slice & value) Updates value associated with a key at the current cursor position. |
| void | upsert (const pair & kv) |
Protected Attributes
| Type | Name |
|---|---|
| MDBX_cursor * | handle_ = {nullptr} |
Detailed Description
Like other unmanaged classes, cursor allows copying and assignment for handles as a values, but does not manage nor destroys the represented underlying object from the own class destructor.
See also: mdbx_cursor_create()
See also: mdbx_cursor_bind()
See also: mdbx_cursor_close()
Public Types Documentation
enum bunch_delete
Modes for deleting bunches of neighboring items, see MDBX_bunch_action_t() . The EXCLUDING and INCLUDING suffixes mean correspondingly excluding and including deletion items in the current cursor position.
enum mdbx::cursor::bunch_delete {
delete_current_value = MDBX_DELETE_CURRENT_VALUE,
delete_current_multival_before_excluding = MDBX_DELETE_CURRENT_MULTIVAL_BEFORE_EXCLUDING,
delete_current_multival_before_including = MDBX_DELETE_CURRENT_MULTIVAL_BEFORE_INCLUDING,
delete_current_multival_after_including = MDBX_DELETE_CURRENT_MULTIVAL_AFTER_INCLUDING,
delete_current_multival_after_excluding = MDBX_DELETE_CURRENT_MULTIVAL_AFTER_EXCLUDING,
delete_current_multival_all = MDBX_DELETE_CURRENT_MULTIVAL_ALL,
delete_before_excluding = MDBX_DELETE_BEFORE_EXCLUDING,
delete_before_including = MDBX_DELETE_BEFORE_INCLUDING,
delete_after_including = MDBX_DELETE_AFTER_INCLUDING,
delete_after_excluding = MDBX_DELETE_AFTER_EXCLUDING,
delete_whole = MDBX_DELETE_WHOLE
};
enum move_operation
enum mdbx::cursor::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,
seek_key = MDBX_SET,
key_exact = MDBX_SET_KEY,
key_lowerbound = MDBX_SET_RANGE,
key_lesser_than = MDBX_TO_KEY_LESSER_THAN,
key_lesser_or_equal = MDBX_TO_KEY_LESSER_OR_EQUAL,
key_equal = MDBX_TO_KEY_EQUAL,
key_greater_or_equal = MDBX_TO_KEY_GREATER_OR_EQUAL,
key_greater_than = MDBX_TO_KEY_GREATER_THAN,
multi_exactkey_value_lesser_than = MDBX_TO_EXACT_KEY_VALUE_LESSER_THAN,
multi_exactkey_value_lesser_or_equal = MDBX_TO_EXACT_KEY_VALUE_LESSER_OR_EQUAL,
multi_exactkey_value_equal = MDBX_TO_EXACT_KEY_VALUE_EQUAL,
multi_exactkey_value_greater_or_equal = MDBX_TO_EXACT_KEY_VALUE_GREATER_OR_EQUAL,
multi_exactkey_value_greater = MDBX_TO_EXACT_KEY_VALUE_GREATER_THAN,
pair_lesser_than = MDBX_TO_PAIR_LESSER_THAN,
pair_lesser_or_equal = MDBX_TO_PAIR_LESSER_OR_EQUAL,
pair_equal = MDBX_TO_PAIR_EQUAL,
pair_exact = pair_equal,
pair_greater_or_equal = MDBX_TO_PAIR_GREATER_OR_EQUAL,
pair_greater_than = MDBX_TO_PAIR_GREATER_THAN,
batch_samelength = MDBX_GET_MULTIPLE,
batch_samelength_next = MDBX_NEXT_MULTIPLE,
batch_samelength_previous = MDBX_PREV_MULTIPLE,
seek_and_batch_samelength = MDBX_SEEK_AND_GET_MULTIPLE
};
Public Functions Documentation
function clone
cursor_managed mdbx::cursor::clone (
void * your_context=nullptr
) const
function current
inline move_result mdbx::cursor::current (
bool throw_notfound=true
) const
function cursor [1/2]
constexpr mdbx::cursor::cursor () noexcept
function cursor [2/2]
mdbx::cursor::cursor (
const cursor &
) noexcept
function distance_from
inline ptrdiff_t mdbx::cursor::distance_from (
const cursor from,
unsigned deepness=42
) const
function distance_from_first
inline ptrdiff_t mdbx::cursor::distance_from_first (
unsigned deepness=42
) const
function distance_to
inline ptrdiff_t mdbx::cursor::distance_to (
const cursor to,
unsigned deepness=42
) const
function distance_to_end
inline ptrdiff_t mdbx::cursor::distance_to_end (
unsigned deepness=42
) const
function fullscan
template<typename CALLABLE_PREDICATE>
inline bool mdbx::cursor::fullscan (
CALLABLE_PREDICATE predicate,
bool backward=false
)
function get_multiple_samelength
inline move_result mdbx::cursor::get_multiple_samelength (
bool throw_notfound=false
)
function handle [1/2]
inline const MDBX_cursor * mdbx::cursor::handle () noexcept const
function handle [2/2]
inline MDBX_cursor * mdbx::cursor::handle () noexcept
function insert
inline void mdbx::cursor::insert (
const pair & kv
)
function is_after_than
inline bool mdbx::cursor::is_after_than (
const cursor & other,
bool ignore_nested=false
) const
function is_before_than
inline bool mdbx::cursor::is_before_than (
const cursor & other,
bool ignore_nested=false
) const
function is_same_or_after_than
inline bool mdbx::cursor::is_same_or_after_than (
const cursor & other,
bool ignore_nested=false
) const
function is_same_or_before_than
inline bool mdbx::cursor::is_same_or_before_than (
const cursor & other,
bool ignore_nested=false
) const
function is_same_position
inline bool mdbx::cursor::is_same_position (
const cursor & other,
bool ignore_nested=false
) const
function move [1/4]
inline move_result mdbx::cursor::move (
move_operation operation,
bool throw_notfound
)
function move [2/4]
inline move_result mdbx::cursor::move (
move_operation operation,
const slice & key,
bool throw_notfound
)
function move [3/4]
inline move_result mdbx::cursor::move (
move_operation operation,
const slice & key,
const slice & value,
bool throw_notfound
)
function move [4/4]
inline bool mdbx::cursor::move (
move_operation operation,
slice & key,
slice & value,
bool throw_notfound
)
function next_multiple_samelength
inline move_result mdbx::cursor::next_multiple_samelength (
bool throw_notfound=false
)
function operator MDBX_cursor *
inline constexpr mdbx::cursor::operator MDBX_cursor * () noexcept
function operator const MDBX_cursor *
inline constexpr mdbx::cursor::operator const MDBX_cursor * () noexcept const
function map_handle
inline mdbx::cursor::map_handle () const
function txn
inline mdbx::cursor::txn () const
function operator=
cursor & mdbx::cursor::operator= (
const cursor &
) noexcept
function previous_multiple_samelength
inline move_result mdbx::cursor::previous_multiple_samelength (
bool throw_notfound=false
)
function put
inline void mdbx::cursor::put (
const pair & kv,
put_mode mode
)
function put_multiple_samelength [1/2]
template<typename VALUE>
inline size_t mdbx::cursor::put_multiple_samelength (
const slice & key,
const VALUE * values_array,
size_t values_count,
put_mode mode,
bool allow_partial=false
)
function put_multiple_samelength [2/2]
template<typename VALUE>
inline void mdbx::cursor::put_multiple_samelength (
const slice & key,
const ::std::vector< VALUE > & vector,
put_mode mode
)
function reserve_current
Reserves and returns the space for storing a value associated with a key at the current cursor position.
slice mdbx::cursor::reserve_current (
size_t value_length
)
function reverse_current
Deprecated misspelling of reserve_current() .
inline slice mdbx::cursor::reverse_current (
size_t value_length
)
function scan_until
template<typename CALLABLE_PREDICATE>
inline bool mdbx::cursor::scan_until (
CALLABLE_PREDICATE predicate,
move_operation start=first,
move_operation turn=next
)
function scan_until_from [1/2]
template<typename CALLABLE_PREDICATE>
inline bool mdbx::cursor::scan_until_from (
CALLABLE_PREDICATE predicate,
slice & from,
move_operation start=key_greater_or_equal,
move_operation turn=next
)
function scan_until_from [2/2]
template<typename CALLABLE_PREDICATE>
inline bool mdbx::cursor::scan_until_from (
CALLABLE_PREDICATE predicate,
pair & from,
move_operation start=pair_greater_or_equal,
move_operation turn=next
)
function seek_multiple_samelength
inline move_result mdbx::cursor::seek_multiple_samelength (
const slice & key,
bool throw_notfound=true
)
function to_current_first_multi
inline move_result mdbx::cursor::to_current_first_multi (
bool throw_notfound=true
)
function to_current_last_multi
inline move_result mdbx::cursor::to_current_last_multi (
bool throw_notfound=true
)
function to_current_next_multi
inline move_result mdbx::cursor::to_current_next_multi (
bool throw_notfound=true
)
function to_current_prev_multi
inline move_result mdbx::cursor::to_current_prev_multi (
bool throw_notfound=true
)
function to_exact_key_value_equal
inline move_result mdbx::cursor::to_exact_key_value_equal (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_exact_key_value_greater_or_equal
inline move_result mdbx::cursor::to_exact_key_value_greater_or_equal (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_exact_key_value_greater_than
inline move_result mdbx::cursor::to_exact_key_value_greater_than (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_exact_key_value_lesser_or_equal
inline move_result mdbx::cursor::to_exact_key_value_lesser_or_equal (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_exact_key_value_lesser_than
inline move_result mdbx::cursor::to_exact_key_value_lesser_than (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_first
inline move_result mdbx::cursor::to_first (
bool throw_notfound=true
)
function to_key_equal
inline move_result mdbx::cursor::to_key_equal (
const slice & key,
bool throw_notfound=true
)
function to_key_exact
inline move_result mdbx::cursor::to_key_exact (
const slice & key,
bool throw_notfound=true
)
function to_key_greater_or_equal
inline move_result mdbx::cursor::to_key_greater_or_equal (
const slice & key,
bool throw_notfound=true
)
function to_key_greater_than
inline move_result mdbx::cursor::to_key_greater_than (
const slice & key,
bool throw_notfound=true
)
function to_key_lesser_or_equal
inline move_result mdbx::cursor::to_key_lesser_or_equal (
const slice & key,
bool throw_notfound=true
)
function to_key_lesser_than
inline move_result mdbx::cursor::to_key_lesser_than (
const slice & key,
bool throw_notfound=true
)
function to_last
inline move_result mdbx::cursor::to_last (
bool throw_notfound=true
)
function to_next
inline move_result mdbx::cursor::to_next (
bool throw_notfound=true
)
function to_next_first_multi
inline move_result mdbx::cursor::to_next_first_multi (
bool throw_notfound=true
)
function to_pair_equal
inline move_result mdbx::cursor::to_pair_equal (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_pair_exact
inline move_result mdbx::cursor::to_pair_exact (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_pair_greater_or_equal
inline move_result mdbx::cursor::to_pair_greater_or_equal (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_pair_greater_than
inline move_result mdbx::cursor::to_pair_greater_than (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_pair_lesser_or_equal
inline move_result mdbx::cursor::to_pair_lesser_or_equal (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_pair_lesser_than
inline move_result mdbx::cursor::to_pair_lesser_than (
const slice & key,
const slice & value,
bool throw_notfound=true
)
function to_previous
inline move_result mdbx::cursor::to_previous (
bool throw_notfound=true
)
function to_previous_last_multi
inline move_result mdbx::cursor::to_previous_last_multi (
bool throw_notfound=true
)
function try_insert
inline value_result mdbx::cursor::try_insert (
const pair & kv
)
function update_current
Updates value associated with a key at the current cursor position.
void mdbx::cursor::update_current (
const slice & value
)
function upsert
inline void mdbx::cursor::upsert (
const pair & kv
)
Protected Attributes Documentation
variable handle_
MDBX_cursor* mdbx::cursor::handle_;
Friends Documentation
friend compare_position
inline int mdbx::cursor::compare_position (
const cursor & left,
const cursor & right,
bool ignore_nested=false
)
friend compare_position_nothrow
inline int mdbx::cursor::compare_position_nothrow (
const cursor & left,
const cursor & right,
bool ignore_nested=false
)
friend operator!=
inline bool mdbx::cursor::operator!= (
const cursor & a,
const cursor & b
) noexcept
friend operator==
inline bool mdbx::cursor::operator== (
const cursor & a,
const cursor & b
) noexcept
The documentation for this class was generated from the following file docs/mdbx.h++