Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vcsn::zipped_maps< Dereference, Maps >::iterator Struct Reference

Composite iterator. More...

#include <zip-maps.hh>

Collaboration diagram for vcsn::zipped_maps< Dereference, Maps >::iterator:

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)
 
iteratoroperator++ ()
 Advance to next position. More...
 
bool operator!= (const iterator &that) const
 
std::pair< key_t, mapped_tdereference_ (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_tdereference_as_pair ()
 Return as <k1, <v1, v2...>>. More...
 

Public Attributes

zipped_mapszip_
 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...
 

Detailed Description

template<typename Dereference = as_tuple, typename... Maps>
struct vcsn::zipped_maps< Dereference, Maps >::iterator

Composite iterator.

Definition at line 38 of file zip-maps.hh.

Member Typedef Documentation

template<typename Dereference = as_tuple, typename... Maps>
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.

template<typename Dereference = as_tuple, typename... Maps>
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.

template<typename Dereference = as_tuple, typename... Maps>
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.

template<typename Dereference = as_tuple, typename... Maps>
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.

template<typename Dereference = as_tuple, typename... Maps>
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.

template<typename Dereference = as_tuple, typename... Maps>
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.

Constructor & Destructor Documentation

template<typename Dereference = as_tuple, typename... Maps>
vcsn::zipped_maps< Dereference, Maps >::iterator::iterator ( zipped_maps zip,
typename std::remove_reference< Maps >::type::const_iterator...  is,
typename std::remove_reference< Maps >::type::const_iterator...  ends 
)
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_().

Here is the call graph for this function:

Member Function Documentation

template<typename Dereference = as_tuple, typename... Maps>
void vcsn::zipped_maps< Dereference, Maps >::iterator::align_ ( )
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++().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
template<std::size_t... I>
key_t vcsn::zipped_maps< Dereference, Maps >::iterator::align_ ( key_t  k,
seq< I...>   
)
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_.

template<typename Dereference = as_tuple, typename... Maps>
template<std::size_t I>
key_t vcsn::zipped_maps< Dereference, Maps >::iterator::align_ ( key_t  k)
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_.

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
std::pair<key_t, mapped_t> vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_ ( as_pair  )
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*().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
values_t vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_ ( as_tuple  )
inline

Definition at line 100 of file zip-maps.hh.

References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_tuple().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
template<std::size_t... I>
references_t vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_ ( seq< I...>  ) const
inlineprivate

Tuple of pairs.

Definition at line 211 of file zip-maps.hh.

References vcsn::zipped_maps< Dereference, Maps >::iterator::is_.

template<typename Dereference = as_tuple, typename... Maps>
std::pair<key_t, mapped_t> vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_pair ( )
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_().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
references_t vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_as_tuple ( )
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_().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
key_t vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_first_ ( ) const
inlineprivate
template<typename Dereference = as_tuple, typename... Maps>
template<std::size_t... I>
mapped_t vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_second_ ( seq< I...>  ) const
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().

template<typename Dereference = as_tuple, typename... Maps>
void vcsn::zipped_maps< Dereference, Maps >::iterator::done_ ( )
inlineprivate
template<typename Dereference = as_tuple, typename... Maps>
template<std::size_t... I>
bool vcsn::zipped_maps< Dereference, Maps >::iterator::not_equal_ ( const iterator that,
seq< I...>   
) const
inlineprivate
template<typename Dereference = as_tuple, typename... Maps>
bool vcsn::zipped_maps< Dereference, Maps >::iterator::operator!= ( const iterator that) const
inline

Definition at line 90 of file zip-maps.hh.

References vcsn::zipped_maps< Dereference, Maps >::iterator::not_equal_().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
auto vcsn::zipped_maps< Dereference, Maps >::iterator::operator* ( ) -> decltype(this->dereference_(Dereference()))
inline

Definition at line 105 of file zip-maps.hh.

References vcsn::zipped_maps< Dereference, Maps >::iterator::dereference_().

Here is the call graph for this function:

template<typename Dereference = as_tuple, typename... Maps>
iterator& vcsn::zipped_maps< Dereference, Maps >::iterator::operator++ ( )
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_.

Here is the call graph for this function:

Member Data Documentation

template<typename Dereference = as_tuple, typename... Maps>
iterators_t vcsn::zipped_maps< Dereference, Maps >::iterator::ends_
template<typename Dereference = as_tuple, typename... Maps>
bool vcsn::zipped_maps< Dereference, Maps >::iterator::is_done_
template<typename Dereference = as_tuple, typename... Maps>
zipped_maps& vcsn::zipped_maps< Dereference, Maps >::iterator::zip_

The maps etc.

Definition at line 70 of file zip-maps.hh.


The documentation for this struct was generated from the following file: