|
| | value_stream (std::unique_ptr< MDB_cursor, D > cur) |
| | Take ownership of cur without changing position. nullptr valid. More...
|
| |
| | 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 |
| |
template<typename T, typename D>
class lmdb::value_stream< T, D >
C++ wrapper for a LMDB read-only cursor on a fixed-sized value T.
- Template Parameters
-
| T | value type being stored by each record. |
| D | cleanup functor for the cursor; usually unique per db/table. |
Definition at line 186 of file value_stream.h.
template<typename T , typename D >
template<typename U = T, typename F = U, std::size_t offset = 0>
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<ELECTRONEUM_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.
- Exceptions
-
| std::system_error | if LMDB has unexpected errors. |
- Returns
- C++ iterator starting at current cursor position.
Definition at line 249 of file value_stream.h.
251 static_assert(std::is_same<U, T>(),
"was ELECTRONEUM_FIELD used with wrong type?");
template<typename T , typename D >
template<typename U = T, typename F = U, std::size_t offset = 0>
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<ELECTRONEUM_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.
- Exceptions
-
| std::system_error | if LMDB has unexpected errors. |
- Returns
- An InputIterator range over values at cursor position.
Definition at line 267 of file value_stream.h.
269 return {make_iterator<U, F, offset>(), value_iterator<U, F, offset>{}};