Vcsn
2.0
Be Rational
|
Composite iterator. More...
#include <zip-maps.hh>
Public Types | |
using | iterators_t = std::tuple< typename std::remove_reference< Maps >::type::const_iterator...> |
using | values_t = std::tuple< typename std::remove_reference< Maps >::type::value_type...> |
using | references_t = std::tuple< const typename std::remove_reference< Maps >::type::value_type &...> |
using | ranges_t = std::tuple< std::pair< typename std::remove_reference< Maps >::type::const_iterator, typename std::remove_reference< Maps >::type::const_iterator >...> |
using | key_t = typename std::remove_const< typename std::tuple_element< 0, values_t >::type::first_type >::type |
Common key type. More... | |
using | mapped_t = std::tuple< const typename std::remove_reference< Maps >::type::mapped_type &...> |
Tuple of mapped types. More... | |
Public Member Functions | |
iterator (zipped_maps &zip, typename std::remove_reference< Maps >::type::const_iterator...is, typename std::remove_reference< Maps >::type::const_iterator...ends) | |
iterator & | operator++ () |
Advance to next position. More... | |
bool | operator!= (const iterator &that) const |
std::pair< key_t, mapped_t > | dereference_ (as_pair) |
values_t | dereference_ (as_tuple) |
auto | operator* () -> decltype(this->dereference_(Dereference())) |
references_t | dereference_as_tuple () |
Return as <<k1, v1>, <k1, v2>, ...>. More... | |
std::pair< key_t, mapped_t > | dereference_as_pair () |
Return as <k1, <v1, v2...>>. More... | |
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::iterators_t = std::tuple<typename std::remove_reference<Maps>::type::const_iterator...> |
Definition at line 41 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::key_t = typename std::remove_const<typename std::tuple_element<0, values_t>::type::first_type>::type |
Common key type.
Definition at line 53 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::mapped_t = std::tuple<const typename std::remove_reference<Maps>::type::mapped_type&...> |
Tuple of mapped types.
Definition at line 56 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::ranges_t = std::tuple<std::pair<typename std::remove_reference<Maps>::type::const_iterator, typename std::remove_reference<Maps>::type::const_iterator>...> |
Definition at line 50 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::references_t = std::tuple<const typename std::remove_reference<Maps>::type::value_type&...> |
Definition at line 47 of file zip-maps.hh.
using vcsn::zipped_maps< Dereference, Maps >::iterator::values_t = std::tuple<typename std::remove_reference<Maps>::type::value_type...> |
Definition at line 43 of file zip-maps.hh.
|
inline |
Definition at line 58 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 136 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::done_(), vcsn::zipped_maps< Dereference, Maps >::iterator::ends_, vcsn::zipped_maps< Dereference, Maps >::iterator::is_, and vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_.
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 157 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_.
|
inlineprivate |
Given the current candidate key, try to find the proper range for I.
Return the first supported key <= k.
Definition at line 167 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::done_(), vcsn::zipped_maps< Dereference, Maps >::iterator::ends_, vcsn::zipped_maps< Dereference, Maps >::iterator::is_, and vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_.
|
inline |
Definition at line 95 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_pair().
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_tuple(), and vcsn::zipped_maps< Dereference, Maps >::iterator::operator*().
|
inline |
Definition at line 100 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_tuple().
|
inlineprivate |
Tuple of pairs.
Definition at line 211 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
|
inline |
Return as <k1, <v1, v2...>>.
Definition at line 119 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_().
|
inline |
Return as <<k1, v1>, <k1, v2>, ...>.
Definition at line 113 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
|
inlineprivate |
The common key.
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_as_pair().
|
inlineprivate |
The associated tuple of values.
Definition at line 202 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_pair().
|
inlineprivate |
We have reached the end, move all the cursors to this end.
Definition at line 126 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::ends_, vcsn::zipped_maps< Dereference, Maps >::iterator::is_, and vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::align_().
|
inlineprivate |
Definition at line 186 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 90 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::not_equal_().
|
inline |
Definition at line 105 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().
|
inline |
Advance to next position.
Definition at line 80 of file zip-maps.hh.
References vcsn::zipped_maps< Dereference, Maps >::iterator::align_(), vcsn::zipped_maps< Dereference, Maps >::iterator::is_, and vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_.
iterators_t vcsn::zipped_maps< Dereference, Maps >::iterator::ends_ |
The genuine ends.
Definition at line 75 of file zip-maps.hh.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::align_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::done_().
iterators_t vcsn::zipped_maps< Dereference, Maps >::iterator::is_ |
The current position.
Definition at line 73 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::done_(), 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 77 of file zip-maps.hh.
Referenced by vcsn::zipped_maps< Dereference, Maps >::iterator::align_(), vcsn::zipped_maps< Dereference, Maps >::iterator::done_(), and vcsn::zipped_maps< Dereference, Maps >::iterator::operator++().
zipped_maps& vcsn::zipped_maps< Dereference, Maps >::iterator::zip_ |
The maps etc.
Definition at line 70 of file zip-maps.hh.