#include <genesis/population/window/base_window_iterator.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 173 of file base_window_iterator.hpp.
Public Member Functions | |
Iterator (self_type &&)=default | |
Iterator (self_type const &)=default | |
~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= (self_type &&)=default |
Iterator & | operator= (self_type const &)=default |
bool | operator== (self_type const &other) const |
Compare two iterators for equality. More... | |
Public Types | |
using | const_reference = value_type const & |
using | Entry = typename Window::Entry |
using | InputType = typename ForwardIterator::value_type |
using | iterator_category = std::input_iterator_tag |
using | pointer = value_type * |
using | reference = value_type & |
using | self_type = BaseWindowIterator< ForwardIterator, DataType >::Iterator |
using | value_type = Window |
using | Window = ::genesis::population::Window< DataType > |
Public Attributes | |
friend | BaseWindowIterator |
Protected Member Functions | |
Iterator ()=delete | |
Iterator (std::unique_ptr< BaseIterator > base_iterator) | |
|
protecteddelete |
|
inlineprotected |
Definition at line 197 of file base_window_iterator.hpp.
|
default |
|
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 227 of file base_window_iterator.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 243 of file base_window_iterator.hpp.
|
inline |
Definition at line 314 of file base_window_iterator.hpp.
|
inline |
Definition at line 259 of file base_window_iterator.hpp.
|
inline |
Definition at line 253 of file base_window_iterator.hpp.
|
inline |
Definition at line 281 of file base_window_iterator.hpp.
|
inline |
Definition at line 271 of file base_window_iterator.hpp.
|
inline |
Definition at line 265 of file base_window_iterator.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 BaseWindowIterator they were created. Two past-the-end iterators compare equal.
Definition at line 304 of file base_window_iterator.hpp.
using const_reference = value_type const& |
Definition at line 191 of file base_window_iterator.hpp.
using Entry = typename Window::Entry |
Definition at line 184 of file base_window_iterator.hpp.
using InputType = typename ForwardIterator::value_type |
Definition at line 185 of file base_window_iterator.hpp.
using iterator_category = std::input_iterator_tag |
Definition at line 187 of file base_window_iterator.hpp.
using pointer = value_type* |
Definition at line 189 of file base_window_iterator.hpp.
using reference = value_type& |
Definition at line 190 of file base_window_iterator.hpp.
using self_type = BaseWindowIterator<ForwardIterator, DataType>::Iterator |
Definition at line 181 of file base_window_iterator.hpp.
using value_type = Window |
Definition at line 188 of file base_window_iterator.hpp.
using Window = ::genesis::population::Window<DataType> |
Definition at line 183 of file base_window_iterator.hpp.
friend BaseWindowIterator |
Definition at line 211 of file base_window_iterator.hpp.