template<typename K, typename V>
class lmdb::key_iterator< K, V >
An InputIterator for a fixed-sized LMDB key and value. operator++ iterates over keys.
- Template Parameters
-
| K | Key type in database records. |
| V | Value type in database records. |
- Note
- This meets requirements for an InputIterator only. The iterator can only be incremented and dereferenced. All copies of an iterator share the same LMDB cursor, and therefore incrementing any copy will change the cursor state for all (incrementing an iterator will invalidate all prior copies of the iterator). Usage is identical to
std::istream_iterator.
Definition at line 57 of file key_stream.h.
template<typename K, typename V>
template<typename T = V, typename F = T, 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 an entire value (V). 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 155 of file key_stream.h.
157 static_assert(std::is_same<T, V>(),
"bad ELECTRONEUM_FIELD usage?");
template<typename K, typename V>
template<typename T = V, typename F = T, 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 173 of file key_stream.h.
175 return {make_value_iterator<T, F, offset>(), value_iterator<T, F, offset>{}};