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

Special iterator type used when consuming behaviour is selected. More...

+ Inheritance diagram for seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::basic_consume_iterator< const_range >:

Public Types

Associated types

All are derived from the underlying_iterator_t.

using difference_type = std::iter_difference_t< underlying_iterator_t >
 From base.
 
using value_type = std::iter_value_t< underlying_iterator_t >
 From base.
 
using reference = std::iter_reference_t< underlying_iterator_t >
 From base.
 
using pointer = detail::iter_pointer_t< underlying_iterator_t >
 From base.
 
using iterator_category = std::input_iterator_tag
 
- Public Types inherited from seqan3::detail::inherited_iterator_base< basic_consume_iterator< const_range >, seqan3::detail::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.

constexpr basic_consume_iterator ()=default
 Defaulted.
 
constexpr basic_consume_iterator (basic_consume_iterator const &rhs)=default
 Defaulted.
 
constexpr basic_consume_iterator (basic_consume_iterator &&rhs)=default
 Defaulted.
 
constexpr basic_consume_iteratoroperator= (basic_consume_iterator const &rhs)=default
 Defaulted.
 
constexpr basic_consume_iteratoroperator= (basic_consume_iterator &&rhs)=default
 Defaulted.
 
 ~basic_consume_iterator ()=default
 Defaulted.
 
 basic_consume_iterator (underlying_iterator_t it, copyable_wrapper_t< fun_t > const &_fun, underlying_sentinel_t sen) noexcept(noexcept(base_t{it}))
 Constructor that delegates to the CRTP layer and initialises the callable.
 
Arithmetic operators

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

basic_consume_iteratoroperator++ () noexcept(noexcept(++std::declval< base_t & >()) &&noexcept(std::declval< underlying_iterator_t & >() !=std::declval< underlying_sentinel_t & >()) &&noexcept(fun->operator()(std::declval< reference >())))
 Override pre-increment to implement consuming behaviour.
 
decltype(auto) operator++ (int) noexcept(noexcept(++std::declval< basic_consume_iterator & >()) &&(std::same_as< decltype(std::declval< underlying_iterator_t & >()++), void >||std::is_nothrow_copy_constructible_v< basic_consume_iterator >))
 Post-increment implemented via pre-increment.
 
- Public Member Functions inherited from seqan3::detail::inherited_iterator_base< basic_consume_iterator< const_range >, seqan3::detail::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_consume_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_consume_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_consume_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_consume_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_consume_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_consume_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_consume_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_consume_iterator< const_range > operator++ (int) noexcept(noexcept(std::declval< base_t & >()++) &&noexcept(basic_consume_iterator< const_range >(std::declval< base_t & >())))
 Post-increment, return previous iterator state.
 
constexpr basic_consume_iterator< const_range > & operator-- () noexcept(noexcept(--std::declval< base_t & >()))
 Pre-decrement, return updated iterator.
 
constexpr basic_consume_iterator< const_range > operator-- (int) noexcept(noexcept(std::declval< base_t & >() --) &&noexcept(basic_consume_iterator< const_range > {std::declval< base_t & >()}))
 Post-decrement, return previous iterator state.
 
constexpr basic_consume_iterator< const_range > & operator+= (difference_type const skip) noexcept(noexcept(std::declval< base_t & >()+=skip))
 Move iterator to the right.
 
constexpr basic_consume_iterator< const_range > operator+ (difference_type const skip) const noexcept(noexcept(std::declval< base_t & >()+skip) &&noexcept(basic_consume_iterator< const_range > {std::declval< base_t & >()}))
 Returns an iterator which is advanced by skip positions.
 
constexpr basic_consume_iterator< const_range > & operator-= (difference_type const skip) noexcept(noexcept(std::declval< base_t & >() -=skip))
 Decrement iterator by skip.
 
constexpr basic_consume_iterator< const_range > operator- (difference_type const skip) const noexcept(noexcept(std::declval< base_t const & >() - skip) &&noexcept(basic_consume_iterator< const_range >(std::declval< base_t & >())))
 Return decremented copy of this iterator.
 
constexpr difference_type operator- (basic_consume_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_t = inherited_iterator_base< basic_consume_iterator, underlying_iterator_t >
 The CRTP wrapper type.
 
using underlying_iterator_t = seqan3::detail::maybe_const_iterator_t< const_range, urng_t >
 The iterator type of the underlying range.
 
using underlying_sentinel_t = seqan3::detail::maybe_const_sentinel_t< const_range, urng_t >
 The sentinel type is identical to that of the underlying range.
 

Private Attributes

bool at_end_gracefully = false
 Whether the end was reached by evaluating the functor.
 
copyable_wrapper_t< fun_t > const * fun {nullptr}
 Pointer to the functor stored in the view.
 
underlying_sentinel_t underlying_sentinel
 Whether this iterator has reached the end (cache is only used on pure input ranges).
 

Comparison operators

We define comparison against self and against the sentinel.

bool operator== (basic_consume_sentinel< const_range > const &) const noexcept(!or_throw &&noexcept(std::declval< underlying_iterator_t & >() !=std::declval< underlying_sentinel_t & >()) &&noexcept(fun->operator()(std::declval< reference >())))
 Return the saved at_end state.
 
bool operator!= (basic_consume_sentinel< const_range > const &rhs) const noexcept(noexcept(std::declval< basic_consume_iterator & >()==rhs))
 Return the saved at_end state.
 
bool operator== (basic_consume_sentinel< const_range > const &lhs, basic_consume_iterator const &rhs) noexcept(noexcept(rhs==lhs))
 Return the saved at_end state.
 
bool operator!= (basic_consume_sentinel< const_range > const &lhs, basic_consume_iterator const &rhs) noexcept(noexcept(rhs !=lhs))
 Return the saved at_end state.
 

Detailed Description

template<std::ranges::view urng_t, typename fun_t, bool or_throw, bool and_consume>
template<bool const_range>
class seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::basic_consume_iterator< const_range >

Special iterator type used when consuming behaviour is selected.

Template Parameters
const_rangeWhether iterator is a const iterator (const_range = true) or a non-const iterator.

Member Typedef Documentation

◆ iterator_category

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
template<bool const_range>
using seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::basic_consume_iterator< const_range >::iterator_category = std::input_iterator_tag

Always input.


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