A library for working with phylogenetic and population genetic data.
v0.32.0
BaseWindowStream< InputStreamIterator, Data, WindowType >::BaseIterator Class Referenceabstract

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

Inherited by ChromosomeWindowStream< InputStreamIterator, DataType >::DerivedIterator, GenomeWindowStream< InputStreamIterator, DataType >::DerivedIterator, IntervalWindowStream< InputStreamIterator, DataType >::DerivedIterator, PositionWindowStream< InputStreamIterator, DataType >::DerivedIterator, QueueWindowStream< InputStreamIterator, DataType >::DerivedIterator, RegionWindowStream< InputStreamIterator, DataType >::DerivedIterator, and WindowViewStream< InputStreamIterator, Data >::DerivedIterator.

Detailed Description

template<class InputStreamIterator, class Data = typename InputStreamIterator::value_type, class WindowType = typename ::genesis::population::Window<Data>>
class genesis::population::BaseWindowStream< InputStreamIterator, Data, WindowType >::BaseIterator

Internal PIMPL-like implementation of the iterator that produces Windows.

This is the internal iterator class that the actual window iterator needs to derive from. It declares the interface that we expect in the PIMPL-like setup in the above public Iterator.

Definition at line 478 of file base_window_stream.hpp.

Public Member Functions

virtual ~BaseIterator ()=default
 

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 >::BaseIterator
 
using value_type = WindowType
 

Public Attributes

friend BaseWindowStream
 
friend Iterator
 

Protected Member Functions

 BaseIterator ()=default
 
 BaseIterator (BaseWindowStream const *parent)
 Construct the base class, which does initialization checks on its member variables to ensure that the user has set up the functors correctly. More...
 
virtual value_typeget_current_window_ () const =0
 Get the current window that the iterator shall return when dereferenced. More...
 
virtual BaseWindowStream const * get_parent_ () const =0
 Get a pointer to the base class parent. More...
 
virtual void increment_ ()=0
 Advance in the iteration. This function is called from operator++. More...
 
void init_ (BaseWindowStream const *parent)
 Initialize the base iterator class and check that it is set up correctly. More...
 

Protected Attributes

InputStreamIterator current_
 
InputStreamIterator end_
 
bool is_first_window_ = true
 
bool is_last_window_ = false
 

Constructor & Destructor Documentation

◆ BaseIterator() [1/2]

BaseIterator ( )
protecteddefault

◆ BaseIterator() [2/2]

BaseIterator ( BaseWindowStream const *  parent)
inlineprotected

Construct the base class, which does initialization checks on its member variables to ensure that the user has set up the functors correctly.

Definition at line 507 of file base_window_stream.hpp.

◆ ~BaseIterator()

virtual ~BaseIterator ( )
virtualdefault

Member Function Documentation

◆ get_current_window_()

virtual value_type& get_current_window_ ( ) const
protectedpure virtual

Get the current window that the iterator shall return when dereferenced.

◆ get_parent_()

virtual BaseWindowStream const* get_parent_ ( ) const
protectedpure virtual

Get a pointer to the base class parent.

In the derived class implementation, this should be a pointer to the derived parent class, to make sure that it contains the correct settings etc needed for the iteration.

◆ increment_()

virtual void increment_ ( )
protectedpure virtual

Advance in the iteration. This function is called from operator++.

◆ init_()

void init_ ( BaseWindowStream const *  parent)
inlineprotected

Initialize the base iterator class and check that it is set up correctly.

Definition at line 536 of file base_window_stream.hpp.

Member Typedef Documentation

◆ const_reference

using const_reference = value_type const&

Definition at line 495 of file base_window_stream.hpp.

◆ InputType

using InputType = typename InputStreamType::value_type

Definition at line 489 of file base_window_stream.hpp.

◆ iterator_category

using iterator_category = std::input_iterator_tag

Definition at line 491 of file base_window_stream.hpp.

◆ pointer

using pointer = value_type*

Definition at line 493 of file base_window_stream.hpp.

◆ reference

Definition at line 494 of file base_window_stream.hpp.

◆ self_type

using self_type = typename BaseWindowStream< InputStreamType, DataType, WindowType >::BaseIterator

Definition at line 488 of file base_window_stream.hpp.

◆ value_type

using value_type = WindowType

Definition at line 492 of file base_window_stream.hpp.

Member Data Documentation

◆ BaseWindowStream

Definition at line 524 of file base_window_stream.hpp.

◆ current_

InputStreamIterator current_
protected

Definition at line 605 of file base_window_stream.hpp.

◆ end_

InputStreamIterator end_
protected

Definition at line 606 of file base_window_stream.hpp.

◆ is_first_window_

bool is_first_window_ = true
protected

Definition at line 601 of file base_window_stream.hpp.

◆ is_last_window_

bool is_last_window_ = false
protected

Definition at line 602 of file base_window_stream.hpp.

◆ Iterator

friend Iterator

Definition at line 525 of file base_window_stream.hpp.


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