24#ifndef MYSQL_SETS_NESTED_SET_INTERSECTION_ITERATOR_H
25#define MYSQL_SETS_NESTED_SET_INTERSECTION_ITERATOR_H
45template <Is_nested_set Source1_tp, Is_nested_set Source2_tp>
46 requires Is_compatible_set<Source1_tp, Source2_tp>
49 Nested_set_intersection_iterator<Source1_tp, Source2_tp>, Source1_tp,
50 Source2_tp, Binary_operation::op_intersection> {
88 [[nodiscard]]
auto get()
const {
136 if (it1 == source1.end()) {
140 if (it2 == source2.end()) {
191 auto &it,
auto &other_it)
const {
192 auto pos =
source->find(it, other_it->first);
193 if (pos !=
source->end()) {
201 if (it ==
source->end()) {
204 other_it = other_source->end();
Self_tp Self_t
Definition: iterator_interface.h:372
Common base class for the forward iterators over union view, intersection view, and subtraction view ...
Definition: nested_set_binary_operation_iterator_base.h:54
Source2_tp Source2_t
Definition: nested_set_binary_operation_iterator_base.h:57
typename Source2_t::Const_iterator_t Iterator2_t
Definition: nested_set_binary_operation_iterator_base.h:63
typename Source1_tp::Key_traits_t Key_traits_t
Definition: nested_set_binary_operation_iterator_base.h:64
std::pair< const Key_t, Mapped_t > Value_t
Definition: nested_set_binary_operation_iterator_base.h:69
Iterator1_t m_iterator1
Iterator into the first source.
Definition: nested_set_binary_operation_iterator_base.h:137
Source1_tp Source1_t
Definition: nested_set_binary_operation_iterator_base.h:56
Iterator2_t m_iterator2
Iterator into the second source.
Definition: nested_set_binary_operation_iterator_base.h:142
Opt_source1_t m_source1
The first source.
Definition: nested_set_binary_operation_iterator_base.h:129
const auto & iterator2() const
Return const reference to the current iterator into the second set.
Definition: nested_set_binary_operation_iterator_base.h:106
Opt_source2_t m_source2
The second source.
Definition: nested_set_binary_operation_iterator_base.h:132
typename Source1_t::Const_iterator_t Iterator1_t
Definition: nested_set_binary_operation_iterator_base.h:62
Value_t make_value() const
Return the current value, computed as operation(m_iterator1, m_iterator2).
Definition: nested_set_binary_operation_iterator_base.h:113
const auto & iterator1() const
Return const reference to the current iterator into the first set.
Definition: nested_set_binary_operation_iterator_base.h:100
Iterator over the intersection of two sets.
Definition: nested_set_intersection_iterator.h:50
Source2_tp Source2_t
Definition: nested_set_binary_operation_iterator_base.h:57
bool is_equal(const Nested_set_intersection_iterator &other) const
Definition: nested_set_intersection_iterator.h:102
Nested_set_intersection_iterator(const Source1_t *source1, const Source2_t *source2, const Iterator1_t &iterator1, const Iterator2_t &iterator2)
Definition: nested_set_intersection_iterator.h:81
void next()
Move to the next iterator position.
Definition: nested_set_intersection_iterator.h:94
typename Source2_t::Const_iterator_t Iterator2_t
Definition: nested_set_binary_operation_iterator_base.h:63
void clean() const
Perform the second phase of advancing the position, unless it has already been done.
Definition: nested_set_intersection_iterator.h:115
Nested_set_intersection_iterator< Source1_tp, Source2_tp > Self_t
Definition: nested_set_intersection_iterator.h:51
Nested_set_intersection_iterator()=default
auto get() const
Definition: nested_set_intersection_iterator.h:88
bool m_is_dirty
True when the first phase of advancing the position but not the second one has completed.
Definition: nested_set_intersection_iterator.h:111
Source1_tp Source1_t
Definition: nested_set_binary_operation_iterator_base.h:56
void advance_if_needed() const
Perform the second phase of advancing the position.
Definition: nested_set_intersection_iterator.h:127
Done step_and_check_done(const auto &source, const auto &other_source, auto &it, auto &other_it) const
Assuming none of it and other_it is at the end, and *it < *other_it, advance it to point to an elemen...
Definition: nested_set_intersection_iterator.h:190
typename Source1_t::Const_iterator_t Iterator1_t
Definition: nested_set_binary_operation_iterator_base.h:62
Done
Whether the iteration is done or not.
Definition: nested_set_intersection_iterator.h:124
static int cmp(Bigint *a, Bigint *b)
Definition: dtoa.cc:1064
constexpr bool is_intersecting(const Interval< Set_traits_t > &interval, const Is_boundary_set_over_traits< Set_traits_t > auto &set)
Return true if the left Interval and the right Boundary set intersect (overlap).
Definition: boundary_set_predicates.h:121
repeated Source source
Definition: replication_asynchronous_connection_failover.proto:42