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 > Class Template Reference

The type returned by seqan3::detail::take_until and seqan3::detail::take_until_or_throw. More...

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

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

Classes

class  basic_consume_iterator
 Special iterator type used when consuming behaviour is selected. More...
 
class  basic_sentinel
 The sentinel type of take_until, provides the comparison operators. More...
 

Public Member Functions

Constructors, destructor and assignment
 view_take_until ()=default
 Defaulted.
 
constexpr view_take_until (view_take_until const &rhs)=default
 Defaulted.
 
constexpr view_take_until (view_take_until &&rhs)=default
 Defaulted.
 
constexpr view_take_untiloperator= (view_take_until const &rhs)=default
 Defaulted.
 
constexpr view_take_untiloperator= (view_take_until &&rhs)=default
 Defaulted.
 
 ~view_take_until ()=default
 Defaulted.
 
 view_take_until (urng_t &&_urange, fun_t &&_fun)
 Construct from another range.
 
template<std::ranges::viewable_range rng_t>
requires std::constructible_from<urng_t, std::views::all_t<rng_t>>
 view_take_until (rng_t &&_urange, fun_t &&_fun)
 Construct from another viewable_range.
 
Iterators
auto begin () noexcept
 Returns an iterator to the first element of the container.
 
auto begin () const noexcept
 Returns an iterator to the first element of the container.
 
auto end () noexcept
 Returns an iterator to the element following the last element of the range.
 
auto end () const noexcept
 Returns an iterator to the element following the last element of the range.
 

Private Types

template<bool const_range>
using basic_consume_sentinel = std::default_sentinel_t
 The sentinel type of take_until when consuming behaviour is selected.
 
template<bool const_range>
using basic_iterator = seqan3::detail::maybe_const_iterator_t< const_range, urng_t >
 Iterator of the underlying range (urng_t).
 

Private Attributes

copyable_wrapper_t< fun_t > fun
 The functor.
 
urng_t urange
 The underlying range.
 

Static Private Attributes

static constexpr bool const_iterable
 Whether this view is const_iterable or not.
 

Related Symbols

(Note that these are not member symbols.)

template<typename urng_t , typename fun_t , bool or_throw = false, bool and_consume = false>
 view_take_until (urng_t &&, fun_t &&) -> view_take_until< std::views::all_t< urng_t >, fun_t, or_throw, and_consume >
 Type deduction guide that strips references.
 

Detailed Description

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

The type returned by seqan3::detail::take_until and seqan3::detail::take_until_or_throw.

Template Parameters
urng_tThe type of the underlying range, must model std::ranges::view.
fun_tType of the callable that will be evaluated on every member; must model std::invocable with std::ranges::range_reference_t<urng_t> as argument and return bool.
or_throwWhether to throw an exception when the input is exhausted before the end of line is reached.

Note that most members of this class are generated by std::ranges::view_interface which is not yet documented here.

Member Typedef Documentation

◆ basic_consume_sentinel

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_sentinel = std::default_sentinel_t
private

The sentinel type of take_until when consuming behaviour is selected.

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

◆ basic_iterator

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_iterator = seqan3::detail::maybe_const_iterator_t<const_range, urng_t>
private

Iterator of the underlying range (urng_t).

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

Constructor & Destructor Documentation

◆ view_take_until() [1/2]

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::view_take_until ( urng_t &&  _urange,
fun_t &&  _fun 
)
inline

Construct from another range.

Parameters
[in]_urangeThe underlying range.
[in]_funThe functor that acts as termination criterium.

◆ view_take_until() [2/2]

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
template<std::ranges::viewable_range rng_t>
requires std::constructible_from<urng_t, std::views::all_t<rng_t>>
seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::view_take_until ( rng_t &&  _urange,
fun_t &&  _fun 
)
inline

Construct from another viewable_range.

Template Parameters
rng_tType of the passed range; urng_t must be constructible from this.
Parameters
[in]_urangeThe underlying range.
[in]_funThe functor that acts as termination criterium.

Member Function Documentation

◆ begin() [1/2]

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
auto seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to seqan3::detail::take_until::end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ begin() [2/2]

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
auto seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the container.

Returns
Iterator to the first element.

If the container is empty, the returned iterator will be equal to seqan3::detail::take_until::end().

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [1/2]

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
auto seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::end ( ) const
inlinenoexcept

Returns an iterator to the element following the last element of the range.

Returns
Iterator to the end.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

◆ end() [2/2]

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
auto seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::end ( )
inlinenoexcept

Returns an iterator to the element following the last element of the range.

Returns
Iterator to the end.

This element acts as a placeholder; attempting to dereference it results in undefined behaviour.

Complexity

Constant.

Exceptions

No-throw guarantee.

Member Data Documentation

◆ const_iterable

template<std::ranges::view urng_t, typename fun_t , bool or_throw, bool and_consume>
constexpr bool seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume >::const_iterable
staticconstexprprivate
Initial value:
=
const_iterable_range<urng_t> && indirect_unary_predicate_on_range<fun_t const, urng_t const>
Specifies requirements of an input range type for which the const version of that type satisfies the ...

Whether this view is const_iterable or not.


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