MySQL 9.6.0
Source Code Documentation
nested_set_const_views.h
Go to the documentation of this file.
1// Copyright (c) 2025, Oracle and/or its affiliates.
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License, version 2.0,
5// as published by the Free Software Foundation.
6//
7// This program is designed to work with certain software (including
8// but not limited to OpenSSL) that is licensed under separate terms,
9// as designated in a particular file or component or in included license
10// documentation. The authors of MySQL hereby grant you an additional
11// permission to link the program and your derivative works with the
12// separately licensed software that they have either included with
13// the program or referenced in the documentation.
14//
15// This program is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License, version 2.0, for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with this program; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
24#ifndef MYSQL_SETS_NESTED_SET_CONST_VIEWS_H
25#define MYSQL_SETS_NESTED_SET_CONST_VIEWS_H
26
27/// @file
28/// Experimental API header
29
30#include "mysql/iterators/empty_sequence_iterator.h" // Empty_sequence_iterator
31#include "mysql/sets/base_const_views.h" // Empty_set_view
32#include "mysql/sets/nested_set_category.h" // Nested_set_category_tag
33#include "mysql/sets/nested_set_interface.h" // Nested_set_interface
34#include "mysql/sets/nested_set_meta.h" // Is_nested_set_traits
35
36/// @addtogroup GroupLibsMysqlSets
37/// @{
38
39namespace mysql::sets::detail {
40
41/// Gives the mapped type for a nested Empty_set_view.
42///
43/// @tparam Set_traits_t Nested set traits.
44template <Is_nested_set_traits Set_traits_t>
46 Empty_set_view<typename Set_traits_t::Mapped_category_t,
47 typename Set_traits_t::Mapped_traits_t>;
48
49/// Gives the iterator type for a nested Empty_set_view.
50///
51/// @tparam Set_traits_t Nested set traits.
52template <Is_nested_set_traits Set_traits_t>
54 std::pair<const typename Set_traits_t::Key_t,
56
57} // namespace mysql::sets::detail
58
59namespace mysql::sets {
60
61/// View over an empty Nested set
62///
63/// @tparam Set_traits_tp Nested set traits.
64template <Is_nested_set_traits Set_traits_tp>
66 : public Nested_view_interface<
67 Empty_set_view<Nested_set_category_tag, Set_traits_tp>,
68 detail::Empty_nested_iterator_type<Set_traits_tp>,
69 detail::Empty_nested_iterator_type<Set_traits_tp>, Set_traits_tp> {
70 public:
71 using Key_t = typename Set_traits_tp::Key_t;
74
75 [[nodiscard]] constexpr auto begin() const { return Iterator_t(); }
76
77 [[nodiscard]] constexpr auto end() const { return Iterator_t(); }
78
79 [[nodiscard]] constexpr Iterator_t find(const Key_t & /*key*/) const {
80 return Iterator_t();
81 }
82
83 [[nodiscard]] constexpr Iterator_t find(Iterator_t & /*cursor*/,
84 const Key_t & /*key*/) const {
85 return Iterator_t();
86 }
87
88}; // class Empty_set_view
89
90} // namespace mysql::sets
91
92// addtogroup GroupLibsMysqlSets
93/// @}
94
95#endif // ifndef MYSQL_SETS_NESTED_SET_CONST_VIEWS_H
Experimental API header.
Iterator over an empty sequence.
Definition: empty_sequence_iterator.h:46
constexpr auto begin() const
Definition: nested_set_const_views.h:75
constexpr Iterator_t find(const Key_t &) const
Definition: nested_set_const_views.h:79
typename Set_traits_tp::Key_t Key_t
Definition: nested_set_const_views.h:71
constexpr Iterator_t find(Iterator_t &, const Key_t &) const
Definition: nested_set_const_views.h:83
constexpr auto end() const
Definition: nested_set_const_views.h:77
Forward declaration of primary template for views over empty sets.
Definition: base_const_views.h:46
CRTP base class/mixin used to implement Nested sets that are views.
Definition: nested_set_interface.h:131
Experimental API header.
Definition: aliases.h:97
Definition: gtid_set.h:183
Experimental API header.
Experimental API header.
Experimental API header.
Tag to identify a class as a Nested set.
Definition: nested_set_category.h:41