#include <genesis/population/window/base_window_stream.hpp>
Internal public iterator that produces Windows.
This is the iterator that is exposed to the user when calling begin() and end() on the main class. Using this interface ensures that all types of window iterators (sliding window, regions, etc) expose the same type of iterator (at least for the same template parameters), making it easier to re-use code across different types of window iterators.
We internally use a PIMPL-like setup to abstract away from this and allow the actual iterator implementations to run their own code. However, we here don't use PIMPL to hide our implementation, but rather to simply abstract from it, so that the public interface stays stable. See BaseIterator below for the class that needs to be derived from to implement the actual window iteration code.
Definition at line 186 of file base_window_stream.hpp.
Public Member Functions | |
Iterator ()=default | |
Iterator (Iterator &&other) | |
Iterator (Iterator const &)=delete | |
~Iterator ()=default | |
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... | |
bool | operator!= (self_type const &other) const |
value_type & | operator* () |
const value_type & | operator* () const |
self_type & | operator++ () |
value_type * | operator-> () |
const value_type * | operator-> () const |
Iterator & | operator= (Iterator &&other) |
Iterator & | operator= (Iterator const &)=delete |
bool | operator== (self_type const &other) const |
Compare two iterators for equality. More... | |
Public Types | |
using | const_reference = value_type const & |
using | InputType = typename InputStreamType::value_type |
using | iterator_category = std::input_iterator_tag |
using | pointer = value_type * |
using | reference = value_type & |
using | self_type = typename BaseWindowStream< InputStreamType, DataType, WindowType >::Iterator |
using | value_type = WindowType |
Public Attributes | |
friend | BaseWindowStream |
Protected Member Functions | |
Iterator (BaseWindowStream const *parent, std::unique_ptr< BaseIterator > base_iterator) | |
|
inlineprotected |
Definition at line 211 of file base_window_stream.hpp.
|
default |
|
default |
Definition at line 244 of file base_window_stream.hpp.
|
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 in the user code, 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 286 of file base_window_stream.hpp.
|
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 in the user code, 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 302 of file base_window_stream.hpp.
|
inline |
Definition at line 394 of file base_window_stream.hpp.
|
inline |
Definition at line 318 of file base_window_stream.hpp.
|
inline |
Definition at line 312 of file base_window_stream.hpp.
|
inline |
Definition at line 340 of file base_window_stream.hpp.
|
inline |
Definition at line 330 of file base_window_stream.hpp.
|
inline |
Definition at line 324 of file base_window_stream.hpp.
Definition at line 258 of file base_window_stream.hpp.
|
inline |
Compare two iterators for equality.
Any two iterators that are copies of each other or started from the same parent will compare equal, as long as neither of them is past-the-end. A valid (not past-the-end) iterator and an end() iterator will not compare equal, no matter from which BaseWindowStream they were created. Two past-the-end iterators compare equal.
Definition at line 384 of file base_window_stream.hpp.
using const_reference = value_type const& |
Definition at line 203 of file base_window_stream.hpp.
using InputType = typename InputStreamType::value_type |
Definition at line 197 of file base_window_stream.hpp.
using iterator_category = std::input_iterator_tag |
Definition at line 199 of file base_window_stream.hpp.
using pointer = value_type* |
Definition at line 201 of file base_window_stream.hpp.
using reference = value_type& |
Definition at line 202 of file base_window_stream.hpp.
using self_type = typename BaseWindowStream< InputStreamType, DataType, WindowType >::Iterator |
Definition at line 196 of file base_window_stream.hpp.
using value_type = WindowType |
Definition at line 200 of file base_window_stream.hpp.
friend BaseWindowStream |
Definition at line 270 of file base_window_stream.hpp.