Vcsn  2.8
Be Rational
vcsn::cross_sequences< Sequences > Struct Template Reference

Provide a range that allows to iterate over the cross product of the provided ranges. More...

#include <cross.hh>

Collaboration diagram for vcsn::cross_sequences< Sequences >:

Classes

struct  cross_iterator
 Composite iterator. More...
 

Public Types

using self_t = cross_sequences
 
using sequences_t = std::tuple< Sequences... >
 Type of the tuple of all the maps. More...
 
template<std::size_t... I>
using seq = vcsn::detail::index_sequence< I... >
 Type of index sequences. More...
 
using indices_t = vcsn::detail::make_index_sequence< sizeof...(Sequences)>
 Index sequence for our sequences. More...
 
template<typename Seq >
using seq_t = std::remove_reference_t< Seq >
 The type of the underlying sequences, without reference. More...
 
using value_type = std::tuple< typename seq_t< Sequences >::value_type... >
 The type of the members. More...
 
using const_iterators_t = std::tuple< typename seq_t< Sequences >::const_iterator... >
 Tuple of const_iterators. More...
 
using iterators_t = std::tuple< typename seq_t< Sequences >::iterator... >
 Tuple of iterators. More...
 
using iterator = cross_iterator< value_type, iterators_t >
 Mutable iterator. More...
 
using const_iterator = cross_iterator< const value_type, const_iterators_t >
 Const iterator. More...
 

Public Member Functions

 cross_sequences (sequences_t sequences)
 
 cross_sequences (Sequences... sequences)
 
self_tskip_first (bool s=true)
 Whether to skip the first element. More...
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
bool empty () const
 Whether the sequence is empty. More...
 

Static Public Attributes

static constexpr size_t size = sizeof...(Sequences)
 Number of sequences. More...
 

Private Member Functions

template<std::size_t... I>
const_iterator cbegin_ (seq< I... >) const
 
template<std::size_t... I>
const_iterator cend_ (seq< I... >) const
 
template<std::size_t... I>
iterator begin_ (seq< I... >)
 
template<std::size_t... I>
iterator end_ (seq< I... >)
 

Private Attributes

sequences_t sequences_
 The sequences we iterate upon. More...
 
bool skip_first_ = false
 Whether to skip the initial element. More...
 

Detailed Description

template<typename... Sequences>
struct vcsn::cross_sequences< Sequences >

Provide a range that allows to iterate over the cross product of the provided ranges.

E.g., {a,b,c} x {1,2} -> {(a,1), (a,2), (b,1), (b,2), (c,1), (c,2)}.

Definition at line 16 of file cross.hh.

Member Typedef Documentation

◆ const_iterator

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::const_iterator = cross_iterator<const value_type, const_iterators_t>

Const iterator.

Definition at line 206 of file cross.hh.

◆ const_iterators_t

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::const_iterators_t = std::tuple<typename seq_t<Sequences>::const_iterator...>

Tuple of const_iterators.

Definition at line 51 of file cross.hh.

◆ indices_t

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::indices_t = vcsn::detail::make_index_sequence<sizeof...(Sequences)>

Index sequence for our sequences.

Definition at line 31 of file cross.hh.

◆ iterator

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::iterator = cross_iterator<value_type, iterators_t>

Mutable iterator.

Definition at line 203 of file cross.hh.

◆ iterators_t

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::iterators_t = std::tuple<typename seq_t<Sequences>::iterator...>

Tuple of iterators.

Definition at line 55 of file cross.hh.

◆ self_t

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::self_t = cross_sequences

Definition at line 18 of file cross.hh.

◆ seq

template<typename... Sequences>
template<std::size_t... I>
using vcsn::cross_sequences< Sequences >::seq = vcsn::detail::index_sequence<I...>

Type of index sequences.

Definition at line 25 of file cross.hh.

◆ seq_t

template<typename... Sequences>
template<typename Seq >
using vcsn::cross_sequences< Sequences >::seq_t = std::remove_reference_t<Seq>

The type of the underlying sequences, without reference.

Definition at line 35 of file cross.hh.

◆ sequences_t

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::sequences_t = std::tuple<Sequences...>

Type of the tuple of all the maps.

Definition at line 21 of file cross.hh.

◆ value_type

template<typename... Sequences>
using vcsn::cross_sequences< Sequences >::value_type = std::tuple<typename seq_t<Sequences>::value_type...>

The type of the members.

Definition at line 39 of file cross.hh.

Constructor & Destructor Documentation

◆ cross_sequences() [1/2]

template<typename... Sequences>
vcsn::cross_sequences< Sequences >::cross_sequences ( sequences_t  sequences)
inline

Definition at line 41 of file cross.hh.

◆ cross_sequences() [2/2]

template<typename... Sequences>
vcsn::cross_sequences< Sequences >::cross_sequences ( Sequences...  sequences)
inline

Definition at line 45 of file cross.hh.

Member Function Documentation

◆ begin() [1/2]

template<typename... Sequences>
const_iterator vcsn::cross_sequences< Sequences >::begin ( ) const
inline

Definition at line 228 of file cross.hh.

References vcsn::cross_sequences< Sequences >::cbegin().

Referenced by vcsn::cross_sequences< Sequences >::begin_(), and vcsn::cross_sequences< Sequences >::cbegin_().

Here is the call graph for this function:

◆ begin() [2/2]

template<typename... Sequences>
iterator vcsn::cross_sequences< Sequences >::begin ( )
inline

Definition at line 238 of file cross.hh.

References vcsn::cross_sequences< Sequences >::begin_(), vcsn::res, and vcsn::cross_sequences< Sequences >::skip_first_.

Here is the call graph for this function:

◆ begin_()

template<typename... Sequences>
template<std::size_t... I>
iterator vcsn::cross_sequences< Sequences >::begin_ ( seq< I... >  )
inlineprivate

Definition at line 278 of file cross.hh.

References vcsn::cross_sequences< Sequences >::begin(), vcsn::cross_sequences< Sequences >::end(), and vcsn::cross_sequences< Sequences >::sequences_.

Referenced by vcsn::cross_sequences< Sequences >::begin().

Here is the call graph for this function:

◆ cbegin()

template<typename... Sequences>
const_iterator vcsn::cross_sequences< Sequences >::cbegin ( ) const
inline

Definition at line 215 of file cross.hh.

References vcsn::cross_sequences< Sequences >::cbegin_(), vcsn::res, and vcsn::cross_sequences< Sequences >::skip_first_.

Referenced by vcsn::cross_sequences< Sequences >::begin(), and vcsn::cross_sequences< Sequences >::empty().

Here is the call graph for this function:

◆ cbegin_()

template<typename... Sequences>
template<std::size_t... I>
const_iterator vcsn::cross_sequences< Sequences >::cbegin_ ( seq< I... >  ) const
inlineprivate

Definition at line 260 of file cross.hh.

References vcsn::cross_sequences< Sequences >::begin(), vcsn::cross_sequences< Sequences >::end(), and vcsn::cross_sequences< Sequences >::sequences_.

Referenced by vcsn::cross_sequences< Sequences >::cbegin().

Here is the call graph for this function:

◆ cend()

template<typename... Sequences>
const_iterator vcsn::cross_sequences< Sequences >::cend ( ) const
inline

Definition at line 223 of file cross.hh.

References vcsn::cross_sequences< Sequences >::cend_().

Referenced by vcsn::cross_sequences< Sequences >::empty(), and vcsn::cross_sequences< Sequences >::end().

Here is the call graph for this function:

◆ cend_()

template<typename... Sequences>
template<std::size_t... I>
const_iterator vcsn::cross_sequences< Sequences >::cend_ ( seq< I... >  ) const
inlineprivate

Definition at line 270 of file cross.hh.

References vcsn::cross_sequences< Sequences >::end(), and vcsn::cross_sequences< Sequences >::sequences_.

Referenced by vcsn::cross_sequences< Sequences >::cend().

Here is the call graph for this function:

◆ empty()

template<typename... Sequences>
bool vcsn::cross_sequences< Sequences >::empty ( ) const
inline

Whether the sequence is empty.

Definition at line 252 of file cross.hh.

References vcsn::cross_sequences< Sequences >::cbegin(), and vcsn::cross_sequences< Sequences >::cend().

Here is the call graph for this function:

◆ end() [1/2]

template<typename... Sequences>
const_iterator vcsn::cross_sequences< Sequences >::end ( ) const
inline

Definition at line 233 of file cross.hh.

References vcsn::cross_sequences< Sequences >::cend().

Referenced by vcsn::cross_sequences< Sequences >::begin_(), vcsn::cross_sequences< Sequences >::cbegin_(), vcsn::cross_sequences< Sequences >::cend_(), and vcsn::cross_sequences< Sequences >::end_().

Here is the call graph for this function:

◆ end() [2/2]

template<typename... Sequences>
iterator vcsn::cross_sequences< Sequences >::end ( )
inline

Definition at line 246 of file cross.hh.

References vcsn::cross_sequences< Sequences >::end_().

Here is the call graph for this function:

◆ end_()

template<typename... Sequences>
template<std::size_t... I>
iterator vcsn::cross_sequences< Sequences >::end_ ( seq< I... >  )
inlineprivate

Definition at line 287 of file cross.hh.

References vcsn::cross_sequences< Sequences >::end(), and vcsn::cross_sequences< Sequences >::sequences_.

Referenced by vcsn::cross_sequences< Sequences >::end().

Here is the call graph for this function:

◆ skip_first()

template<typename... Sequences>
self_t& vcsn::cross_sequences< Sequences >::skip_first ( bool  s = true)
inline

Whether to skip the first element.

Definition at line 209 of file cross.hh.

References vcsn::cross_sequences< Sequences >::skip_first_.

Member Data Documentation

◆ sequences_

template<typename... Sequences>
sequences_t vcsn::cross_sequences< Sequences >::sequences_
private

◆ size

template<typename... Sequences>
constexpr size_t vcsn::cross_sequences< Sequences >::size = sizeof...(Sequences)
static

Number of sequences.

Definition at line 28 of file cross.hh.

◆ skip_first_

template<typename... Sequences>
bool vcsn::cross_sequences< Sequences >::skip_first_ = false
private

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