24#ifndef MYSQL_SETS_NESTED_SET_INTERFACE_H
25#define MYSQL_SETS_NESTED_SET_INTERFACE_H
57template <
class Self_tp, std::forward_iterator Iterator_tp,
58 std::forward_iterator Const_iterator_tp,
59 Is_nested_set_traits Set_traits_tp>
71 using Key_t =
typename Key_traits_t::Element_t;
74 using Mapped_t =
typename Iterator_value_t::second_type;
77 std::same_as<Iterator_value_t, std::pair<const Key_t, Mapped_t>>);
86 assert(it !=
self().end());
97 assert(it !=
self().end());
102 [[nodiscard]]
auto &
self() {
return static_cast<Self_t &
>(*this); }
103 [[nodiscard]]
const auto &
self()
const {
104 return static_cast<const Self_t &
>(*this);
124template <
class Self_tp, std::input_iterator Iterator_tp,
125 std::input_iterator Const_iterator_tp,
126 Is_nested_set_traits Set_traits_tp>
130 Const_iterator_tp, Set_traits_tp>,
131 public std::ranges::view_base {
139 using Nested_set_base_t::operator[];
150template <
class Self_tp,
class Wrapped_tp>
154 Self_tp, mysql::ranges::Range_iterator_type<Wrapped_tp>,
155 mysql::ranges::Range_const_iterator_type<Wrapped_tp>,
156 typename Wrapped_tp::Set_traits_t> {
161 typename Wrapped_tp::Set_traits_t>;
167 using Nested_set_base_t::operator[];
169 template <
class... Args_t>
CRTP base class to provide members of a collection based on an implementation that provides begin/end...
Definition: collection_interface.h:90
CRTP base class/mixin, used to implement Nested Sets that are container wrappers.
Definition: nested_set_interface.h:156
Basic_nested_container_wrapper(Args_t &&...args) noexcept(noexcept(Wrapper_base_t(std::forward< Args_t >(args)...)))
Definition: nested_set_interface.h:171
Basic_set_container_wrapper< Self_tp, Wrapped_tp > Wrapper_base_t
Definition: nested_set_interface.h:157
Basic_nested_container_wrapper< Self_tp, Wrapped_tp > This_t
Definition: nested_set_interface.h:162
Definition: basic_set_container_wrapper.h:47
CRTP base class/mixin used to implement Nested sets that are views.
Definition: nested_set_interface.h:131
CRTP base class/mixin used to define a Nested set based on an implementation that provides the find a...
Definition: nested_set_interface.h:60
Set_traits_tp Set_traits_t
Definition: nested_set_interface.h:69
typename Key_traits_t::Element_t Key_t
Definition: nested_set_interface.h:71
typename Set_traits_t::Mapped_category_t Mapped_category_t
Definition: nested_set_interface.h:72
typename Set_traits_t::Key_traits_t Key_traits_t
Definition: nested_set_interface.h:70
const auto & operator[](const Key_t &key) const noexcept
Return const reference to the mapped Set for the given key.
Definition: nested_set_interface.h:95
Iterator_tp Iterator_t
Definition: nested_set_interface.h:64
typename Set_traits_t::Mapped_traits_t Mapped_traits_t
Definition: nested_set_interface.h:73
typename Iterator_value_t::second_type Mapped_t
Definition: nested_set_interface.h:74
mysql::ranges::Iterator_value_type< Iterator_t > Iterator_value_t
Definition: nested_set_interface.h:67
Self_tp Self_t
Definition: nested_set_interface.h:61
auto & operator[](const Key_t &key) noexcept
Return non-const reference to the mapped Set for the given key.
Definition: nested_set_interface.h:84
Const_iterator_tp Const_iterator_t
Definition: nested_set_interface.h:65
Container::const_iterator find(const Container &c, Value &&value)
Definition: generic.h:39
std::remove_cvref_t< decltype(std::declval< const Range_t >().begin())> Range_const_iterator_type
Gives the const_iterator type, deduced from the begin() const member.
Definition: meta.h:47
std::remove_cvref_t< decltype(*std::declval< Iterator_t >())> Iterator_value_type
Gives the value type for any iterator type, deduced from operator *.
Definition: meta.h:63
std::remove_cvref_t< decltype(std::declval< Range_t >().begin())> Range_iterator_type
Gives the iterator type, deduced from the begin() member.
Definition: meta.h:42
Definition: gtid_set.h:183
required string key
Definition: replication_asynchronous_connection_failover.proto:60
Tag to identify a class as a Nested set.
Definition: nested_set_category.h:41