MySQL 9.6.0
Source Code Documentation
sets.h
Go to the documentation of this file.
1// Copyright (c) 2024, 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_SETS_H
25#define MYSQL_SETS_SETS_H
26
27/// @file
28/// Experimental API header
29///
30/// This is a high-level header, intended for users to include in order to
31/// import all functionality in the sets library.
32
33// Files are listed in order from more primitive to more complex. A file is not
34// supposed to include a file appearing after it in the list.
35
36// ==== Set categories ====
37
38// Set categories are type tags used by the member type Set_category_t of any
39// set class. Set categories are used to dispatch to a particular implementation
40// of an algorithm. For example, each category has its own implementation of
41// `is_subset`, and the type tags of the operands are used to determine which
42// implementation to use. Currently we have the categories Boundary sets,
43// Interval sets, and Nested sets. Users may define their own set categories.
44
45// Type tags to identify categories of sets.
47
48// Set category definitions for boundary sets.
50
51// Set category definitions for interval sets.
53
54// Set category definitions for interval sets.
56
57// ==== Set traits ====
58
59// Set traits are classes that bundle compile-time parameters of a set. Each set
60// has a member type Set_traits_t bound to a set traits class. Algorithms use
61// set traits to determine how to perform basic operations. For example, for an
62// interval set, the set traits determine the type of elements, the predicate to
63// compare two elements, and the minimum and maximum value. Users may define
64// their own set traits.
65
66// Traits to characterize the data stored in a set.
68
69// Concepts that depend on both category and traits.
71
72// Other generic metaprogramming functionality.
73#include "mysql/sets/meta.h"
74
75// CRTP base for ordered Set traits.
77
78// Int_set_traits, the Set traits class template for sets holding integers.
80
81// Nested_set_traits, the class template for Set traits for Nested sets.
83
84// ==== Metaprogramming (concepts) for each specific set type ====
85
86// Concepts to test set traits for boundary sets.
88
89// Concepts to test set traits for interval sets.
91
92// Concepts to test set traits for nested sets.
94
95// ==== Upper and lower bounds ====
96
97// CRTP base for classes with upper_bound/lower_bound member functions.
99
100// ==== Interfaces for Boundary sets and Interval sets ====
101
102// CRTP base for boundary sets
104
105// Classes representing single intervals.
106#include "mysql/sets/interval.h"
107
108// CRTP base for interval sets.
110
111// ==== Free function predicates ====
112
113// Free function Boolean set predicates common to most set categories, e.g.,
114// is_equal.
116
117// Free function Boolean set predicates such as is_subset, for intervals.
119
120// Free function Boolean set predicates such as is_subset, for boundary sets.
122
123// Free function Boolean set predicates such as is_subset, for interval sets.
125
126// Free function Boolean set predicates such as is_subset.
128
129// ==== Constant views, e.g., Empty_set_view ====
130
131// Helpers used when defining views below.
133
134// Primary templates and factory functions.
136
137// Views over empty and full Boundary sets, and views over arbitrary
138// compile-time-defined boundaries.
140
141// View over empty and full Interval set.
143
144// View over empty nested sets.
146
147// ==== Views over binary operations, e.g. Union_view ====
148
149// enum Binary_operation { op_union, op_intersection, op_subtraction }
151
152// Primary templates and factory functions.
154
155// ---- Boundary set binary operation binary operations ----
156
157// Common class template for iterators over binary operations on boundary sets.
159
160// Base class for views over binary operations on boundary sets.
162
163// View over union of boundary sets.
165
166// View over intersection of boundary sets.
168
169// View over subtraction of boundary sets.
171
172// ---- Interval set binary operations ----
173
174// Base class for views of binary operations on interval sets.
176
177// View over union of interval sets.
179
180// View over intersection of interval sets.
182
183// View over subtraction of interval sets.
185
186// ---- Nested set binary operations ----
187
188// Common base class for iterators over binary operations on nested sets.
190
191// Iterators over union of nested sets.
193
194// Iterators over intersection of nested sets.
196
197// Iterators over subtraction of nested sets.
199
200// Base class for views over binary operations on nested sets.
202
203// View over union of nested sets.
205
206// View over intersection of nested sets.
208
209// View over subtraction of nested sets.
211
212// ==== Views over complements: Complement_view ====
213
214// Primary template and factory function.
216
217// Complement view over boundary sets.
219
220// Complement view over interval sets.
222
223// ==== Volume ====
224
225// Generic implementation of volume_difference.
227
228// Compute the volume of a single interval.
230
231// Compute the volume of an interval set.
233
234// Compute the volume of a boundary set.
236
237// Compute the volume of a nested set.
239
240// ==== Boundary containers and storage ====
241
242// Base class for containers which are wrappers around other containers.
244
245// Helper function used when defining inplace set operations.
247
248// Associative boundary storage, based on std::map. May throw bad_alloc.
250
251// Contiguous boundary storage, based on std::vector. May throw bad_alloc.
253
254// Boundary container, based on one of the storage classes. May throw bad_alloc.
256
257// Adaptor for boundary containers, that "converts" bad_alloc to a return value.
259
260// ==== Interval containers ====
261
262// Adaptor that provides an interval container from a boundary container.
264
265// ==== Nested containers and storage ====
266
267// Associative nested set storage, based on std::map.
269
270// Nested set container.
272
273// ==== Type aliases for containers ====
274
275// Using-definitions for containers based on map/vector storage.
276#include "mysql/sets/aliases.h"
277
278// ==== String conversion ====
279
280// String format definition for boundary sets and interval sets.
282
283// String format definition for nested sets.
285
286// Implementation enabling mysql::strconv::encode for interval/boundary
287// sets.
289
290// Implementation enabling mysql::strconv::decode for interval/boundary
291// sets.
293
294#endif // ifndef MYSQL_SETS_SETS_H
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.
Experimental API header.