template<typename T, typename F = T, std::size_t offset = 0>
class lmdb::value_iterator< T, F, offset >
An InputIterator for a fixed-sized LMDB value at a specific key.
- Template Parameters
-
| T | The value type at the specific key. |
| F | The value type being returned when dereferenced. |
| offset | to F within T. |
- 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 82 of file value_stream.h.
template<typename T, typename F = T, std::size_t offset = 0>
template<typename U , typename G = U, std::size_t uoffset = 0>
Get a specific field within F. Default behavior is to return the entirety of U, despite the filtering logic of operator*.
- Precondition
!is_end()
- Template Parameters
-
| U | must match T, used for ELECTRONEUM_FIELD sanity checking. |
| G | field type to extract from the value |
| uoffset | to G type, or 0 when std::is_same<U, G>(). |
- Returns
- The field
G, at uoffset within U.
Definition at line 161 of file value_stream.h.
163 static_assert(std::is_same<U, T>(),
"bad ELECTRONEUM_FIELD usage?");
164 static_assert(std::is_pod<U>(),
"value type must be pod");
165 static_assert(std::is_pod<G>(),
"field type must be pod");
166 static_assert(
sizeof(G) + uoffset <=
sizeof(U),
"bad field and/or offset");
167 assert(
sizeof(G) + uoffset <= values.
size());
constexpr std::size_t size() const noexcept
bool is_end() const noexcept
const GenericPointer< typename T::ValueType > T2 value
void * memcpy(void *a, const void *b, size_t c)
constexpr pointer data() const noexcept