SeqAn3  3.0.2
The Modern C++ library for sequence analysis.
seqan3::detail::fast_istreambuf_iterator< char_t, traits_t > Class Template Reference

Functionally the same as std::istreambuf_iterator, but faster. More...

#include <seqan3/io/stream/iterator.hpp>

Public Types

Associated types
using difference_type = ptrdiff_t
 Defaults to ptrdiff_t.
 
using value_type = char_t
 The char type of the stream.
 
using reference = char_t
 The char type of the stream.
 
using pointer = void
 Has no pointer type.
 
using iterator_category = std::input_iterator_tag
 

Public Member Functions

reference operator* () const
 Read current value from buffer (no vtable lookup, safe if not at end).
 
Constructors, destructor and assignment
 fast_istreambuf_iterator () noexcept=default
 Defaulted.
 
 fast_istreambuf_iterator (fast_istreambuf_iterator const &) noexcept=default
 Defaulted.
 
 fast_istreambuf_iterator (fast_istreambuf_iterator &&) noexcept=default
 Defaulted.
 
fast_istreambuf_iteratoroperator= (fast_istreambuf_iterator const &) noexcept=default
 Defaulted.
 
fast_istreambuf_iteratoroperator= (fast_istreambuf_iterator &&) noexcept=default
 Defaulted.
 
 ~fast_istreambuf_iterator () noexcept=default
 Defaulted.
 
 fast_istreambuf_iterator (std::basic_streambuf< char_t, traits_t > &ibuf)
 Construct from a stream buffer.
 
Arithmetic operators
fast_istreambuf_iteratoroperator++ ()
 Advance by one and rebuffer if necessary (vtable lookup iff rebuffering).
 
void operator++ (int)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Private Attributes

stream_buffer_exposer< char_t, traits_t > * stream_buf = nullptr
 Down-cast pointer to the stream-buffer.
 

Friends

Comparison operators

We define comparison only against the sentinel.

bool operator== (fast_istreambuf_iterator const &lhs, std::ranges::default_sentinel_t const &) noexcept
 True if the read buffer is not empty; involves no vtable lookup.
 
bool operator!= (fast_istreambuf_iterator const &lhs, std::ranges::default_sentinel_t const &) noexcept
 True if the read buffer is empty; involves no vtable lookup.
 
bool operator== (std::ranges::default_sentinel_t const &, fast_istreambuf_iterator const &rhs) noexcept
 True if the read buffer is not empty; involves no vtable lookup.
 
bool operator!= (std::ranges::default_sentinel_t const &, fast_istreambuf_iterator const &rhs) noexcept
 True if the read buffer is empty; involves no vtable lookup.
 

Detailed Description

template<typename char_t, typename traits_t = std::char_traits<char_t>>
class seqan3::detail::fast_istreambuf_iterator< char_t, traits_t >

Functionally the same as std::istreambuf_iterator, but faster.

Template Parameters
char_tThe stream's character type.
traits_tThe stream's traits type.

Performs less virtual function calls than std::istreambuf_iterator.

Todo:
Make this move-only after input iterators are allowed to be move-only.

Member Typedef Documentation

◆ iterator_category

template<typename char_t , typename traits_t = std::char_traits<char_t>>
using seqan3::detail::fast_istreambuf_iterator< char_t, traits_t >::iterator_category = std::input_iterator_tag

Pure input iterator.


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