Vcsn
2.2
Be Rational
|
Composite iterator. More...
#include <zip-maps.hh>
Public Types | |
template<typename T > | |
using | iterator_t = typename std::remove_reference_t< T >::const_iterator |
using | iterators_t = std::tuple< iterator_t< Maps >... > |
template<typename T > | |
using | value_t = typename std::remove_reference_t< T >::value_type |
using | values_t = std::tuple< value_t< Maps >... > |
using | references_t = std::tuple< const value_t< Maps > &... > |
template<typename T > | |
using | range_t = std::pair< iterator_t< T >, iterator_t< T >> |
using | ranges_t = std::tuple< range_t< Maps >... > |
using | key_t = std::remove_const_t< typename tuple_element_t< 0, values_t >::first_type > |
Common key type. More... | |
using | mapped_t = std::tuple< const typename std::remove_reference_t< Maps >::mapped_type &... > |
Tuple of mapped types. More... | |
Public Member Functions | |
iterator (zipped_maps &zip, iterator_t< Maps >...is, iterator_t< Maps >...ends) | |
iterator & | operator++ () |
Advance to next position. More... | |
bool | operator!= (const iterator &that) const |
auto | dereference_ (as_pair) -> std::pair< key_t, mapped_t > |
Return as <k1, <v1, v2...>>. More... | |
auto | dereference_ (as_tuple) -> references_t |
Return as <<k1, v1>, <k1, v2>, ...>. More... | |
auto | operator* () -> decltype(this->dereference_(Dereference())) |
Public Attributes | |
zipped_maps & | zip_ |
The maps etc. More... | |
iterators_t | is_ |
The current position. More... | |
iterators_t | ends_ |
The genuine ends. More... | |
bool | is_done_ |
Whether we reached the end. More... | |
Private Member Functions | |
void | done_ () |
We have reached the end, move all the cursors to this end. More... | |
void | align_ () |
Align all iterators on the first common key. More... | |
template<std::size_t... I> | |
key_t | align_ (key_t k, seq< I... >) |
Try to align all the ranges to support key k. More... | |
template<std::size_t I> | |
key_t | align_ (key_t k) |
Given the current candidate key, try to find the proper range for I. More... | |
template<std::size_t... I> | |
bool | not_equal_ (const iterator &that, seq< I... >) const |
key_t | dereference_first_ () const |
The common key. More... | |
template<std::size_t... I> | |
mapped_t | dereference_second_ (seq< I... >) const |
The associated tuple of values. More... | |
template<std::size_t... I> | |
references_t | dereference_ (seq< I... >) const |
Tuple of pairs. More... | |
Composite iterator.
Definition at line 38 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::iterator_t = typename std::remove_reference_t<T>::const_iterator |
Definition at line 41 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::iterators_t = std::tuple<iterator_t<Maps>...> |
Definition at line 42 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::key_t = std::remove_const_t<typename tuple_element_t<0, values_t>::first_type> |
Common key type.
Definition at line 58 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::mapped_t = std::tuple<const typename std::remove_reference_t<Maps>::mapped_type&...> |
Tuple of mapped types.
Definition at line 61 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::range_t = std::pair<iterator_t<T>, iterator_t<T>> |
Definition at line 53 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::ranges_t = std::tuple<range_t<Maps>...> |
Definition at line 54 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::references_t = std::tuple<const value_t<Maps>&...> |
Definition at line 50 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::value_t = typename std::remove_reference_t<T>::value_type |
Definition at line 45 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::values_t = std::tuple<value_t<Maps>...> |
Definition at line 46 of file zip-maps.hh.
|
inline |
Definition at line 63 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::align_().
Referenced by vcsn::zipped_maps< Dereference, Maps >::begin_(), and vcsn::zipped_maps< Dereference, Maps >::end_().
|
inlineprivate |
Align all iterators on the first common key.
Called at construction of the iterators, including end(), therefore must be robust to be already at end().
Definition at line 128 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::done_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::iterator(), and vcsn::zipped_maps< Dereference, Maps >::iterator::operator++().
|
inlineprivate |
Try to align all the ranges to support key k.
Return the smallest candidate key.
Definition at line 149 of file zip-maps.hh.
References vcsn::detail::void.
|
inlineprivate |
Given the current candidate key, try to find the proper range for I.
Return the first supported key <= k.
Definition at line 159 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::done_(), vcsn::zipped_maps< Dereference, Maps >::iterator::is_, and vcsn::zipped_maps< Dereference, Maps >::maps_.
|
inline |
Return as <k1, <v1, v2...>>.
Definition at line 100 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_first_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_second_().
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::operator*().
|
inline |
Return as <<k1, v1>, <k1, v2>, ...>.
Definition at line 106 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
|
inlineprivate |
Tuple of pairs.
Definition at line 204 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
|
inlineprivate |
The common key.
Definition at line 188 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
|
inlineprivate |
The associated tuple of values.
Definition at line 195 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
|
inlineprivate |
We have reached the end, move all the cursors to this end.
Definition at line 118 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::ends_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::align_().
|
inlineprivate |
Definition at line 179 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::operator!=().
|
inline |
Definition at line 94 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::not_equal_().
|
inline |
Definition at line 111 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
|
inline |
Advance to next position.
Definition at line 84 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::align_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
iterators_t vcsn::zipped_maps< Dereference, Maps >::iterator::ends_ |
The genuine ends.
Definition at line 79 of file zip-maps.hh.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::done_().
iterators_t vcsn::zipped_maps< Dereference, Maps >::iterator::is_ |
The current position.
Definition at line 77 of file zip-maps.hh.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::align_(), vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_(), vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_first_(), vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_second_(), vcsn::zipped_maps< Dereference, Maps >::iterator::not_equal_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::operator++().
bool vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_ |
Whether we reached the end.
Definition at line 81 of file zip-maps.hh.
zipped_maps& vcsn::zipped_maps< Dereference, Maps >::iterator::zip_ |
The maps etc.
Definition at line 74 of file zip-maps.hh.