SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
Loading...
Searching...
No Matches
seqan3::detail::view_take_exactly< urng_t, or_throw >::basic_iterator< const_range > Class Template Reference

The forward declared iterator type. More...

#include <seqan3/io/views/detail/take_exactly_view.hpp>

+ Inheritance diagram for seqan3::detail::view_take_exactly< urng_t, or_throw >::basic_iterator< const_range >:

Public Types

using difference_type = std::iter_difference_t< base_t >
 The difference type.
 
using reference = std::iter_reference_t< base_t >
 The reference type.
 
- Public Types inherited from seqan3::detail::inherited_iterator_base< basic_iterator< const_range >, maybe_const_iterator_t< const_range, urng_t > >
using difference_type = std::iter_difference_t< base_t >
 The difference type.
 
using value_type = std::iter_value_t< base_t >
 The value type.
 
using reference = std::iter_reference_t< base_t >
 The reference type.
 
using pointer = detail::iter_pointer_t< base_t >
 The pointer type.
 
using iterator_category = maybe_present
 The iterator category tag.
 
using iterator_concept = detail::iterator_concept_tag_t< base_t >
 The iterator concept tag.
 
- Public Types inherited from seqan3::detail::maybe_iterator_category< underlying_iterator_t >
using iterator_category = MAYBE_PRESENT(std::iterator_traits< underlying_iterator_t >::iterator_category)
 The iterator category tag. (not always present!)
 

Public Member Functions

Constructors, destructor and assignment

Exceptions specification is implicitly inherited.

 basic_iterator ()=default
 Defaulted.
 
 basic_iterator (basic_iterator const &rhs)=default
 Defaulted.
 
 basic_iterator (basic_iterator &&rhs)=default
 Defaulted.
 
basic_iteratoroperator= (basic_iterator const &rhs)=default
 Defaulted.
 
basic_iteratoroperator= (basic_iterator &&rhs)=default
 Defaulted.
 
 ~basic_iterator ()=default
 Defaulted.
 
constexpr basic_iterator (base_base_t it) noexcept(noexcept(base_t{it}))
 Constructor that delegates to the CRTP layer.
 
constexpr basic_iterator (base_base_t it, size_t const _pos, size_t const _max_pos, view_take_exactly *host=nullptr) noexcept(noexcept(base_t{it}))
 Constructor that delegates to the CRTP layer and initialises the members.
 
Arithmetic operators

seqan3::detail::inherited_iterator_base operators are used unless specialised here.

constexpr basic_iteratoroperator++ () noexcept(noexcept(++std::declval< base_t & >()))
 Increments the iterator by one.
 
constexpr decltype(auto) operator++ (int) noexcept(noexcept(++std::declval< basic_iterator & >()) &&(std::same_as< decltype(std::declval< base_base_t & >()++), void >||std::is_nothrow_copy_constructible_v< basic_iterator >))
 Returns an iterator incremented by one.
 
constexpr basic_iteratoroperator-- () noexcept(noexcept(--std::declval< base_base_t & >()))
 Decrements the iterator by one.
 
constexpr basic_iterator operator-- (int) noexcept(noexcept(--std::declval< basic_iterator & >()) &&std::is_nothrow_copy_constructible_v< basic_iterator >)
 Returns an iterator decremented by one.
 
constexpr basic_iteratoroperator+= (difference_type const skip) noexcept(noexcept(std::declval< base_t & >()+=skip))
 Advances the iterator by skip positions.
 
constexpr basic_iteratoroperator-= (difference_type const skip) noexcept(noexcept(std::declval< base_t & >() -=skip))
 Advances the iterator by -skip positions.
 
Reference/Dereference operators

seqan3::detail::inherited_iterator_base operators are used unless specialised here.

constexpr reference operator[] (std::make_unsigned_t< difference_type > const n) const noexcept(noexcept(std::declval< base_base_t & >()[0]))
 Accesses an element by index.
 
- Public Member Functions inherited from seqan3::detail::inherited_iterator_base< basic_iterator< const_range >, maybe_const_iterator_t< const_range, urng_t > >
constexpr base_t base () &&noexcept
 Returns an rvalue of the base.
 
constexpr base_t & base () &noexcept
 Get a reference to the base.
 
constexpr base_t const & base () const &noexcept
 Get a const reference to the base.
 
constexpr inherited_iterator_base () noexcept(std::is_nothrow_default_constructible_v< base_t >)=default
 Defaulted.
 
constexpr inherited_iterator_base (inherited_iterator_base const &rhs) noexcept(std::is_nothrow_copy_constructible_v< base_t >)=default
 Defaulted.
 
constexpr inherited_iterator_base (inherited_iterator_base &&rhs) noexcept(std::is_nothrow_move_constructible_v< base_t >)=default
 Defaulted.
 
constexpr inherited_iterator_base (base_t it) noexcept(std::is_nothrow_move_constructible_v< base_t >)
 Delegate to base class if inheriting from non-pointer iterator.
 
constexpr inherited_iterator_base (base_t it) noexcept
 Initialise member if deriving from pointer.
 
constexpr inherited_iterator_baseoperator= (inherited_iterator_base const &rhs) noexcept(std::is_nothrow_copy_assignable_v< base_t >)=default
 Defaulted.
 
constexpr inherited_iterator_baseoperator= (inherited_iterator_base &&rhs) noexcept(std::is_nothrow_move_assignable_v< base_t >)=default
 Defaulted.
 
 ~inherited_iterator_base () noexcept(std::is_nothrow_destructible_v< base_t >)=default
 Defaulted.
 
constexpr bool operator== (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >()==std::declval< base_t & >()))
 Checks whether *this is equal to rhs.
 
constexpr bool operator!= (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >()==std::declval< base_t & >()))
 Checks whether *this is not equal to rhs.
 
constexpr bool operator< (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >()< std::declval< base_t & >()))
 Checks whether *this is less than rhs.
 
constexpr bool operator> (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >() > std::declval< base_t & >()))
 Checks whether *this is greater than rhs.
 
constexpr bool operator<= (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >() > std::declval< base_t & >()))
 Checks whether *this is less than or equal to rhs.
 
constexpr bool operator>= (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >()< std::declval< base_t & >()))
 Checks whether *this is greater than or equal to rhs.
 
constexpr reference operator* () noexcept(noexcept(*std::declval< base_t & >()))
 Dereference operator returns element currently pointed at.
 
constexpr decltype(auto) operator* () const noexcept(noexcept(*std::declval< base_t const & >()))
 Dereference operator returns element currently pointed at.
 
constexpr pointer operator-> () noexcept(noexcept(*std::declval< base_t & >()))
 Return pointer to this iterator.
 
constexpr decltype(auto) operator-> () const noexcept(noexcept(*std::declval< base_t const & >()))
 Return pointer to this iterator.
 
constexpr decltype(auto) operator[] (std::make_signed_t< difference_type > const n) noexcept(noexcept(std::declval< base_t & >()[0]))
 Return underlying container value currently pointed at.
 
constexpr decltype(auto) operator[] (std::make_signed_t< difference_type > const n) const noexcept(noexcept(std::declval< base_t const & >()[0]))
 Return underlying container value currently pointed at.
 
constexpr basic_iterator< const_range > & operator++ () noexcept(noexcept(++std::declval< base_t & >()))
 Pre-increment, return updated iterator.
 
constexpr auto operator++ (int) noexcept(noexcept(std::declval< base_t & >()++))
 Post-increment of input iterators that do not return a copy of themselves but void or a proxy type.
 
constexpr basic_iterator< const_range > operator++ (int) noexcept(noexcept(std::declval< base_t & >()++) &&noexcept(basic_iterator< const_range >(std::declval< base_t & >())))
 Post-increment, return previous iterator state.
 
constexpr basic_iterator< const_range > & operator-- () noexcept(noexcept(--std::declval< base_t & >()))
 Pre-decrement, return updated iterator.
 
constexpr basic_iterator< const_range > operator-- (int) noexcept(noexcept(std::declval< base_t & >() --) &&noexcept(basic_iterator< const_range > {std::declval< base_t & >()}))
 Post-decrement, return previous iterator state.
 
constexpr basic_iterator< const_range > & operator+= (difference_type const skip) noexcept(noexcept(std::declval< base_t & >()+=skip))
 Move iterator to the right.
 
constexpr basic_iterator< const_range > operator+ (difference_type const skip) const noexcept(noexcept(std::declval< base_t & >()+skip) &&noexcept(basic_iterator< const_range > {std::declval< base_t & >()}))
 Returns an iterator which is advanced by skip positions.
 
constexpr basic_iterator< const_range > & operator-= (difference_type const skip) noexcept(noexcept(std::declval< base_t & >() -=skip))
 Decrement iterator by skip.
 
constexpr basic_iterator< const_range > operator- (difference_type const skip) const noexcept(noexcept(std::declval< base_t const & >() - skip) &&noexcept(basic_iterator< const_range >(std::declval< base_t & >())))
 Return decremented copy of this iterator.
 
constexpr difference_type operator- (basic_iterator< const_range > const &rhs) const noexcept(noexcept(std::declval< base_t & >() - std::declval< base_t & >()))
 Return offset between this and remote iterator's position.
 

Private Types

using base_base_t = maybe_const_iterator_t< const_range, urng_t >
 The iterator type of the underlying range.
 
using base_t = inherited_iterator_base< basic_iterator, maybe_const_iterator_t< const_range, urng_t > >
 The CRTP wrapper type.
 
using sentinel_type = maybe_const_sentinel_t< const_range, urng_t >
 The sentinel type is identical to that of the underlying range.
 

Private Attributes

std::conditional_t<!std::forward_iterator< base_base_t >, view_take_exactly *, detail::ignore_thost_ptr
 A pointer to host, s.t. the size of the view can shrink on pure input ranges.
 
size_t max_pos {}
 The size parameter to the view.
 
size_t pos {}
 The current position.
 

Comparison operators

We define comparison against self and against the sentinel.

constexpr bool operator== (basic_iterator const &rhs) const noexcept(!or_throw &&noexcept(std::declval< base_base_t & >()==std::declval< base_base_t & >()))
 Checks whether *this is equal to rhs.
 
constexpr bool operator== (sentinel_type const &rhs) const noexcept(!or_throw &&noexcept(std::declval< base_base_t const & >()==std::declval< sentinel_type const & >()))
 Checks whether lhs is equal to rhs.
 
constexpr bool operator!= (sentinel_type const &rhs) const noexcept(noexcept(std::declval< basic_iterator & >()==rhs))
 Checks whether *this is not equal to rhs.
 
constexpr bool operator!= (basic_iterator const &rhs) const noexcept(noexcept(std::declval< basic_iterator & >()==rhs))
 Checks whether lhs is not equal to rhs.
 
constexpr friend bool operator== (sentinel_type const &lhs, basic_iterator const &rhs) noexcept(noexcept(rhs==lhs))
 Checks whether lhs is equal to rhs.
 
constexpr friend bool operator!= (sentinel_type const &lhs, basic_iterator const &rhs) noexcept(noexcept(rhs !=lhs))
 Checks whether lhs is not equal to rhs.
 

Detailed Description

template<std::ranges::view urng_t, bool or_throw>
template<bool const_range>
class seqan3::detail::view_take_exactly< urng_t, or_throw >::basic_iterator< const_range >

The forward declared iterator type.

The iterator for the view_take_exactly. It inherits from the underlying type, but overwrites several operators.

Template Parameters
rng_tShould be urng_t for defining iterator and urng_t const for defining const_iterator.

Member Function Documentation

◆ operator!=()

template<std::ranges::view urng_t, bool or_throw>
template<bool const_range>
constexpr bool seqan3::detail::view_take_exactly< urng_t, or_throw >::basic_iterator< const_range >::operator!= ( basic_iterator< const_range > const &  rhs) const
inlineconstexprnoexcept

Checks whether lhs is not equal to rhs.

◆ operator==()

template<std::ranges::view urng_t, bool or_throw>
template<bool const_range>
constexpr bool seqan3::detail::view_take_exactly< urng_t, or_throw >::basic_iterator< const_range >::operator== ( sentinel_type const &  rhs) const
inlineconstexprnoexcept

Checks whether lhs is equal to rhs.

◆ operator[]()

template<std::ranges::view urng_t, bool or_throw>
template<bool const_range>
constexpr reference seqan3::detail::view_take_exactly< urng_t, or_throw >::basic_iterator< const_range >::operator[] ( std::make_unsigned_t< difference_type > const  n) )[0] const
inlineconstexprnoexcept

Accesses an element by index.

Parameters
nPosition relative to current location.
Returns
A reference to the element at relative location.

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