![]() |
MySQL 9.6.0
Source Code Documentation
|
Non-throwing container that stores boundaries. More...
#include <nonthrowing_boundary_container_adaptor.h>
Public Member Functions | |
| Nonthrowing_boundary_container_adaptor () noexcept=default | |
| Default constructor. More... | |
| Nonthrowing_boundary_container_adaptor (const This_t &other)=delete | |
| Nonthrowing_boundary_container_adaptor (This_t &&other) noexcept=default | |
| This_t & | operator= (const This_t &other)=delete |
| This_t & | operator= (This_t &&other) noexcept=default |
| ~Nonthrowing_boundary_container_adaptor () noexcept=default | |
| Nonthrowing_boundary_container_adaptor (const Memory_resource_t &memory_resource) noexcept | |
| Construct using the given Memory_resource. More... | |
| auto & | throwing () noexcept |
| Return a non-const reference to the underlying, throwing boundary container. More... | |
| const auto & | throwing () const noexcept |
| Return a const reference to the underlying, throwing boundary container. More... | |
| auto & | storage () noexcept |
| Return a non-const reference to the underlying storage. More... | |
| const auto & | storage () const noexcept |
| Return a const reference to the underlying storage. More... | |
| auto | insert (const Element_t &element) noexcept |
| Insert the given element (inplace union). More... | |
| auto | remove (const Element_t &element) noexcept |
| Remove the given element (inplace subtraction). More... | |
| auto | inplace_union (const Element_t &start, const Element_t &exclusive_end) noexcept |
| Insert the given interval (inplace union). More... | |
| auto | inplace_union (Iterator_t &cursor, const Element_t &start, const Element_t &exclusive_end) noexcept |
| Insert the given interval (inplace union), reading and updating the given cursor. More... | |
| template<Is_boundary_set_over_traits_unqualified< Set_traits_t > Input_set_t> | |
| auto | inplace_union (Input_set_t &&input_set) noexcept |
| In-place insert the intervals of the given set into this container (inplace union). More... | |
| auto | inplace_subtract (const Element_t &start, const Element_t &exclusive_end) noexcept |
| Subtract the given interval. More... | |
| auto | inplace_subtract (Iterator_t &cursor, const Element_t &start, const Element_t &exclusive_end) noexcept |
| Subtract the given interval, reading and updating the given cursor. More... | |
| template<Is_boundary_set_over_traits_unqualified< Set_traits_t > Input_set_t> | |
| auto | inplace_subtract (Input_set_t &&input_set) noexcept |
| In-place subtract intervals of the given container from this container. More... | |
| auto | inplace_intersect (const Element_t &start, const Element_t &exclusive_end) noexcept |
| In-place intersect this container with the given interval. More... | |
| template<Is_boundary_set_over_traits_unqualified< Set_traits_t > Input_set_t> | |
| auto | inplace_intersect (Input_set_t &&input_set) noexcept |
| In-place intersect this container with intervals of the given container. More... | |
Public Member Functions inherited from mysql::sets::Basic_boundary_container_wrapper< Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >, Throwing_boundary_container_tp, mysql::utils::Shall_catch::yes > | |
| Basic_boundary_container_wrapper (Args_t &&...args) | |
| Basic_boundary_container_wrapper (const Basic_boundary_container_wrapper &source)=default | |
| Basic_boundary_container_wrapper (Basic_boundary_container_wrapper &&source) noexcept=default | |
| Basic_boundary_container_wrapper & | operator= (const Basic_boundary_container_wrapper &source)=default |
| Basic_boundary_container_wrapper & | operator= (Basic_boundary_container_wrapper &&source) noexcept=default |
| ~Basic_boundary_container_wrapper ()=default | |
Public Member Functions inherited from mysql::sets::Basic_set_container_wrapper< Self_tp, Wrapped_tp, shall_catch_tp > | |
| template<class... Args_t> | |
| Basic_set_container_wrapper (Args_t &&...args) | |
| template<class Source_t > requires Can_donate_set<decltype(std::declval<Source_t &&>().wrapped()), Wrapped_tp> | |
| void | assign (Source_t &&source) |
| Enable move-assign from any Basic_set_container_wrapper for a compatible set type (not necessarily for a derived class). More... | |
| template<std::input_iterator First_iterator_t, std::sentinel_for< First_iterator_t > Sentinel_t> requires requires(Wrapped_t w, First_iterator_t f, Sentinel_t s) { w.assign(f, s); } | |
| auto | assign (const First_iterator_t &first, const Sentinel_t &last) noexcept(shall_catch==mysql::utils::Shall_catch::yes||noexcept(std::declval< Wrapped_t >().assign(first, last))) |
| Assign a range defined by the two iterators to the wrapped object. More... | |
| template<class Other_t > | |
| auto | assign (const Other_t &other) noexcept(shall_catch==mysql::utils::Shall_catch::yes||noexcept(std::declval< Self_t >().assign(other.begin(), other.end()))) |
| Copy-assign the other object to the wrapped object. More... | |
| void | assign (Self_t &&other) noexcept |
| Move-assign the other object to the wrapped object. More... | |
Public Member Functions inherited from mysql::containers::Basic_container_wrapper< Self_tp, Wrapped_tp, mysql::utils::Shall_catch::no > | |
| Basic_container_wrapper (Args_t &&...args) noexcept(noexcept(Wrapped_t(std::forward< Args_t >(args)...))) | |
| Constructor that delegates all parameters to the constructor of the wrapped class. More... | |
| auto | assign (const First_iterator_t &first, const Sentinel_t &last) noexcept(shall_catch==mysql::utils::Shall_catch::yes||noexcept(std::declval< Wrapped_t >().assign(first, last))) |
| Assign a range defined by the two iterators to the wrapped object. More... | |
| auto | assign (const Other_t &other) noexcept(shall_catch==mysql::utils::Shall_catch::yes||noexcept(std::declval< Self_t >().assign(other.begin(), other.end()))) |
| Copy-assign the other object to the wrapped object. More... | |
| void | assign (Self_t &&other) noexcept |
| Move-assign the other object to the wrapped object. More... | |
| void | clear () noexcept |
| Clear the wrapped object. More... | |
| auto | get_memory_resource () const noexcept |
| Return the memory resource used by the wrapped object. More... | |
| auto | get_allocator () const noexcept |
| Return the allocator used by the wrapped object. More... | |
| auto | begin () noexcept |
| auto | begin () const noexcept |
| auto | end () noexcept |
| auto | end () const noexcept |
| auto | empty () const noexcept |
| auto | size () const noexcept |
Public Member Functions inherited from mysql::ranges::Collection_interface< Self_tp > | |
| constexpr auto | cbegin () const |
| Return constant iterator to the beginning. More... | |
| constexpr auto | cend () const |
| Return constant iterator to the end. More... | |
| constexpr auto | rbegin () |
| Return reverse iterator to the beginning. More... | |
| constexpr auto | rend () |
| Return reverse iterator to the end. More... | |
| constexpr auto | rbegin () const |
| Return const reverse iterator to the beginning. More... | |
| constexpr auto | rend () const |
| Return const reverse iterator to the end. More... | |
| constexpr auto | crbegin () const |
| Return const reverse iterator to the beginning. More... | |
| constexpr auto | crend () const |
| Return const reverse iterator to the end. More... | |
| constexpr bool | empty () const |
| Return true if the range is empty, i.e., begin() == end(). More... | |
| constexpr | operator bool () const |
| Return true if the range is non-empty, i.e., begin() != end(). More... | |
| constexpr bool | operator! () const |
| Return true if the range is empty, i.e., begin() == end(). More... | |
| constexpr auto | size () const |
| Return the number of elements in this view, unsigned (size_t), by computing std::ranges::distance(begin, end) More... | |
| constexpr auto | ssize () const |
| Return the number of elements in this view, signed (ptrdiff_t). More... | |
| constexpr decltype(auto) | front () const |
| Return the first element. More... | |
| constexpr decltype(auto) | back () const |
| Return the last element. Enabled if we have bidirectional iterators. More... | |
| constexpr decltype(auto) | operator[] (std::ptrdiff_t n) |
| Return the n'th element, possibly mutable. More... | |
| constexpr decltype(auto) | operator[] (std::ptrdiff_t n) const |
| Return the n'th element, const. More... | |
| constexpr auto * | data () |
| Return pointer to underlying contiguous memory. More... | |
| constexpr auto * | data () const |
| Return const pointer to underlying contiguous memory. More... | |
Public Member Functions inherited from mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_get_value > | |
| constexpr Iterator_t | lower_bound (const Iterator_t &hint, const Element_t &element) |
Return the lower bound for element, using an iterator hint known to be less than or equal to the correct result. More... | |
| constexpr Const_iterator_t | lower_bound (const Const_iterator_t &hint, const Element_t &element) const |
Return the lower bound for element, using an iterator hint known to be less than or equal to the correct result. More... | |
| constexpr Iterator_t | lower_bound (const Element_t &element) |
Return the lower bound for element. More... | |
| constexpr Const_iterator_t | lower_bound (const Element_t &element) const |
Return the lower bound for element. More... | |
| constexpr Iterator_t | upper_bound (const Iterator_t &hint, const Element_t &element) |
Return the upper bound for element, using an iterator hint known to be less than or equal to the correct result. More... | |
| constexpr Const_iterator_t | upper_bound (const Const_iterator_t &hint, const Element_t &element) const |
Return the upper bound for element, using an iterator hint known to be less than or equal to the correct result. More... | |
| constexpr Iterator_t | upper_bound (const Element_t &element) |
Return the upper bound for element. More... | |
| constexpr Const_iterator_t | upper_bound (const Element_t &element) const |
Return the upper bound for element. More... | |
Static Public Member Functions | |
| static auto | upper_bound_impl (mysql::meta::Is_same_ignore_const< This_t > auto &self, const auto &cursor, const Element_t &element) noexcept |
Return iterator to the leftmost boundary at or after cursor that is greater than the given element. More... | |
| static auto | lower_bound_impl (mysql::meta::Is_same_ignore_const< This_t > auto &self, const auto &cursor, const Element_t &element) noexcept |
Return iterator to the leftmost boundary at or after cursor that is greater than or equal to the given element. More... | |
Static Public Member Functions inherited from mysql::sets::Upper_lower_bound_interface< Self_tp, Set_traits_tp, Iterator_tp, Const_iterator_tp, Iterator_get_value > | |
| static constexpr Iter_t | lower_bound_dispatch (Self_arg_t &self_arg, const Iter_t &hint, const Element_t &element) |
| Implements the lower_bound functions with hint defined above, checking if the hint is already the correct answer, and otherwise delegating to the implementing class. More... | |
| static constexpr auto | lower_bound_dispatch (Self_arg_t &self_arg, const Element_t &element) |
| Implements the lower_bound functions without hint defined above. More... | |
| static constexpr Iter_t | upper_bound_dispatch (Self_arg_t &self_arg, const Iter_t &hint, const Element_t &element) |
| Implements the upper_bound functions with hint defined above, checking if the hint is already the correct answer, and otherwise delegating to the implementing class. More... | |
| static constexpr auto | upper_bound_dispatch (Self_arg_t &self_arg, const Element_t &element) |
| Implements the upper_bound functions without hint defined above. More... | |
Static Public Attributes | |
| static constexpr bool | has_fast_insertion |
Additional Inherited Members | |
Protected Member Functions inherited from mysql::containers::Basic_container_wrapper< Self_tp, Wrapped_tp, mysql::utils::Shall_catch::no > | |
| auto & | wrapped () &noexcept |
| const auto & | wrapped () const &noexcept |
| auto && | wrapped () &&noexcept |
Non-throwing container that stores boundaries.
This implements the Is_boundary_set concept, and additionally has functionality for in-place union, intersection, and subtraction, as well as copy from another Boundary_set and making this container empty.
This is only wrappers around throwing::Boundary_container.
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Allocator_t = typename Throwing_boundary_container_t::Allocator_t |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Base_t = Basic_boundary_container_wrapper< Nonthrowing_boundary_container_adaptor<Throwing_boundary_container_tp>, Throwing_boundary_container_tp, mysql::utils::Shall_catch::yes> |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Const_iterator_t = mysql::ranges::Range_const_iterator_type<Throwing_boundary_container_t> |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Element_t = Set_traits_t::Element_t |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Iterator_t = mysql::ranges::Range_iterator_type<Throwing_boundary_container_t> |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Memory_resource_t = mysql::allocators::Memory_resource |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Set_traits_t = Throwing_boundary_container_t::Set_traits_t |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Storage_t = Throwing_boundary_container_t::Storage_t |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::This_t = Nonthrowing_boundary_container_adaptor<Throwing_boundary_container_t> |
| using mysql::sets::Nonthrowing_boundary_container_adaptor< Throwing_boundary_container_tp >::Throwing_boundary_container_t = Throwing_boundary_container_tp |
|
defaultnoexcept |
Default constructor.
|
delete |
|
defaultnoexcept |
|
defaultnoexcept |
|
inlineexplicitnoexcept |
Construct using the given Memory_resource.
|
inlinenoexcept |
In-place intersect this container with the given interval.
This may truncate intervals that overlap partially with the given interval, and remove intervals that are disjoint from the given interval.
| start | The left boundary of the interval, inclusive. |
| exclusive_end | The right boundary of the interval, exclusive. |
If the underlying boundary container cannot throw, this returns void. Otherwise, retursn Return_status::ok on success and Return_status::error on out-of-memory error.
|
inlinenoexcept |
In-place intersect this container with intervals of the given container.
This may truncate intervals that overlap partially with one interval from the given set, split intervals that overlap partially with more than one interval from the given set, and remove intervals that are disjoint from the given interval set.
Algorithm and complexity:
| input_set | The input set. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while splitting an interval. This may occur when the operation is half-completed, which may leave the container as a subset of the previous set and a superset of the intersection. |
|
inlinenoexcept |
Subtract the given interval.
This may split an interval into two parts, shorten an existing interval in one end, remove a one-element interval, or, if the element was not in this container, do nothing.
This may truncate and/or split intervals that overlap partially with the subtracted interval, and remove intervals that overlap completely with the subtracted interval.
| start | The left boundary of the interval, inclusive. |
| exclusive_end | The right boundary of the interval, exclusive. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while splitting an interval. This leaves the container unmodified. |
|
inlinenoexcept |
In-place subtract intervals of the given container from this container.
This may truncate and/or split intervals that overlap partially with subtracted intervals, and remove intervals that overlap completely with subtracted intervals.
Algorithm and complexity:
| input_set | The input set. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while splitting an interval. This may occur when the operation is half-completed, which may leave the container as a subset of the previous set and a superset of the difference. |
|
inlinenoexcept |
Subtract the given interval, reading and updating the given cursor.
This may truncate and/or split intervals that overlap partially with the subtracted interval, and remove intervals that overlap completely with the subtracted interval.
| [in,out] | cursor | Hint for the insertion position. If it refers to lower_bound(start), this function finds the insertion position in O(1); if it refers to a boundary less than lower_bound(start), it may reduce the search space when finding the insertion position; otherwise, the hint is ignored and the entire set has to be searched. It will be updated to upper_bound(exclusive_end), which makes it perfect to reuse for future calls to this function, with intervals following this one. |
| start | The left boundary of the interval, inclusive. | |
| exclusive_end | The right boundary of the interval, exclusive. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while splitting an interval. This leaves the container unmodified. |
|
inlinenoexcept |
Insert the given interval (inplace union).
This may merge intervals that overlap or are adjacent to the given interval, or insert the interval between existing intervals, or, if the interval was a subset of this container, do nothing.
| start | The left boundary of the interval, inclusive. |
| exclusive_end | The right boundary of the interval, exclusive. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while inserting the interval. This leaves the container unmodified. |
|
inlinenoexcept |
In-place insert the intervals of the given set into this container (inplace union).
This may merge intervals that overlap or are adjacent to a given interval, and/or insert intervals between existing intervals, or, if the set was a subset of this container, do nothing.
This uses one of two algorithms, depending on the nature of the underlying container:
The complexity depends on the underlying container:
| input_set | The input set. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while inserting an interval. This may occur when the operation is half-completed, which may leave the container as a superset of the previous set and a subset of the union. |
|
inlinenoexcept |
Insert the given interval (inplace union), reading and updating the given cursor.
This may merge intervals that overlap or are adjacent to the given interval, or insert the interval between existing intervals, or, if the interval was a subset of this container, do nothing.
| [in,out] | cursor | Hint for the insertion position. If it refers to lower_bound(start), this function finds the insertion position in O(1); if it refers to a boundary less than lower_bound(start), it may reduce the search space when finding the insertion position; otherwise, the hint is ignored and the entire set has to be searched. It will be updated to upper_bound(exclusive_end), which makes it perfect to reuse for future calls to this function, with intervals following this one. |
| start | The left boundary of the interval, inclusive. | |
| exclusive_end | The right boundary of the interval, exclusive. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while inserting the interval. This leaves the container unmodified. |
|
inlinenoexcept |
Insert the given element (inplace union).
This may insert a new one-element interval, extend an existing interval at one end, merge two intervals that were separated by only the given element, or, if the element was already in this container, do nothing.
| element | The element to insert. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while inserting the interval. This leaves the container unmodified. |
|
inlinestaticnoexcept |
Return iterator to the leftmost boundary at or after cursor that is greater than or equal to the given element.
|
delete |
|
defaultnoexcept |
|
inlinenoexcept |
Remove the given element (inplace subtraction).
This may split an interval into two parts, shorten an existing interval in one end, remove a one-element interval, or, if the element was not in this container, do nothing.
| element | The element to remove. |
| Return_status::ok | Success |
| Return_status::error | An out-of-memory condition occurred while splitting an interval. This leaves the container unmodified. |
|
inlinenoexcept |
Return a const reference to the underlying storage.
|
inlinenoexcept |
Return a non-const reference to the underlying storage.
|
inlinenoexcept |
Return a const reference to the underlying, throwing boundary container.
|
inlinenoexcept |
Return a non-const reference to the underlying, throwing boundary container.
|
inlinestaticnoexcept |
Return iterator to the leftmost boundary at or after cursor that is greater than the given element.
|
staticconstexpr |