MySQL 9.6.0
Source Code Documentation
boundary_set_union_view.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_BOUNDARY_SET_UNION_VIEW_H
25#define MYSQL_SETS_BOUNDARY_SET_UNION_VIEW_H
26
27/// @file
28/// Experimental API header
29
30#include "mysql/sets/base_binary_operation_views.h" // Union_view
31#include "mysql/sets/boundary_set_binary_operation_view_base.h" // Boundary_set_binary_operation_view_base
32#include "mysql/sets/boundary_set_meta.h" // Is_boundary_set
33#include "mysql/sets/set_categories_and_traits.h" // Is_compatible_set
34
35/// @addtogroup GroupLibsMysqlSets
36/// @{
37
38namespace mysql::sets {
39
40/// View over the union of two boundary sets.
41///
42/// This provides forward iterators.
43///
44/// @tparam Source1_tp Type of the left boundary set.
45///
46/// @tparam Source2_tp Type of the left boundary set.
47template <Is_boundary_set Source1_tp, Is_boundary_set Source2_tp>
48 requires Is_compatible_set<Source1_tp, Source2_tp>
49class Union_view<Source1_tp, Source2_tp>
51 Source1_tp, Source2_tp, Binary_operation::op_union> {
53 Source1_tp, Source2_tp, Binary_operation::op_union>;
54
55 public:
56 /// Construct a new, empty Union_view.
57 Union_view() noexcept = default;
58
59 /// Construct a new Union_view over the given sources.
60 ///
61 /// @param source1 The first source.
62 ///
63 /// @param source2 The second source.
64 Union_view(const Source1_tp &source1, const Source2_tp &source2) noexcept
65 : Base_t(source1, source2) {}
66
67 /// Construct a new Union_view over the given sources.
68 ///
69 /// Use this constructor if one of the sources may be empty and you do not
70 /// have an object representing it; then pass nullptr for that source.
71 ///
72 /// @param source1 The first source, or nullptr for the empty set.
73 ///
74 /// @param source2 The second source, or nullptr for the empty set.
75 Union_view(const Source1_tp *source1, const Source2_tp *source2) noexcept
76 : Base_t(source1, source2) {}
77};
78
79} // namespace mysql::sets
80
81// addtogroup GroupLibsMysqlSets
82/// @}
83
84#endif // ifndef MYSQL_SETS_BOUNDARY_SET_UNION_VIEW_H
Experimental API header.
Experimental API header.
CRTP base class to provide members of a collection based on an implementation that provides begin/end...
Definition: collection_interface.h:90
Union_view() noexcept=default
Construct a new, empty Union_view.
Union_view(const Source1_tp *source1, const Source2_tp *source2) noexcept
Construct a new Union_view over the given sources.
Definition: boundary_set_union_view.h:75
Primary template for views over unions of two sets operations.
Definition: base_binary_operation_views.h:54
Common base class for the specializations of Union_view, Intersection_view, and Subtraction_view for ...
Definition: boundary_set_binary_operation_view_base.h:62
Definition: gtid_set.h:183
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
Experimental API header.