MySQL 9.6.0
Source Code Documentation
mysql::sets Namespace Reference

Namespaces

namespace  detail
 
namespace  strconv
 
namespace  throwing
 

Classes

struct  Base_set_category_tag
 Base class for all Set category tag classes. More...
 
struct  Base_set_traits
 Base class for all Set_traits classes. More...
 
class  Basic_boundary_container_wrapper
 CRTP base class/mixin, used to implement Boundary Sets that are container wrappers. More...
 
class  Basic_nested_container_wrapper
 CRTP base class/mixin, used to implement Nested Sets that are container wrappers. More...
 
class  Basic_set_container_wrapper
 
struct  Boundary_set_category_tag
 Tag to identify a class as a Boundary set. More...
 
class  Boundary_view_interface
 CRTP base class/mixin, used to implement Boundary Sets that are views. More...
 
class  Complement_view
 This can be specialized to specific set categories, e.g. More...
 
class  Complement_view< Source_tp >
 Specialization of Complement_view for boundary sets, providing a view over the complement of another boundary set. More...
 
class  Const_boundary_view
 Boundary set view for which the values are defined at compile-time. More...
 
class  Empty_set_view
 Forward declaration of primary template for views over empty sets. More...
 
class  Empty_set_view< Boundary_set_category_tag, Set_traits_tp >
 View over the empty Boundary set for the given Set traits. More...
 
class  Empty_set_view< Interval_set_category_tag, Set_traits_tp >
 View over the empty Interval set for the given Set traits. More...
 
class  Empty_set_view< Nested_set_category_tag, Set_traits_tp >
 View over an empty Nested set. More...
 
struct  Enable_donate_set
 Customization point that set container types can use to indicate that they support noexcept move-semantics for full-set-copy operations between the given types. More...
 
struct  Enable_donate_set< Set_t, Set_t >
 Enable move-semantics when moving one set to itself. More...
 
struct  Enable_donate_set< Source_t, Target_t >
 Declare that move-semantics is supported for full-set-copy operations on Set Container Wrapper types, whenever the wrapped types can be nothrow-moved. More...
 
struct  Enable_donate_set_elements
 Customization point that set container types can use to indicate that they support noexcept move-semantics to copy parts of a set during inplace_union/inplace_intersect/inplace_subtract operations between the given types. More...
 
struct  Enable_donate_set_elements< Source_t, Target_t >
 Declare that move-semantics is supported for element operations on Boundary Storage types, whenever full-set-copy is enabled and the function steal_and_insert is defined. More...
 
class  Full_set_view
 Forward declaration of primary template for views over "full" sets, i.e., the complement of the empty set. More...
 
class  Full_set_view< Boundary_set_category_tag, Set_traits_tp >
 View over the Boundary set containing the full range of values for the given Set traits. More...
 
class  Full_set_view< Interval_set_category_tag, Set_traits_tp >
 View over the Interval set containing the full range of values for the given Set traits. More...
 
struct  Int_set_traits
 Set traits for integral types. More...
 
class  Intersection_view
 Primary template for views over intersections of two sets operations. More...
 
class  Intersection_view< Source1_tp, Source2_tp >
 View over the intersection of two boundary sets. More...
 
class  Interval
 Holds the start boundary and endpoint boundary of an interval. More...
 
class  Interval_container
 Container for intervals. More...
 
struct  Interval_set_category_tag
 Tag to identify a class as an Interval set. More...
 
class  Interval_set_interface
 CRTP base class used to define an Interval set based on an implementation having the member function boundaries(). More...
 
class  Interval_set_view
 View that provides and Interval set from an underlying Boundary set. More...
 
struct  Iterator_get_first
 Iterator getter that returns iterator->first. More...
 
struct  Iterator_get_value
 Iterator getter that returns *iterator. More...
 
class  Map_boundary_container
 Boundary container using std::map as backing storage. More...
 
class  Map_interval_container
 Interval container using std::map as backing storage. More...
 
class  Map_nested_container
 Nested set container using std::map as backing storage. More...
 
class  Map_nested_storage
 Storage for nested sets, backed by a std::map. More...
 
class  Nested_container
 Represents the subset of a Cartesian product "L x R" of two sets, using a map data structure that maps elements of type L to containers holding values of type R. More...
 
struct  Nested_set_category_tag
 Tag to identify a class as a Nested set. More...
 
struct  Nested_set_traits
 Set traits for Nested sets. More...
 
class  Nested_view_interface
 CRTP base class/mixin used to implement Nested sets that are views. More...
 
class  Nonthrowing_boundary_container_adaptor
 Non-throwing container that stores boundaries. More...
 
class  Optional_view_source_set
 Used to represent an optional source of a view, when that source is a set. More...
 
struct  Ordered_set_traits_interface
 Helper CRTP base class to define Ordered Set traits classes, which are optionally Bounded and/or Metric (cf Is_bounded_set_traits/Is_metric_set_traits). More...
 
class  Subtraction_view
 Primary template for views over subtractions of two sets operations. More...
 
class  Subtraction_view< Source1_tp, Source2_tp >
 View over one set minus another other set. More...
 
class  Union_view
 Primary template for views over unions of two sets operations. More...
 
class  Union_view< Source1_tp, Source2_tp >
 View over the union of two boundary sets. More...
 
class  Upper_lower_bound_interface
 CRTP base class (mixin) to define a set that has upper_bound and lower_bound members. More...
 
class  Vector_boundary_container
 Boundary container using std::vector as backing storage. More...
 
class  Vector_interval_container
 Interval container using std::vector as backing storage. More...
 

Concepts

concept  Is_boundary_iterator
 True if Test is a boundary point iterator, i.e.
 
concept  Is_boundary_iterator_over_type
 True if Test is a boundary point iterator over values of type Value_t.
 
concept  Is_bidirectional_boundary_iterator
 True if Test is a boundary point iterator and a bidirectional iterator.
 
concept  Is_random_access_boundary_iterator
 True if Test is a boundary point iterator and a random access iterator.
 
concept  Is_contiguous_boundary_iterator
 True if Test is a boundary point iterator and a contiguous iterator.
 
concept  Is_boundary_set
 True if Test is an interval set, i.e., provides a view over intervals sorted by their endpoints, where each interval is nonempty, disjoint from other intervals, and even does not share endpoint with adjacent intervals.
 
concept  Is_boundary_set_over_traits
 True if Test is an interval set over the given Set traits.
 
concept  Is_boundary_set_ref
 True if Test is a reference to a boundary set.
 
concept  Is_boundary_set_ref_over_traits
 True if Test is a reference to a boundary set.
 
concept  Is_boundary_set_over_traits_unqualified
 
concept  Is_readable_boundary_storage
 True if Test is a readable boundary storage, i.e., an object that can be used as the back-end storage for a boundary container, without the requirement to have altering operations.
 
concept  Is_readable_boundary_storage_over_traits
 True if Test is a boundary storage over the given Set traits.
 
concept  Is_boundary_storage
 True if Test is a readable boundary storage, i.e., an object that can be used as the back-end storage for a boundary container.
 
concept  Is_boundary_storage_over_traits
 True if Test is a boundary storage over the given Set traits.
 
concept  Is_boundary_container
 True if Test is a Boundary container.
 
concept  Is_boundary_container_ref
 True if Test is a reference to a Boundary_container.
 
concept  Is_interval_set_implementation
 Helper concept to identify if a class can be the implementation for Interval_set_interface.
 
concept  Is_interval_set
 
concept  Is_interval_set_over_traits
 
concept  Is_interval_set_over_traits_unqualified
 
concept  Is_interval_container
 True if Test is an Interval_container.
 
concept  Has_fast_size
 Determines if the given type has "fast" size computations.
 
concept  Can_donate_set_unqualified
 True if move-semantics has been declared as enabled for full-set-copy operations for the given operand types, with cvref removed from Source_t.
 
concept  Can_donate_set
 True if move-semantics has been declared as enabled for full-set-copy operations for the given operand types, and Source_t is an rvalue reference type.
 
concept  Can_donate_set_elements_unqualified
 True if move-semantics has been declared as enabled for inplace_union/inplace_intersect/inplace_subtract operations for the given operand types, with cvref removed from Source_t.
 
concept  Can_donate_set_elements
 True if move-semantics has been declared as enabled for inplace_union/inplace_intersect/inplace_subtract operations for the given operand types, and Source_t is an rvalue reference type.
 
concept  Is_nested_set_traits
 True if Test is a Set Traits class for a nested set.
 
concept  Is_nested_set
 True if Test is a nested set.
 
concept  Is_nested_set_over_traits
 True if Test satisfies Is_nested_set and its traits is Set_traits_t.
 
concept  Is_nested_set_over_traits_unqualified
 
concept  Is_nested_storage
 True if Test is a Nested Set Storage.
 
concept  Is_nested_storage_over_traits
 True if Test is a Nested Storage and its traits equals Set_traits_t.
 
concept  Is_nested_container
 
concept  Is_ordered_set_implementation
 
concept  Is_set_category
 True if Test is a Set category tag, i.e., derived from Base_set_category_tag.
 
concept  Has_set_category
 True if Test has a member Set_category_t satisfying Is_set_category.
 
concept  Has_same_set_category
 True if the two Set classes have the same Set_category_t.
 
concept  Is_set_over_category_and_traits
 True if Test is a set with category Category_t and traits Traits_t.
 
concept  Is_set_over_category
 True if Test is a set with category Category_t.
 
concept  Is_set_over_traits
 True if Test is a set with traits Traits_t.
 
concept  Is_set
 True if Test is a set.
 
concept  Is_set_or_set_ref_over_category_and_traits
 True if Test is a reference to a set with category Category_t and traits Traits_t.
 
concept  Is_compatible_set
 True if Set1_t and Set2_t have the same Set_category_t and Set_traits_t.
 
concept  Is_iterator_defined_set
 True if the given set is of a category declared to be iterator-defined.
 
concept  Is_set_traits
 True if Test is a Set_traits class, i.e., is derived from Base_set_traits.
 
concept  Has_set_traits
 True if Test has a member Set_traits_t.
 
concept  Has_same_set_traits
 True if Test1 and Test2 have the same Set_traits_t.
 
concept  Is_element_set_traits
 True if Test is a Set traits class with an element type member, Element_t.
 
concept  Is_ordered_set_traits
 True if Test is an "ordered" Set traits class.
 
concept  Is_bounded_set_traits
 True if Test is a "bounded" Set traits class.
 
concept  Is_discrete_set_traits
 True if Test is a "discrete" Set traits class, i.e., it bounded, and it is possible to compute successors and predecessors.
 
concept  Is_metric_set_traits
 True if Test is a "metric" Set traits class, i.e., it is bounded, and it is possible to compute differences between boundaries.
 
concept  Is_discrete_metric_set_traits
 True if Test satisfies both Is_discrete_set_traits and Is_metric_set_traits.
 
concept  Is_getter_for_iterator
 True if Test is a getter for Iterator_t, i.e., Test::get(Iterator_t) is defined.
 
concept  Is_upper_lower_bound_implementation
 True if Test satisfies the requirements for being a subclass of Upper_lower_bound_interface.
 

Typedefs

template<template< class, class, class, class > class Map_template_t, Is_ordered_set_traits Set_traits_t, class Mapped_t = typename Set_traits_t::Element_t>
using Map_for_set_traits = Map_template_t< typename Set_traits_t::Element_t, Mapped_t, typename Set_traits_t::Less_t, mysql::allocators::Allocator< std::pair< const typename Set_traits_t::Element_t, Mapped_t > > >
 Given a class template of the same shape as std::map (four class arguments for key, mapped, compare, and allocator), and an Ordered set traits class, provides the specialization with parameters derived from the set traits. More...
 
template<Binary_operation binary_operation, class Source1_t , class Source2_t >
using Binary_operation_view_type = std::conditional_t<(int) binary_operation==(int) Binary_operation::op_union, Union_view< Source1_t, Source2_t >, std::conditional_t<(int) binary_operation==(int) Binary_operation::op_intersection, Intersection_view< Source1_t, Source2_t >, std::conditional_t<(int) binary_operation==(int) Binary_operation::op_subtraction, Subtraction_view< Source1_t, Source2_t >, void > > >
 For a Binary_operation and two operand sets, gives the corresponding Union_view, Intersection_view, or Subtraction_view class. More...
 
template<class Container_t >
using Storage_or_void = detail::Storage_or_void_helper< Container_t >::Type
 Type alias for Container_t::Storage_t if that exists, or void otherwise. More...
 
template<Is_interval_container Interval_container_t>
using Interval_set_boundary_set_type = std::remove_cvref_t< decltype(std::declval< Interval_container_t >().boundaries())>
 The type of the Boundary Set for a given Interval Set. More...
 

Enumerations

enum class  Binary_operation { op_union , op_intersection , op_subtraction }
 Identifies the type of a binary operation. More...
 

Functions

bool contains_element (const mysql::gtids::Is_gtid_set auto &gtid_set, const mysql::gtids::Is_gtid auto &gtid) noexcept
 contains_element for Gtid_sets, accepting a Gtid for the element. More...
 
template<Binary_operation binary_operation, class Source1_t , class Source2_t >
auto make_binary_operation_view (const Source1_t &source1, const Source2_t &source2)
 Return the Union_view, Intersection_view, or Subtraction_view over the arguments, according to the given Binary_operation. More...
 
template<class Source1_t , class Source2_t >
auto make_union_view (const Source1_t &source1, const Source2_t &source2)
 Return the Union_view over the arguments. More...
 
template<class Source1_t , class Source2_t >
auto make_intersection_view (const Source1_t &source1, const Source2_t &source2)
 Return the Intersection_view over the arguments. More...
 
template<class Source1_t , class Source2_t >
auto make_subtraction_view (const Source1_t &source1, const Source2_t &source2)
 Return the Subtraction_view over the arguments. More...
 
template<class Source_t >
auto make_complement_view (const Source_t &source)
 Return the Complement_view over the argument. More...
 
template<class Source_t >
decltype(auto) make_complement_view (const Complement_view< Source_t > &complement)
 Make complement-of-complement return the original set. More...
 
template<Is_set_category Set_category_t, Is_set_traits Set_traits_t>
auto & make_empty_set_view ()
 Return a reference to a singleton object representing the view containing the empty set, for the given Set category and Set traits. More...
 
template<Is_set Set_t>
auto & make_empty_set_view_like ()
 Return the result of make_empty_set_view for the set category and set traits of the given set type. More...
 
template<Is_set_category Set_category_t, Is_bounded_set_traits Set_traits_t>
auto & make_full_set_view ()
 Return a reference to a singleton object representing the view containing the empty set, for the given Set category and Set traits. More...
 
template<Is_set Set_t>
auto & make_full_set_view_like ()
 Return the result of make_full_set_view for the set category and set traits of the given set type. More...
 
template<class Result_t = double, Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t>
Result_t volume_difference (const Set1_t &set1, const Set2_t &set2)
 Return the volume of the first set minus the volume of the second set. More...
 
template<Is_boundary_set Boundary_set_t>
constexpr bool contains_element (const Boundary_set_t &set, const typename Boundary_set_t::Element_t &element)
 Return true if the element is contained in the Boundary set. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_subset (const Interval< Set_traits_t > &interval1, const Is_boundary_set_over_traits< Set_traits_t > auto &set2)
 Return true if the left Interval is a subset of or equal to the right Boundary_set. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_subset (const Is_boundary_set_over_traits< Set_traits_t > auto &set1, const Interval< Set_traits_t > &interval2)
 Return true if the left Boundary set is a subset of or equal to the right Interval. More...
 
template<Is_boundary_set Boundary_set1_t, Is_boundary_set Boundary_set2_t>
requires Is_compatible_set<Boundary_set1_t, Boundary_set2_t>
constexpr bool is_subset (const Boundary_set1_t &set1, const Boundary_set2_t &set2)
 Return true if the left Boundary set is a subset of or equal to the right Boundary_set. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_intersecting (const Interval< Set_traits_t > &interval, const Is_boundary_set_over_traits< Set_traits_t > auto &set)
 Return true if the left Interval and the right Boundary set intersect (overlap). More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_intersecting (const Is_boundary_set_over_traits< Set_traits_t > auto &set, const Interval< Set_traits_t > &interval)
 Return true if the left Boundary set and the right Interval intersect (overlap). More...
 
template<Is_boundary_set Boundary_set1_t, Is_boundary_set Boundary_set2_t>
requires Is_compatible_set<Boundary_set1_t, Boundary_set2_t>
constexpr bool is_intersecting (const Boundary_set1_t &set1, const Boundary_set2_t &set2)
 Return true if the two Boundary sets intersect (overlap). More...
 
template<Is_boundary_set Boundary_set_t>
requires Is_metric_set_traits<typename Boundary_set_t::Set_traits_t>
constexpr auto volume (const Boundary_set_t &set)
 Return the sum of the lengths of all intervals in the given Boundary set. More...
 
template<Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t> && Is_iterator_defined_set<Set1_t>
constexpr bool operator== (const Set1_t &set1, const Set2_t &set2)
 Return true if two sets are equal, which must be of the same Set category and Set traits and be iterator-defined. More...
 
template<Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t>
constexpr bool operator!= (const Set1_t &set1, const Set2_t &set2)
 Return true if the two sets are not equal. More...
 
template<Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t>
constexpr bool is_equal (const Set1_t &set1, const Set2_t &set2)
 Return true if the two sets are equal, which must be of the same Set category and Set traits. More...
 
constexpr bool is_superset (const auto &lhs, const auto &rhs)
 Return true if the left object is a superset of or equal to the right object. More...
 
constexpr bool is_disjoint (const auto &lhs, const auto &rhs)
 Return true if the two objects are disjoint (have nothing in common). More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool contains_element (const Interval< Set_traits_t > &interval, const typename Set_traits_t::Element_t &element)
 Return true if the element is contained in the Interval. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_subset (const Interval< Set_traits_t > &interval1, const Interval< Set_traits_t > &interval2)
 Return true if the left Interval is a subset of or equal to the right Interval. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_intersecting (const Interval< Set_traits_t > &interval1, const Interval< Set_traits_t > &interval2)
 Return true if the two Interval objects intersect (overlap). More...
 
template<Is_boundary_set Boundary_set_t>
auto make_interval_set_view (const Boundary_set_t &boundary_set)
 
template<Is_interval_set Interval_set_t>
constexpr bool contains_element (const Interval_set_t &set, const typename Interval_set_t::Element_t &element)
 Return true if the element is contained in the Interval set. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_subset (const Interval< Set_traits_t > &interval1, const Is_interval_set_over_traits< Set_traits_t > auto &set2)
 Return true if the left Interval is a subset of or equal to the right Interval set. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_subset (const Is_interval_set_over_traits< Set_traits_t > auto &set1, const Interval< Set_traits_t > &interval2)
 Return true if the left Interval set is a subset of or equal to the right Interval. More...
 
template<Is_interval_set Interval_set1_tp, Is_interval_set Interval_set2_tp>
requires Is_compatible_set<Interval_set1_tp, Interval_set2_tp>
constexpr bool is_subset (const Interval_set1_tp &set1, const Interval_set2_tp &set2)
 Return true if the left Interval set is a subset of or equal to the right Interval set. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_intersecting (const Interval< Set_traits_t > &interval, const Is_interval_set_over_traits< Set_traits_t > auto &set)
 Return true if the left Interval and the right Interval set intersect. More...
 
template<Is_bounded_set_traits Set_traits_t>
constexpr bool is_intersecting (const Is_interval_set_over_traits< Set_traits_t > auto &set, const Interval< Set_traits_t > &interval)
 Return true if the left Interval set and the right Interval intersect. More...
 
template<Is_interval_set Interval_set1_tp, Is_interval_set Interval_set2_tp>
requires Is_compatible_set<Interval_set1_tp, Interval_set2_tp>
constexpr bool is_intersecting (const Interval_set1_tp &set1, const Interval_set2_tp &set2)
 Return true if the two Interval sets intersect (overlap). More...
 
template<Is_interval_set Interval_set_t>
requires Is_metric_set_traits<typename Interval_set_t::Set_traits_t>
constexpr auto volume (const Interval_set_t &set)
 Return the sum of the lengths of all intervals in the given Interval set. More...
 
template<Is_metric_set_traits Set_traits_t>
constexpr auto volume (const Interval< Set_traits_t > &interval)
 Return the length of the given interval. More...
 
template<class Key_t , Is_set Mapped1_t, Is_set Mapped2_t>
requires (Is_compatible_set<Mapped1_t, Mapped2_t> && !std::same_as<Mapped1_t, Mapped2_t>)
constexpr bool operator== (const std::pair< const Key_t, Mapped1_t > &left, const std::pair< const Key_t, Mapped2_t > &right)
 Return true if the two pairs are equal, for pairs in which the second components have different types but the same set category and traits. More...
 
template<Is_nested_set Nested_set_t>
constexpr bool contains_element (const Nested_set_t &set, const typename Nested_set_t::Key_t &key, const auto &...mapped)
 Return true if the value is contained in the Nested set. More...
 
template<Is_nested_set Nested_set1_t, Is_nested_set Nested_set2_t>
requires Is_compatible_set<Nested_set1_t, Nested_set2_t>
constexpr bool is_subset (const Nested_set1_t &set1, const Nested_set2_t &set2)
 Return true if the left Nested set is a subset of or equal to the right Nested_set. More...
 
template<Is_nested_set Nested_set1_t, Is_nested_set Nested_set2_t>
requires Is_compatible_set<Nested_set1_t, Nested_set2_t>
constexpr bool is_intersecting (const Nested_set1_t &set1, const Nested_set2_t &set2)
 Return true if the two Nested sets intersect (overlap). More...
 
template<class Result_t = double, Is_nested_set Nested_set_t>
Result_t volume (const Nested_set_t &set)
 Return the volume of a nested set. More...
 

Variables

template<>
constexpr bool is_iterator_defined_set_category< Boundary_set_category_tag > = true
 Declare that Boundary sets are iterator-defined. More...
 
template<>
constexpr bool is_iterator_defined_set_category< Interval_set_category_tag > = true
 Declare that Interval sets are iterator-defined. More...
 
template<>
constexpr bool is_iterator_defined_set_category< Nested_set_category_tag > = true
 Declare that Nested sets are iterator-defined. More...
 
template<Is_set_category >
constexpr bool is_iterator_defined_set_category = false
 Primary variable template for customization point that declares that a set category is iterator-defined. More...
 

Typedef Documentation

◆ Binary_operation_view_type

template<Binary_operation binary_operation, class Source1_t , class Source2_t >
using mysql::sets::Binary_operation_view_type = typedef std::conditional_t< (int)binary_operation == (int)Binary_operation::op_union, Union_view<Source1_t, Source2_t>, std::conditional_t< (int)binary_operation == (int)Binary_operation::op_intersection, Intersection_view<Source1_t, Source2_t>, std::conditional_t<(int)binary_operation == (int)Binary_operation::op_subtraction, Subtraction_view<Source1_t, Source2_t>, void> >>

For a Binary_operation and two operand sets, gives the corresponding Union_view, Intersection_view, or Subtraction_view class.

◆ Interval_set_boundary_set_type

template<Is_interval_container Interval_container_t>
using mysql::sets::Interval_set_boundary_set_type = typedef std::remove_cvref_t< decltype(std::declval<Interval_container_t>().boundaries())>

The type of the Boundary Set for a given Interval Set.

◆ Map_for_set_traits

template<template< class, class, class, class > class Map_template_t, Is_ordered_set_traits Set_traits_t, class Mapped_t = typename Set_traits_t::Element_t>
using mysql::sets::Map_for_set_traits = typedef Map_template_t< typename Set_traits_t::Element_t, Mapped_t, typename Set_traits_t::Less_t, mysql::allocators::Allocator< std::pair<const typename Set_traits_t::Element_t, Mapped_t> >>

Given a class template of the same shape as std::map (four class arguments for key, mapped, compare, and allocator), and an Ordered set traits class, provides the specialization with parameters derived from the set traits.

◆ Storage_or_void

template<class Container_t >
using mysql::sets::Storage_or_void = typedef detail::Storage_or_void_helper<Container_t>::Type

Type alias for Container_t::Storage_t if that exists, or void otherwise.

Enumeration Type Documentation

◆ Binary_operation

enum class mysql::sets::Binary_operation
strong

Identifies the type of a binary operation.

Enumerator
op_union 
op_intersection 
op_subtraction 

Function Documentation

◆ contains_element() [1/5]

template<Is_boundary_set Boundary_set_t>
constexpr bool mysql::sets::contains_element ( const Boundary_set_t &  set,
const typename Boundary_set_t::Element_t &  element 
)
constexpr

Return true if the element is contained in the Boundary set.

Complexity: The time of one invocation of set.upper_bound.

◆ contains_element() [2/5]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::contains_element ( const Interval< Set_traits_t > &  interval,
const typename Set_traits_t::Element_t &  element 
)
constexpr

Return true if the element is contained in the Interval.

Complexity: Constant.

◆ contains_element() [3/5]

template<Is_interval_set Interval_set_t>
constexpr bool mysql::sets::contains_element ( const Interval_set_t &  set,
const typename Interval_set_t::Element_t &  element 
)
constexpr

Return true if the element is contained in the Interval set.

Complexity: The time of one invocation of set.boundaries().upper_bound.

◆ contains_element() [4/5]

bool mysql::sets::contains_element ( const mysql::gtids::Is_gtid_set auto &  gtid_set,
const mysql::gtids::Is_gtid auto &  gtid 
)
noexcept

contains_element for Gtid_sets, accepting a Gtid for the element.

◆ contains_element() [5/5]

template<Is_nested_set Nested_set_t>
constexpr bool mysql::sets::contains_element ( const Nested_set_t &  set,
const typename Nested_set_t::Key_t &  key,
const auto &...  mapped 
)
constexpr

Return true if the value is contained in the Nested set.

◆ is_disjoint()

constexpr bool mysql::sets::is_disjoint ( const auto &  lhs,
const auto &  rhs 
)
constexpr

Return true if the two objects are disjoint (have nothing in common).

The objects may be intervals, boundary sets, or interval sets.

This just delegates work to is_intersecting, and is defined for any types for which is_intersecting is defined.

◆ is_equal()

template<Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t>
constexpr bool mysql::sets::is_equal ( const Set1_t &  set1,
const Set2_t &  set2 
)
constexpr

Return true if the two sets are equal, which must be of the same Set category and Set traits.

This is alternative syntax to operator==. If both the operands and the calling context are outside the mysql::sets namespace, name lookup will not find the operator. It can be qualified by the namespace using the syntax mysql::sets::operator==(a, b). We provide this equivalent alternative in case anyone thinks that looks funny, and also because the syntax is analogous to other set predicates such as is_subset etc.

◆ is_intersecting() [1/8]

template<Is_boundary_set Boundary_set1_t, Is_boundary_set Boundary_set2_t>
requires Is_compatible_set<Boundary_set1_t, Boundary_set2_t>
constexpr bool mysql::sets::is_intersecting ( const Boundary_set1_t &  set1,
const Boundary_set2_t &  set2 
)
constexpr

Return true if the two Boundary sets intersect (overlap).

Complexity: The number of iterations is linear in the size of the smallest set. Each iteration requires an invocation of upper_bound in both sets.

◆ is_intersecting() [2/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_intersecting ( const Interval< Set_traits_t > &  interval,
const Is_boundary_set_over_traits< Set_traits_t > auto &  set 
)
constexpr

Return true if the left Interval and the right Boundary set intersect (overlap).

Complexity: The time of one invocation of set.upper_bound.

◆ is_intersecting() [3/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_intersecting ( const Interval< Set_traits_t > &  interval,
const Is_interval_set_over_traits< Set_traits_t > auto &  set 
)
constexpr

Return true if the left Interval and the right Interval set intersect.

Complexity: The time of one invocation of set.upper_bound.

◆ is_intersecting() [4/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_intersecting ( const Interval< Set_traits_t > &  interval1,
const Interval< Set_traits_t > &  interval2 
)
constexpr

Return true if the two Interval objects intersect (overlap).

Complexity: Constant.

◆ is_intersecting() [5/8]

template<Is_interval_set Interval_set1_tp, Is_interval_set Interval_set2_tp>
requires Is_compatible_set<Interval_set1_tp, Interval_set2_tp>
constexpr bool mysql::sets::is_intersecting ( const Interval_set1_tp &  set1,
const Interval_set2_tp &  set2 
)
constexpr

Return true if the two Interval sets intersect (overlap).

Complexity: The number of iterations is linear in the size of the smallest set. Each iteration requires an invocation of upper_bound in both sets.

◆ is_intersecting() [6/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_intersecting ( const Is_boundary_set_over_traits< Set_traits_t > auto &  set,
const Interval< Set_traits_t > &  interval 
)
constexpr

Return true if the left Boundary set and the right Interval intersect (overlap).

Complexity: The time of one invocation of set.upper_bound.

◆ is_intersecting() [7/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_intersecting ( const Is_interval_set_over_traits< Set_traits_t > auto &  set,
const Interval< Set_traits_t > &  interval 
)
constexpr

Return true if the left Interval set and the right Interval intersect.

Complexity: The time of one invocation of set.upper_bound.

◆ is_intersecting() [8/8]

template<Is_nested_set Nested_set1_t, Is_nested_set Nested_set2_t>
requires Is_compatible_set<Nested_set1_t, Nested_set2_t>
constexpr bool mysql::sets::is_intersecting ( const Nested_set1_t &  set1,
const Nested_set2_t &  set2 
)
constexpr

Return true if the two Nested sets intersect (overlap).

◆ is_subset() [1/8]

template<Is_boundary_set Boundary_set1_t, Is_boundary_set Boundary_set2_t>
requires Is_compatible_set<Boundary_set1_t, Boundary_set2_t>
constexpr bool mysql::sets::is_subset ( const Boundary_set1_t &  set1,
const Boundary_set2_t &  set2 
)
constexpr

Return true if the left Boundary set is a subset of or equal to the right Boundary_set.

Complexity: The number of iterations is linear in the size of the smallest set. Each iteration requires an invocation of upper_bound in both sets.

◆ is_subset() [2/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_subset ( const Interval< Set_traits_t > &  interval1,
const Interval< Set_traits_t > &  interval2 
)
constexpr

Return true if the left Interval is a subset of or equal to the right Interval.

Complexity: Constant.

◆ is_subset() [3/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_subset ( const Interval< Set_traits_t > &  interval1,
const Is_boundary_set_over_traits< Set_traits_t > auto &  set2 
)
constexpr

Return true if the left Interval is a subset of or equal to the right Boundary_set.

Complexity: The time of one invocation of set2.upper_bound.

◆ is_subset() [4/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_subset ( const Interval< Set_traits_t > &  interval1,
const Is_interval_set_over_traits< Set_traits_t > auto &  set2 
)
constexpr

Return true if the left Interval is a subset of or equal to the right Interval set.

Complexity: The time of one invocation of set2.upper_bound.

◆ is_subset() [5/8]

template<Is_interval_set Interval_set1_tp, Is_interval_set Interval_set2_tp>
requires Is_compatible_set<Interval_set1_tp, Interval_set2_tp>
constexpr bool mysql::sets::is_subset ( const Interval_set1_tp &  set1,
const Interval_set2_tp &  set2 
)
constexpr

Return true if the left Interval set is a subset of or equal to the right Interval set.

Complexity: The number of iterations is linear in the size of the smallest set. Each iteration requires an invocation of upper_bound in both sets.

◆ is_subset() [6/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_subset ( const Is_boundary_set_over_traits< Set_traits_t > auto &  set1,
const Interval< Set_traits_t > &  interval2 
)
constexpr

Return true if the left Boundary set is a subset of or equal to the right Interval.

Complexity: Constant.

◆ is_subset() [7/8]

template<Is_bounded_set_traits Set_traits_t>
constexpr bool mysql::sets::is_subset ( const Is_interval_set_over_traits< Set_traits_t > auto &  set1,
const Interval< Set_traits_t > &  interval2 
)
constexpr

Return true if the left Interval set is a subset of or equal to the right Interval.

Complexity: Constant.

◆ is_subset() [8/8]

template<Is_nested_set Nested_set1_t, Is_nested_set Nested_set2_t>
requires Is_compatible_set<Nested_set1_t, Nested_set2_t>
constexpr bool mysql::sets::is_subset ( const Nested_set1_t &  set1,
const Nested_set2_t &  set2 
)
constexpr

Return true if the left Nested set is a subset of or equal to the right Nested_set.

◆ is_superset()

constexpr bool mysql::sets::is_superset ( const auto &  lhs,
const auto &  rhs 
)
constexpr

Return true if the left object is a superset of or equal to the right object.

This just delegates work to is_subset, and is defined for any types for which is_subset is defined.

◆ make_binary_operation_view()

template<Binary_operation binary_operation, class Source1_t , class Source2_t >
auto mysql::sets::make_binary_operation_view ( const Source1_t &  source1,
const Source2_t &  source2 
)

Return the Union_view, Intersection_view, or Subtraction_view over the arguments, according to the given Binary_operation.

Template Parameters
binary_operationType of operation.
Source1_tType of first operand.
Source2_tType of second operand.
Parameters
source1First operand.
source2Second operand.

◆ make_complement_view() [1/2]

template<class Source_t >
decltype(auto) mysql::sets::make_complement_view ( const Complement_view< Source_t > &  complement)

Make complement-of-complement return the original set.

Template Parameters
Source_tType of complemented source.
Parameters
complementSource.

◆ make_complement_view() [2/2]

template<class Source_t >
auto mysql::sets::make_complement_view ( const Source_t &  source)

Return the Complement_view over the argument.

Template Parameters
Source_tType of source.
Parameters
sourceSource.

◆ make_empty_set_view()

template<Is_set_category Set_category_t, Is_set_traits Set_traits_t>
auto & mysql::sets::make_empty_set_view ( )

Return a reference to a singleton object representing the view containing the empty set, for the given Set category and Set traits.

◆ make_empty_set_view_like()

template<Is_set Set_t>
auto & mysql::sets::make_empty_set_view_like ( )

Return the result of make_empty_set_view for the set category and set traits of the given set type.

◆ make_full_set_view()

template<Is_set_category Set_category_t, Is_bounded_set_traits Set_traits_t>
auto & mysql::sets::make_full_set_view ( )

Return a reference to a singleton object representing the view containing the empty set, for the given Set category and Set traits.

◆ make_full_set_view_like()

template<Is_set Set_t>
auto & mysql::sets::make_full_set_view_like ( )

Return the result of make_full_set_view for the set category and set traits of the given set type.

◆ make_intersection_view()

template<class Source1_t , class Source2_t >
auto mysql::sets::make_intersection_view ( const Source1_t &  source1,
const Source2_t &  source2 
)

Return the Intersection_view over the arguments.

Template Parameters
Source1_tType of first operand.
Source2_tType of second operand.
Parameters
source1First operand.
source2Second operand.

◆ make_interval_set_view()

template<Is_boundary_set Boundary_set_t>
auto mysql::sets::make_interval_set_view ( const Boundary_set_t &  boundary_set)

◆ make_subtraction_view()

template<class Source1_t , class Source2_t >
auto mysql::sets::make_subtraction_view ( const Source1_t &  source1,
const Source2_t &  source2 
)

Return the Subtraction_view over the arguments.

Template Parameters
Source1_tType of first operand.
Source2_tType of second operand.
Parameters
source1First operand.
source2Second operand.

◆ make_union_view()

template<class Source1_t , class Source2_t >
auto mysql::sets::make_union_view ( const Source1_t &  source1,
const Source2_t &  source2 
)

Return the Union_view over the arguments.

Template Parameters
Source1_tType of first operand.
Source2_tType of second operand.
Parameters
source1First operand.
source2Second operand.

◆ operator!=()

template<Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t>
constexpr bool mysql::sets::operator!= ( const Set1_t &  set1,
const Set2_t &  set2 
)
constexpr

Return true if the two sets are not equal.

◆ operator==() [1/2]

template<Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t> && Is_iterator_defined_set<Set1_t>
constexpr bool mysql::sets::operator== ( const Set1_t &  set1,
const Set2_t &  set2 
)
constexpr

Return true if two sets are equal, which must be of the same Set category and Set traits and be iterator-defined.

See Is_iterator_defined_set for details.

Complexity: the number of value comparisons is linear in the size of the smallest set.

◆ operator==() [2/2]

template<class Key_t , Is_set Mapped1_t, Is_set Mapped2_t>
requires (Is_compatible_set<Mapped1_t, Mapped2_t> && !std::same_as<Mapped1_t, Mapped2_t>)
constexpr bool mysql::sets::operator== ( const std::pair< const Key_t, Mapped1_t > &  left,
const std::pair< const Key_t, Mapped2_t > &  right 
)
constexpr

Return true if the two pairs are equal, for pairs in which the second components have different types but the same set category and traits.

Thus, when two nested sets with the same traits (but possibly different types) are compared, it will run the algorithm in common_predicates.h in the outer set; in each iteration invoke this

◆ volume() [1/4]

template<Is_boundary_set Boundary_set_t>
requires Is_metric_set_traits<typename Boundary_set_t::Set_traits_t>
constexpr auto mysql::sets::volume ( const Boundary_set_t &  set)
constexpr

Return the sum of the lengths of all intervals in the given Boundary set.

◆ volume() [2/4]

template<Is_metric_set_traits Set_traits_t>
constexpr auto mysql::sets::volume ( const Interval< Set_traits_t > &  interval)
constexpr

Return the length of the given interval.

◆ volume() [3/4]

template<Is_interval_set Interval_set_t>
requires Is_metric_set_traits<typename Interval_set_t::Set_traits_t>
constexpr auto mysql::sets::volume ( const Interval_set_t &  set)
constexpr

Return the sum of the lengths of all intervals in the given Interval set.

◆ volume() [4/4]

template<class Result_t = double, Is_nested_set Nested_set_t>
Result_t mysql::sets::volume ( const Nested_set_t &  set)

Return the volume of a nested set.

Template Parameters
Result_tType of return value. Default is double. The result will be exact if it is at most mysql::math::max_exact_int<double>.
Nested_set_tType of nested set set.
Parameters
setSet.

◆ volume_difference()

template<class Result_t = double, Is_set Set1_t, Is_set Set2_t>
requires Is_compatible_set<Set1_t, Set2_t>
Result_t mysql::sets::volume_difference ( const Set1_t &  set1,
const Set2_t &  set2 
)

Return the volume of the first set minus the volume of the second set.

Return the volume of the first nested set minus the volume of the second nested set.

This is the default implementation. The result is accurate for set types whose volumes can be represented without loss of precision in the return type from volume, i.e., typically set types whose volume does not exceed std::numeric_limits<uint64_t>::max(). Other set types should override this function to avoid precision loss for large sets of almost the same size.

Template Parameters
Result_tType of return value. Default is double. The result will be exact if it is at most mysql::math::max_exact_int<double>.
Set1_tType of first set.
Set2_tType of second set.
Parameters
set1First set.
set2Second set.
Template Parameters
Result_tType of return value. Default is double. The result will be exact if it is at most mysql::math::max_exact_int<double>.
Set1_tType of first set.
Set2_tType of second set.

param set1 First set.

param set2 Second set.

Variable Documentation

◆ is_iterator_defined_set_category

template<Is_set_category >
constexpr bool mysql::sets::is_iterator_defined_set_category = false
inlineconstexpr

Primary variable template for customization point that declares that a set category is iterator-defined.

See Is_iterator_defined_set for details.

To declare that a set category T is iterator-defined, specialize this like:

template <>
inline constexpr bool is_iterator_defined_set_category<T> = true;

◆ is_iterator_defined_set_category< Boundary_set_category_tag >

template<>
constexpr bool mysql::sets::is_iterator_defined_set_category< Boundary_set_category_tag > = true
inlineconstexpr

Declare that Boundary sets are iterator-defined.

See Is_iterator_defined_set for details.

◆ is_iterator_defined_set_category< Interval_set_category_tag >

template<>
constexpr bool mysql::sets::is_iterator_defined_set_category< Interval_set_category_tag > = true
inlineconstexpr

Declare that Interval sets are iterator-defined.

See Is_iterator_defined_set for details.

◆ is_iterator_defined_set_category< Nested_set_category_tag >

template<>
constexpr bool mysql::sets::is_iterator_defined_set_category< Nested_set_category_tag > = true
inlineconstexpr

Declare that Nested sets are iterator-defined.

See Is_iterator_defined_set for details.