A library for working with phylogenetic data.
v0.25.0
SlidingWindowIterator< ForwardIterator, InputType, DataType > Class Template Reference

#include <genesis/population/window/sliding_window_iterator.hpp>

Detailed Description

template<class ForwardIterator, class InputType, class DataType = InputType>
class genesis::population::SlidingWindowIterator< ForwardIterator, InputType, DataType >

Iterator for sliding Windows over the chromosomes of a genome.

Definition at line 144 of file sliding_window_iterator.hpp.

Public Member Functions

 SlidingWindowIterator (settings_type const &settings, ForwardIterator begin, ForwardIterator end)
 
 SlidingWindowIterator (SlidingWindowIterator &&)=default
 
 SlidingWindowIterator (SlidingWindowIterator const &)=default
 
 ~SlidingWindowIterator ()=default
 
bool good () const
 
bool is_first_window () const
 Return whether the current iteration is the first of the current chromosome. More...
 
bool is_last_window () const
 Return whether the current iteration is the last of the current chromosome. More...
 
 operator bool () const
 
value_type const & operator* () const
 
self_typeoperator++ ()
 
self_type operator++ (int)
 
value_type const * operator-> () const
 
SlidingWindowIteratoroperator= (SlidingWindowIterator &&)=default
 
SlidingWindowIteratoroperator= (SlidingWindowIterator const &)=default
 

Public Types

using const_reference = value_type const &
 
using Entry = typename Window::Entry
 
using iterator_category = std::input_iterator_tag
 
using reference = value_type &
 
using self_type = SlidingWindowIterator< ForwardIterator, InputType, DataType >
 
using settings_type = SlidingWindowIteratorSettings< InputType, DataType >
 
using value_type = Window
 
using Window = ::genesis::population::Window< DataType >
 

Constructor & Destructor Documentation

◆ SlidingWindowIterator() [1/3]

SlidingWindowIterator ( settings_type const &  settings,
ForwardIterator  begin,
ForwardIterator  end 
)
inline

Definition at line 172 of file sliding_window_iterator.hpp.

◆ ~SlidingWindowIterator()

~SlidingWindowIterator ( )
default

◆ SlidingWindowIterator() [2/3]

SlidingWindowIterator ( SlidingWindowIterator< ForwardIterator, InputType, DataType > const &  )
default

◆ SlidingWindowIterator() [3/3]

SlidingWindowIterator ( SlidingWindowIterator< ForwardIterator, InputType, DataType > &&  )
default

Member Function Documentation

◆ good()

bool good ( ) const
inline

Definition at line 351 of file sliding_window_iterator.hpp.

◆ is_first_window()

bool is_first_window ( ) const
inline

Return whether the current iteration is the first of the current chromosome.

When iterating over (e.g.) a VCF file with multiple chromosomes, this function is useful to run some initialization per chromosome, such as preparing some output.

See is_last_window() for the respective end-of-chromosome indicator, that can be used to wrap up after a chromosome, such as writing the output that was producing during the iterator.

Definition at line 268 of file sliding_window_iterator.hpp.

◆ is_last_window()

bool is_last_window ( ) const
inline

Return whether the current iteration is the last of the current chromosome.

When iterating over (e.g.) a VCF file with multiple chromosomes, this function is useful to wrap up after a chromosome, such as writing the output that was producing during the iterator.

See is_first_window() for the respective beginning-of-chromosome indicator, that can be used to run some initialization per chromosome, such as preparing some output.

Definition at line 283 of file sliding_window_iterator.hpp.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Definition at line 346 of file sliding_window_iterator.hpp.

◆ operator*()

value_type const& operator* ( ) const
inline

Definition at line 305 of file sliding_window_iterator.hpp.

◆ operator++() [1/2]

self_type& operator++ ( )
inline

Definition at line 319 of file sliding_window_iterator.hpp.

◆ operator++() [2/2]

self_type operator++ ( int  )
inline

Definition at line 325 of file sliding_window_iterator.hpp.

◆ operator->()

value_type const* operator-> ( ) const
inline

Definition at line 310 of file sliding_window_iterator.hpp.

◆ operator=() [1/2]

SlidingWindowIterator& operator= ( SlidingWindowIterator< ForwardIterator, InputType, DataType > &&  )
default

◆ operator=() [2/2]

SlidingWindowIterator& operator= ( SlidingWindowIterator< ForwardIterator, InputType, DataType > const &  )
default

Member Typedef Documentation

◆ const_reference

using const_reference = value_type const&

Definition at line 162 of file sliding_window_iterator.hpp.

◆ Entry

using Entry = typename Window::Entry

Definition at line 156 of file sliding_window_iterator.hpp.

◆ iterator_category

using iterator_category = std::input_iterator_tag

Definition at line 166 of file sliding_window_iterator.hpp.

◆ reference

Definition at line 161 of file sliding_window_iterator.hpp.

◆ self_type

using self_type = SlidingWindowIterator<ForwardIterator, InputType, DataType>

Definition at line 159 of file sliding_window_iterator.hpp.

◆ settings_type

using settings_type = SlidingWindowIteratorSettings<InputType, DataType>

Definition at line 158 of file sliding_window_iterator.hpp.

◆ value_type

using value_type = Window

Definition at line 160 of file sliding_window_iterator.hpp.

◆ Window

using Window = ::genesis::population::Window<DataType>

Definition at line 155 of file sliding_window_iterator.hpp.


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