|
Monero
|
#include <value_stream.h>
Public Member Functions | |
| value_stream (std::unique_ptr< MDB_cursor, D > cur) | |
| Take ownership of cur without changing position. nullptr valid. | |
| value_stream (value_stream &&)=default | |
| value_stream (value_stream const &)=delete | |
| ~value_stream ()=default | |
| value_stream & | operator= (value_stream &&)=default |
| value_stream & | operator= (value_stream const &)=delete |
| std::unique_ptr< MDB_cursor, D > | give_cursor () noexcept |
| void | reset () |
| std::size_t | count () const |
| template<typename U = T, typename F = U, std::size_t offset = 0> | |
| value_iterator< U, F, offset > | make_iterator () const |
| template<typename U = T, typename F = U, std::size_t offset = 0> | |
| boost::iterator_range< value_iterator< U, F, offset > > | make_range () const |
Private Attributes | |
| std::unique_ptr< MDB_cursor, D > | cur |
C++ wrapper for a LMDB read-only cursor on a fixed-sized value T.
| T | value type being stored by each record. |
| D | cleanup functor for the cursor; usually unique per db/table. |
|
inlineexplicit |
Take ownership of cur without changing position. nullptr valid.
|
default |
|
delete |
|
default |
|
inline |
| std::system_error | if LMDB has unexpected errors. |
|
inlinenoexcept |
Give up ownership of the cursor. count(), make_iterator() and make_range() can still be invoked, but return the empty set.
|
inline |
Return a C++ iterator over database values from current cursor position that will reach .is_end() after the last duplicate key record. Calling make_iterator() will return an iterator whose operator* will return entire value (T). make_iterator<MONERO_FIELD(account, id)>() will return an iterator whose operator* will return a decltype(account.id) object - the other fields in the struct account are never copied from the database.
| std::system_error | if LMDB has unexpected errors. |
|
inline |
Return a range from current cursor position until last duplicate key record. Useful in for-each range loops or in templated code expecting a range of elements. Calling make_range() will return a range of T objects. make_range<MONERO_FIELD(account, id)>() will return a range of decltype(account.id) objects - the other fields in the struct account are never copied from the database.
| std::system_error | if LMDB has unexpected errors. |
|
default |
|
delete |
|
inline |
Place the stream back at the first value. Newly created iterators will start at the first value again.
|
private |