SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
seqan3::detail::view_take_until< urng_t, fun_t, or_throw, and_consume > Class Template Reference

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

#include <seqan3/range/views/take_until.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_iterator
 The iterator type inherits from the underlying type, but overwrites several operators. 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. More...
 
template<std::ranges::viewable_range rng_t>
 view_take_until (rng_t &&_urange, fun_t _fun)
 Construct from another viewable_range. More...
 
Iterators
iterator begin () noexcept
 Returns an iterator to the first element of the container. More...
 
const_iterator begin () const noexcept requires const _iterable
 Returns an iterator to the first element of the container. More...
 
auto end () noexcept
 Returns an iterator to the element following the last element of the range. More...
 
auto end () const noexcept requires const _iterable
 Returns an iterator to the element following the last element of the range. More...
 

Private Types

Associated types
using iterator = std::conditional_t< and_consume &&!std::ranges::forward_range< urng_t >, basic_consume_iterator< urng_t >, basic_iterator< urng_t > >
 The iterator type of this view (a random access iterator).
 
using const_iterator = basic_iterator< urng_t const >
 The const_iterator type is equal to the iterator type if the underlying range is const-iterable.
 

Private Attributes

ranges::semiregular_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. More...
 

Related Functions

(Note that these are not member functions.)

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::views::take_until and seqan3::views::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 ranges::view_interface which is not yet documented here.

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>
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>
const_iterator 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::views::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>
iterator 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::views::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:
std::regular_invocable<fun_t, std::ranges::range_reference_t<urng_t>>
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: