SeqAn3 3.3.0-rc.1
The Modern C++ library for sequence analysis.
 
Loading...
Searching...
No Matches
seqan3::detail::chunk_view< urng_t > Class Template Reference

The type returned by seqan3::views::chunk. More...

#include <seqan3/utility/views/chunk.hpp>

+ Inheritance diagram for seqan3::detail::chunk_view< urng_t >:

Classes

class  basic_input_iterator
 Iterator for dividing an input range into chunks. More...
 
class  basic_iterator
 Iterator for dividing an forward range into chunks. More...
 

Public Member Functions

auto size ()
 Returns the size of the range, iff the underlying range is a std::ranges::sized_range.
 
auto size () const
 Returns the size of the range, iff the underlying range is a std::ranges::sized_range.
 
Constructors, destructor and assignment
 chunk_view ()=default
 Defaulted.
 
 chunk_view (chunk_view const &rhs)=default
 Defaulted.
 
 chunk_view (chunk_view &&rhs)=default
 Defaulted.
 
chunk_viewoperator= (chunk_view const &rhs)=default
 Defaulted.
 
chunk_viewoperator= (chunk_view &&rhs)=default
 Defaulted.
 
 ~chunk_view ()=default
 Defaulted.
 
constexpr chunk_view (urng_t urng, std::ranges::range_difference_t< urng_t > const size_of_chunk)
 Construct from a view and the chunk size.
 
Iterators
auto begin () noexcept
 Returns an iterator to the first element of the range.
 
auto begin () const noexcept
 Returns an iterator to the first element of the range.
 
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 Attributes

std::ranges::range_difference_t< urng_t > chunk_size
 The chunk size to use.
 
urng_t urange
 The underlying range.
 

Detailed Description

template<std::ranges::input_range urng_t>
requires std::ranges::view<urng_t>
class seqan3::detail::chunk_view< urng_t >

The type returned by seqan3::views::chunk.

Template Parameters
urng_tThe type of the underlying range, must model std::ranges::view and std::ranges::input_range.

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

Constructor & Destructor Documentation

◆ chunk_view()

template<std::ranges::input_range urng_t>
constexpr seqan3::detail::chunk_view< urng_t >::chunk_view ( urng_t  urng,
std::ranges::range_difference_t< urng_t > const  size_of_chunk 
)
inlineexplicitconstexpr

Construct from a view and the chunk size.

Parameters
[in]urngThe underlying range to divide into chunks.
[in]size_of_chunkThe size of the chunks, e.g., the length of the subrange returned at each position.

Member Function Documentation

◆ begin() [1/2]

template<std::ranges::input_range urng_t>
auto seqan3::detail::chunk_view< urng_t >::begin ( ) const
inlinenoexcept

Returns an iterator to the first element of the range.

Returns
Iterator to the first element.

Complexity

Constant. For std::forward_ranges, O(c) when c is the chunk size, O(1) otherwise.

Exceptions

No-throw guarantee.

◆ begin() [2/2]

template<std::ranges::input_range urng_t>
auto seqan3::detail::chunk_view< urng_t >::begin ( )
inlinenoexcept

Returns an iterator to the first element of the range.

Returns
Iterator to the first element.

Complexity

Constant. For std::forward_ranges, O(c) when c is the chunk size, O(1) otherwise.

Exceptions

No-throw guarantee.

◆ end() [1/2]

template<std::ranges::input_range urng_t>
auto seqan3::detail::chunk_view< urng_t >::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::input_range urng_t>
auto seqan3::detail::chunk_view< urng_t >::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.

◆ size() [1/2]

template<std::ranges::input_range urng_t>
auto seqan3::detail::chunk_view< urng_t >::size ( )
inline

Returns the size of the range, iff the underlying range is a std::ranges::sized_range.

Returns
Size of range.

◆ size() [2/2]

template<std::ranges::input_range urng_t>
auto seqan3::detail::chunk_view< urng_t >::size ( ) const
inline

Returns the size of the range, iff the underlying range is a std::ranges::sized_range.

Returns
Size of range.

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