A library for working with phylogenetic and population genetic data.
v0.27.0
BaseWindowIterator< ForwardIterator, DataType >::BaseIterator Class Referenceabstract

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

Inherited by SlidingIntervalWindowIterator< ForwardIterator, DataType >::DerivedIterator, and SlidingVariantsWindowIterator< ForwardIterator, DataType >::DerivedIterator.

Detailed Description

template<class ForwardIterator, class DataType = typename ForwardIterator::value_type>
class genesis::population::BaseWindowIterator< ForwardIterator, DataType >::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 342 of file base_window_iterator.hpp.

Public Member Functions

 BaseIterator (self_type &&)=default
 
 BaseIterator (self_type const &)=default
 
 ~BaseIterator ()=default
 
BaseIteratoroperator= (self_type &&)=default
 
BaseIteratoroperator= (self_type const &)=default
 

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 >::BaseIterator
 
using value_type = Window
 
using Window = ::genesis::population::Window< DataType >
 

Public Attributes

friend BaseWindowIterator
 
friend Iterator
 

Protected Member Functions

 BaseIterator (BaseWindowIterator 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 BaseWindowIterator 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_ (BaseWindowIterator const *parent)
 Initialize the base iterator class and check that it is set up correctly. More...
 

Protected Attributes

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

Constructor & Destructor Documentation

◆ BaseIterator() [1/3]

BaseIterator ( BaseWindowIterator 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 370 of file base_window_iterator.hpp.

◆ ~BaseIterator()

~BaseIterator ( )
default

◆ BaseIterator() [2/3]

BaseIterator ( self_type const &  )
default

◆ BaseIterator() [3/3]

BaseIterator ( self_type &&  )
default

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 BaseWindowIterator 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_ ( BaseWindowIterator const *  parent)
inlineprotected

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

Definition at line 397 of file base_window_iterator.hpp.

◆ operator=() [1/2]

BaseIterator& operator= ( self_type &&  )
default

◆ operator=() [2/2]

BaseIterator& operator= ( self_type const &  )
default

Member Typedef Documentation

◆ const_reference

using const_reference = value_type const&

Definition at line 360 of file base_window_iterator.hpp.

◆ Entry

using Entry = typename Window::Entry

Definition at line 353 of file base_window_iterator.hpp.

◆ InputType

using InputType = typename ForwardIterator::value_type

Definition at line 354 of file base_window_iterator.hpp.

◆ iterator_category

using iterator_category = std::input_iterator_tag

Definition at line 356 of file base_window_iterator.hpp.

◆ pointer

using pointer = value_type*

Definition at line 358 of file base_window_iterator.hpp.

◆ reference

Definition at line 359 of file base_window_iterator.hpp.

◆ self_type

using self_type = BaseWindowIterator<ForwardIterator, DataType>::BaseIterator

Definition at line 350 of file base_window_iterator.hpp.

◆ value_type

using value_type = Window

Definition at line 357 of file base_window_iterator.hpp.

◆ Window

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

Definition at line 352 of file base_window_iterator.hpp.

Member Data Documentation

◆ BaseWindowIterator

Definition at line 385 of file base_window_iterator.hpp.

◆ current_

ForwardIterator current_
protected

Definition at line 466 of file base_window_iterator.hpp.

◆ end_

ForwardIterator end_
protected

Definition at line 467 of file base_window_iterator.hpp.

◆ is_first_window_

bool is_first_window_ = true
protected

Definition at line 462 of file base_window_iterator.hpp.

◆ is_last_window_

bool is_last_window_ = false
protected

Definition at line 463 of file base_window_iterator.hpp.

◆ Iterator

friend Iterator

Definition at line 386 of file base_window_iterator.hpp.


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