SeqAn3 3.4.0-rc.1
The Modern C++ library for sequence analysis.
|
A generic random access iterator that delegates most operations to the range. More...
#include <seqan3/core/range/detail/random_access_iterator.hpp>
Private Types | |
using | base = random_access_iterator_base< range_type, random_access_iterator > |
Shortcut for the base class. | |
Additional Inherited Members | |
Public Types inherited from seqan3::detail::random_access_iterator_base< range_type, random_access_iterator > | |
using | const_reference = typename range_type::const_reference |
Use const reference type provided by container. | |
using | difference_type = typename range_type::difference_type |
Type for distances between iterators. | |
using | iterator_category = std::random_access_iterator_tag |
Tag this class as a random access iterator. | |
using | pointer = value_type * |
Pointer type is pointer of container element type. | |
using | reference = std::conditional_t< std::is_const_v< range_type >, typename range_type::const_reference, typename range_type::reference > |
Use reference type defined by container. | |
using | value_type = typename range_type::value_type |
Value type of container elements. | |
Public Member Functions inherited from seqan3::detail::random_access_iterator_base< range_type, random_access_iterator > | |
constexpr | random_access_iterator_base ()=default |
Default constructor. | |
constexpr | random_access_iterator_base (random_access_iterator_base const &)=default |
Copy constructor. | |
constexpr | random_access_iterator_base (random_access_iterator_base &&)=default |
Move constructor. | |
constexpr | random_access_iterator_base (range_type &host) noexcept |
Construct by host, default position pointer with 0. | |
constexpr | random_access_iterator_base (range_type &host, position_type const pos) noexcept |
Construct by host and explicit position. | |
constexpr | random_access_iterator_base (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) noexcept |
Constructor for const version from non-const version. | |
constexpr random_access_iterator_base & | operator= (random_access_iterator_base const &)=default |
Copy construction via assignment. | |
constexpr random_access_iterator_base & | operator= (random_access_iterator_base &&)=default |
Move assignment. | |
~random_access_iterator_base ()=default | |
Use default deconstructor. | |
constexpr bool | operator== (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) const noexcept |
Checks whether *this is equal to rhs . | |
constexpr bool | operator!= (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) const noexcept |
Checks whether *this is not equal to rhs . | |
constexpr bool | operator< (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) const noexcept |
Checks whether *this is less than rhs . | |
constexpr bool | operator> (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) const noexcept |
Checks whether *this is greater than rhs . | |
constexpr bool | operator<= (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) const noexcept |
Checks whether *this is less than or equal to rhs . | |
constexpr bool | operator>= (random_access_iterator_base< range_type2, random_access_iterator > const &rhs) const noexcept |
Checks whether *this is greater than or equal to rhs . | |
constexpr reference | operator* () const noexcept(noexcept((*host)[pos])) |
Dereference operator returns element currently pointed at. | |
constexpr pointer | operator-> () const noexcept(noexcept((&host)[pos])) |
Return pointer to this iterator. | |
constexpr reference | operator[] (position_type const n) const noexcept(noexcept((*host)[pos+n])) |
Return underlying container value currently pointed at. | |
constexpr derived_t & | operator++ () noexcept |
Pre-increment, return updated iterator. | |
constexpr derived_t | operator++ (int) noexcept |
Post-increment, return previous iterator state. | |
constexpr derived_t & | operator-- () noexcept |
Pre-decrement, return updated iterator. | |
constexpr derived_t | operator-- (int) noexcept |
Post-decrement, return previous iterator state. | |
constexpr derived_t & | operator+= (difference_type const skip) noexcept |
Forward this iterator. | |
constexpr derived_t | operator+ (difference_type const skip) const noexcept |
Forward copy of this iterator. | |
constexpr derived_t & | operator-= (difference_type const skip) noexcept |
Decrement iterator by skip. | |
constexpr derived_t | operator- (difference_type const skip) const noexcept |
Return decremented copy of this iterator. | |
Protected Types inherited from seqan3::detail::random_access_iterator_base< range_type, random_access_iterator > | |
using | derived_t = random_access_iterator< range_type > |
Because this is CRTP, we know the full derived type: | |
using | position_type = std::make_unsigned_t< typename range_type::difference_type > |
Use container's size_type as a position. | |
Protected Attributes inherited from seqan3::detail::random_access_iterator_base< range_type, random_access_iterator > | |
std::add_pointer_t< range_type > | host |
Iterator stores pointer to underlying container structure. | |
position_type | pos |
Store position index for container. | |
A generic random access iterator that delegates most operations to the range.
range_type | The data structure on which the iterator operates, e.g. std::vector<int> . |
The iterator makes certain assumptions on the range_type
, but does not formally require it to satisfy the std::ranges::random_access_range, because the iterator itself may be a requirement for this.