Utopia 2
Framework for studying models of complex & adaptive systems.
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | Protected Attributes | List of all members
Utopia::Itertools::zip< Containers > Class Template Reference

A range defined by instances of ZipIterator. More...

#include <zip.hh>

Public Member Functions

auto begin ()
 make Zipiterator containing the begin iterators of the containers 'zip' refers to
 
auto end ()
 make Zipiterator containing the end iterators of the containers 'zip' refers to
 
auto cbegin ()
 make Zipiterator containing the const begin iterators of the containers 'zip' refers to
 
auto cend ()
 make Zipiterator containing the const end iterators of the containers 'zip' refers to
 
auto rbegin ()
 make Zipiterator containing the reverse begin iterators of the containers 'zip' refers to
 
auto rend ()
 make Zipiterator containing the reverse end iterators of the containers 'zip' refers to
 
 zip (const zip &other)=delete
 Construct a new zip object.
 
zipoperator= (const zip &other)=delete
 deleted copy assignment
 
zipoperator= (zip &&other)=default
 assign zip object
 
 zip (zip &&other)=default
 Construct a new zip object.
 
 ~zip ()=default
 Destroy the range.
 
 zip (Containers &... conts)
 Instantiate a new zip range.
 

Protected Types

using Tuple = std::tuple< std::reference_wrapper< Containers >... >
 

Protected Attributes

Tuple _containers
 

Detailed Description

template<typename... Containers>
class Utopia::Itertools::zip< Containers >

A range defined by instances of ZipIterator.

The range itself only references the containers it is constructed from. The containers must exist throughout the life time of this range.

Template Parameters
ContainersTypes of containers iterated over by ZipIterator

Member Typedef Documentation

◆ Tuple

template<typename... Containers>
using Utopia::Itertools::zip< Containers >::Tuple = std::tuple<std::reference_wrapper<Containers>...>
protected

Constructor & Destructor Documentation

◆ zip() [1/3]

template<typename... Containers>
Utopia::Itertools::zip< Containers >::zip ( const zip< Containers > &  other)
delete

Construct a new zip object.

Parameters
other

◆ zip() [2/3]

template<typename... Containers>
Utopia::Itertools::zip< Containers >::zip ( zip< Containers > &&  other)
default

Construct a new zip object.

Parameters
other

◆ ~zip()

template<typename... Containers>
Utopia::Itertools::zip< Containers >::~zip ( )
default

Destroy the range.

◆ zip() [3/3]

template<typename... Containers>
Utopia::Itertools::zip< Containers >::zip ( Containers &...  conts)
inline

Instantiate a new zip range.

Parameters
contsThe pack of containers to create the range from
524 : _containers(conts...)
525 {
526 }
Tuple _containers
Definition zip.hh:413
Container select_entities(const Manager &mngr, const DataIO::Config &sel_cfg)
Select entities according to parameters specified in a configuration.
Definition select.hh:213

Member Function Documentation

◆ begin()

template<typename... Containers>
auto Utopia::Itertools::zip< Containers >::begin ( )
inline

make Zipiterator containing the begin iterators of the containers 'zip' refers to

Returns
auto
423 {
424 return ZipIterator(boost::hana::transform(
425 _containers, [](auto& cont) { return cont.get().begin(); }));
426 }
auto begin()
make Zipiterator containing the begin iterators of the containers 'zip' refers to
Definition zip.hh:422
ZipIterator(std::tuple< Iterators... > iters) -> ZipIterator< Iterators... >
Deduce the iterator types from the types inside the tuple.

◆ cbegin()

template<typename... Containers>
auto Utopia::Itertools::zip< Containers >::cbegin ( )
inline

make Zipiterator containing the const begin iterators of the containers 'zip' refers to

Returns
auto
447 {
448 return ZipIterator(boost::hana::transform(
449 _containers, [](auto& cont) { return cont.get().cbegin(); }));
450 }
auto cbegin()
make Zipiterator containing the const begin iterators of the containers 'zip' refers to
Definition zip.hh:446

◆ cend()

template<typename... Containers>
auto Utopia::Itertools::zip< Containers >::cend ( )
inline

make Zipiterator containing the const end iterators of the containers 'zip' refers to

Returns
auto
459 {
460 return ZipIterator(boost::hana::transform(
461 _containers, [](auto& cont) { return cont.get().cend(); }));
462 }
auto cend()
make Zipiterator containing the const end iterators of the containers 'zip' refers to
Definition zip.hh:458

◆ end()

template<typename... Containers>
auto Utopia::Itertools::zip< Containers >::end ( )
inline

make Zipiterator containing the end iterators of the containers 'zip' refers to

Returns
auto
435 {
436 return ZipIterator(boost::hana::transform(
437 _containers, [](auto& cont) { return cont.get().end(); }));
438 }
auto end()
make Zipiterator containing the end iterators of the containers 'zip' refers to
Definition zip.hh:434

◆ operator=() [1/2]

template<typename... Containers>
zip & Utopia::Itertools::zip< Containers >::operator= ( const zip< Containers > &  other)
delete

deleted copy assignment

Parameters
other
Returns
zip&

◆ operator=() [2/2]

template<typename... Containers>
zip & Utopia::Itertools::zip< Containers >::operator= ( zip< Containers > &&  other)
default

assign zip object

Parameters
other
Returns
zip&

◆ rbegin()

template<typename... Containers>
auto Utopia::Itertools::zip< Containers >::rbegin ( )
inline

make Zipiterator containing the reverse begin iterators of the containers 'zip' refers to

Returns
auto
471 {
472 return ZipIterator(boost::hana::transform(
473 _containers, [](auto& cont) { return cont.get().rbegin(); }));
474 }
auto rbegin()
make Zipiterator containing the reverse begin iterators of the containers 'zip' refers to
Definition zip.hh:470

◆ rend()

template<typename... Containers>
auto Utopia::Itertools::zip< Containers >::rend ( )
inline

make Zipiterator containing the reverse end iterators of the containers 'zip' refers to

Returns
auto
483 {
484 return ZipIterator(boost::hana::transform(
485 _containers, [](auto& cont) { return cont.get().rend(); }));
486 }
auto rend()
make Zipiterator containing the reverse end iterators of the containers 'zip' refers to
Definition zip.hh:482

Member Data Documentation

◆ _containers

template<typename... Containers>
Tuple Utopia::Itertools::zip< Containers >::_containers
protected

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