42 #include <range/v3/utility/iterator.hpp> 59 template <
typename range_buffer_t>
62 static_assert(!std::is_const_v<range_buffer_t>,
63 "Cannot create an alignment stream over a const buffer.");
78 using pointer = std::add_pointer_t<value_type>;
80 using iterator_category = std::input_iterator_tag;
85 iterator_type() =
default;
86 iterator_type(iterator_type
const &) =
default;
87 iterator_type(iterator_type &&) =
default;
88 iterator_type & operator=(iterator_type
const &) =
default;
89 iterator_type & operator=(iterator_type &&) =
default;
90 ~iterator_type() =
default;
102 return stream_ptr->cached();
107 return stream_ptr->cached();
114 iterator_type & operator++()
120 iterator_type operator++(
int )
134 return stream_ptr->eof();
138 iterator_type
const & rhs)
145 return !(*
this == rhs);
149 iterator_type
const & rhs)
160 friend class iterator_type;
186 range_buffer{&_range_buffer, [](
auto) { }}
190 template <
typename resource_t,
193 requires std::is_constructible_v<range_buffer_t, resource_t, selector_t>
196 selector_t _selector) :
197 range_buffer{std::make_shared<range_buffer_t>(std::forward<resource_t>(_range_buffer_resource), _selector)}
222 if (
auto opt = range_buffer->bump(); opt.has_value())
223 cache = &(*opt).get();
244 constexpr
bool eof() const noexcept
251 std::shared_ptr<range_buffer_t> range_buffer;
255 bool eof_flag{
false};
typename range_buffer_t::value_type value_type
The alignment result type.
Definition: alignment_range.hpp:167
auto & cached() noexcept
Returns the cached result.
Definition: alignment_range.hpp:230
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
Adaptations of concepts from the Ranges TS.
auto const & cached() const noexcept
Returns the cached result.
Definition: alignment_range.hpp:237
::ranges::begin begin
Alias for ranges::begin. Returns an iterator to the beginning of a range.
Definition: ranges:185
void next()
Receives the next alignment result from the executor buffer.
Definition: alignment_range.hpp:219
constexpr bool eof() const noexcept
Returns whether the executor buffer reached is end.
Definition: alignment_range.hpp:244
Type metafunction that returns the const_reference of another type [metafunction declaration].
Definition: pre.hpp:146
typename range_buffer_t::difference_type difference_type
The offset type.
Definition: alignment_range.hpp:165
std::ranges::default_sentinel sentinel
The sentinel type.
Definition: alignment_range.hpp:173
::ranges::end end
Alias for ranges::end. Returns an iterator to the end of a range.
Definition: ranges:190
iterator_type iterator
The iterator type.
Definition: alignment_range.hpp:171
::ranges::default_sentinel default_sentinel
Alias for ranges::default_sentinel. Empty sentinel type for use with iterator types that know the bou...
Definition: ranges:215
The alignment.
Definition: alignment_range.hpp:60
typename range_buffer_t::reference reference
The reference type.
Definition: alignment_range.hpp:169