MySQL 9.6.0
Source Code Documentation
interval_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_INTERVAL_SET_UNION_VIEW_H
25#define MYSQL_SETS_INTERVAL_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/interval_set_binary_operation_view_base.h" // Interval_set_binary_operation_view_base
32#include "mysql/sets/interval_set_meta.h" // Is_interval_set
33#include "mysql/sets/set_categories_and_traits.h" // Is_compatible_set
34
35/// @addtogroup GroupLibsMysqlSets
36/// @{
37
38namespace mysql::sets {
39
40/// Specialization of Union_view for interval sets.
41///
42/// This provides forward iterators.
43///
44/// @tparam Source1_tp Type of first interval set.
45///
46/// @tparam Source2_tp Type of second interval set.
47template <Is_interval_set Source1_tp, Is_interval_set Source2_tp>
48class Union_view<Source1_tp, Source2_tp>
49 : public detail::Interval_set_binary_operation_view_base<
50 Source1_tp, Source2_tp, Binary_operation::op_union> {
52 Source1_tp, Source2_tp, Binary_operation::op_union>;
53
54 public:
55 /// Construct a new, empty view.
56 Union_view() noexcept = default;
57
58 /// Construct a new view over the two given interval set sources.
59 ///
60 /// @param source1 The first source.
61 ///
62 /// @param source2 The second source.
63 Union_view(const Source1_tp &source1, const Source2_tp &source2) noexcept
64 : Base_t(source1, source2) {}
65
66 /// Construct a new view over the two given interval set sources.
67 ///
68 /// Use this constructor if one of the sources may be empty and you do not
69 /// have an object representing it; then pass nullptr for that source.
70 ///
71 /// @param source1 The first source, or nullptr for empty set.
72 ///
73 /// @param source2 The second source, or nullptr for empty set.
74 Union_view(const Source1_tp *source1, const Source2_tp *source2) noexcept
75 : Base_t(source1, source2) {}
76};
77
78} // namespace mysql::sets
79
80// addtogroup GroupLibsMysqlSets
81/// @}
82
83#endif // ifndef MYSQL_SETS_INTERVAL_SET_UNION_VIEW_H
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 view.
Union_view(const Source1_tp *source1, const Source2_tp *source2) noexcept
Construct a new view over the two given interval set sources.
Definition: interval_set_union_view.h:74
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: interval_set_binary_operation_view_base.h:58
Experimental API header.
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.