24#ifndef MYSQL_SETS_STRCONV_ENCODE_H
25#define MYSQL_SETS_STRCONV_ENCODE_H
59template <mysql::sets::Is_discrete_set_traits Set_traits_t>
61 Is_string_target
auto &target,
66 Set_traits_t::prev(
interval.exclusive_end()));
82template <mysql::sets::Is_boundary_set Boundary_set_t>
84 typename Boundary_set_t::Set_traits_t>
86 Is_string_target
auto &target,
87 const Boundary_set_t &boundary_set) {
124template <mysql::sets::Is_boundary_set Boundary_set_t>
126 typename Boundary_set_t::Set_traits_t>
128 Is_string_target
auto &target,
129 const Boundary_set_t &boundary_set) {
130 using Set_traits_t = Boundary_set_t::Set_traits_t;
131 auto size = boundary_set.size();
132 auto next_min = Set_traits_t::min();
133 auto it = boundary_set.begin();
135 if (it != boundary_set.end() && *it == next_min) {
139 next_min = Set_traits_t::next(next_min);
143 for (; it != boundary_set.end(); ++it) {
146 next_min = Set_traits_t::next(boundary);
166template <mysql::sets::Is_boundary_set Boundary_set_t>
168 typename Boundary_set_t::Set_traits_t>
170 Is_string_target
auto &target,
171 const Boundary_set_t &boundary_set) {
172 target.write(
format, boundary_set.size() / 2);
173 for (
auto boundary : boundary_set) {
174 target.write(
format, boundary);
188 const Is_format
auto &
format, Is_string_target
auto &target,
190 target.write(
format, interval_set.boundaries());
207 Is_string_target
auto &target,
210 for (
auto &&pair : nested_set) {
214 target.write_raw(
format.m_item_separator);
215 target.write(
format.m_key_format, pair.first);
217 assert(!pair.second.empty());
218 target.write(
format.m_mapped_format, pair.second);
229template <mysql::sets::Is_bounded_set_traits Set_traits_t>
238template <mysql::sets::Is_boundary_set Boundary_set_t>
241 const Boundary_set_t &boundary_set) {
247template <mysql::sets::Is_boundary_set Boundary_set_t>
250 const Boundary_set_t &boundary_set) {
257template <mysql::sets::Is_boundary_set Boundary_set_t>
259 typename Boundary_set_t::Set_traits_t>
261 const Boundary_set_t &boundary_set) {
Holds the start boundary and endpoint boundary of an interval.
Definition: interval.h:178
True if Test is a "bounded" Set traits class.
Definition: set_traits.h:105
True if Test satisfies both Is_discrete_set_traits and Is_metric_set_traits.
Definition: set_traits.h:151
True if Test is a "discrete" Set traits class, i.e., it bounded, and it is possible to compute succes...
Definition: set_traits.h:119
Definition: interval_set_meta.h:75
True if Test is a nested set.
Definition: nested_set_meta.h:110
Definition: nested_set_text_format.h:68
Concept that holds for String_counter and String_writer.
Definition: string_target.h:111
static int interval
Definition: mysqladmin.cc:72
Type sub(Shards< COUNT > &shards, size_t id, size_t n)
Decrement the counter for a shard by n.
Definition: ut0counter.h:280
void boundary_set_to_text(const Is_format auto &format, Is_string_target auto &target, const Boundary_set_t &boundary_set)
Write a Boundary_set in text format to the given Is_string_target.
Definition: encode.h:85
void interval_to_text(const Is_format auto &format, Is_string_target auto &target, const mysql::sets::Interval< Set_traits_t > &interval)
Write an Interval in text format to the given Is_string_target.
Definition: encode.h:60
void boundary_set_to_binary_fixint(const Is_format auto &format, Is_string_target auto &target, const Boundary_set_t &boundary_set)
Write boundary sets in binary format with fixed-width integers to the given Is_string_target.
Definition: encode.h:169
void nested_set_to_text(const mysql::strconv::Is_nested_set_text_format auto &format, Is_string_target auto &target, const mysql::sets::Is_nested_set auto &nested_set)
Write a nested set to the given Is_string_target.
Definition: encode.h:205
void boundary_set_to_binary(const Is_format auto &format, Is_string_target auto &target, const Boundary_set_t &boundary_set)
Write a boundary set in a space-efficient binary format that uses variable-length integers,...
Definition: encode.h:127
void encode_interval_set(const Is_format auto &format, Is_string_target auto &target, const mysql::sets::Is_interval_set auto &interval_set)
Write an interval set to the given Is_string_target.
Definition: encode.h:187
auto make_interval_set_view(const Boundary_set_t &boundary_set)
Definition: interval_set_interface.h:150
Definition: gtid_binary_format.h:41
void encode_impl(const Gtid_binary_format &format, Is_string_target auto &target, const mysql::gtids::Is_tag auto &tag)
Definition: gtid_binary_format_conv.h:48
size_t size(const char *const c)
Definition: base64.h:46
Tag to identify the formatting algorithm for boundary sets of integrals, and provide the separator st...
Definition: boundary_set_text_format.h:51