A trace iterator an unbanded trace matrix. More...
#include <seqan3/alignment/matrix/detail/trace_iterator.hpp>
Public Types | |
Associated types | |
using | value_type = trace_directions |
The value type. | |
using | reference = trace_directions const & |
The reference type. | |
using | pointer = value_type * |
The pointer type. | |
using | difference_type = std::ptrdiff_t |
The difference type. | |
using | iterator_category = std::forward_iterator_tag |
Public Member Functions | |
Constructors, destructor and assignment | |
constexpr | trace_iterator ()=default |
Defaulted. | |
constexpr | trace_iterator (trace_iterator const &)=default |
Defaulted. | |
constexpr | trace_iterator (trace_iterator &&)=default |
Defaulted. | |
constexpr trace_iterator & | operator= (trace_iterator const &)=default |
Defaulted. | |
constexpr trace_iterator & | operator= (trace_iterator &&)=default |
Defaulted. | |
~trace_iterator ()=default | |
Defaulted. | |
constexpr | trace_iterator (matrix_iter_t const matrix_iter) noexcept |
Constructs from the underlying trace matrix iterator indicating the start of the trace path. More... | |
template<two_dimensional_matrix_iterator other_matrix_iter_t> | |
constexpr | trace_iterator (trace_iterator< other_matrix_iter_t > const other) noexcept |
Constructs from the underlying trace matrix iterator indicating the start of the trace path. More... | |
Element access | |
reference | operator* () const noexcept |
Returns the current trace direction. | |
pointer | operator-> () const noexcept |
Returns a pointer to the current trace direction. | |
constexpr matrix_coordinate | coordinate () const noexcept |
Returns the current coordinate in two-dimensional space. | |
Arithmetic operators | |
constexpr trace_iterator< matrix_iter_t > & | operator++ () noexcept |
Advances the iterator by one. | |
constexpr trace_iterator< matrix_iter_t > | operator++ (int) noexcept |
Returns an iterator advanced by one. | |
Private Types | |
using | base_t = trace_iterator_base< trace_iterator< matrix_iter_t >, matrix_iter_t > |
The type of the base class. | |
Private Member Functions | |
constexpr trace_iterator< matrix_iter_t > const & | derived () const noexcept |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
constexpr trace_iterator< matrix_iter_t > & | derived () noexcept |
Cast this object to its derived type. | |
void | set_trace_direction (trace_directions const dir) noexcept |
Updates the current trace direction. | |
Overload functions | |
These functions can be overloaded by the derived class to customise the iterator. | |
constexpr void | go_left (matrix_iter_t &iter) const noexcept |
Moves iterator to previous left cell. | |
constexpr void | go_up (matrix_iter_t &iter) const noexcept |
Moves iterator to previous up cell. | |
constexpr void | go_diagonal (matrix_iter_t &iter) const noexcept |
Moves iterator to previous diagonal cell. | |
Private Attributes | |
trace_directions | current_direction |
The current trace direction. | |
friend | derived_t |
Befriend the derived iterator class to allow calling the private constructors. | |
matrix_iter_t | matrix_iter |
The underlying matrix iterator. | |
A trace iterator an unbanded trace matrix.
matrix_iter_t | The wrapped matrix iterator; must model seqan3::detail::two_dimensional_matrix_iterator and the iterator's value type must be the same as seqan3::detail::trace_directions, i.e. std::same_as<std::iter_value_t<matrix_iter_t>, trace_directions> must evaluate to true . |
This iterator follows a given trace in an unbanded trace matrix.
|
inherited |
Forward iterator tag.
|
inlineexplicitconstexprnoexcept |
Constructs from the underlying trace matrix iterator indicating the start of the trace path.
[in] | matrix_iter | The underlying matrix iterator. |
|
inlineconstexprnoexcept |
Constructs from the underlying trace matrix iterator indicating the start of the trace path.
other_matrix_iter_t | The underlying matrix iterator type of other ; the condition std::constructible_from<matrix_iter_t, other_matrix_iter_t> must evaluate to true . |
[in] | other | The underlying matrix iterator. |
Allows the conversion of non-const to const iterator.