24#ifndef MYSQL_STRCONV_DECODE_PARSE_OPTIONS_H
25#define MYSQL_STRCONV_DECODE_PARSE_OPTIONS_H
64template <
class Tuple_t>
66 mysql::utils::Tuple_matching_element_type_count<Tuple_t, Is_format_pred>;
69template <
class Tuple_t>
71 mysql::utils::Tuple_matching_element_type_count<Tuple_t, Is_repeat_pred>;
74template <
class Tuple_t>
76 mysql::utils::Tuple_matching_element_type_count<Tuple_t, Is_checker_pred>;
81 (Format_count<Tuple> <= 1) && (Repeat_count<Tuple> <= 1) &&
82 (Checker_count<Tuple> <= 1) &&
84 (Format_count<Tuple> + Repeat_count<Tuple> + Checker_count<Tuple> ==
85 std::tuple_size_v<Tuple>);
93template <detail::Is_compound_parse_options_tuple Tuple_tp>
97 static constexpr bool has_format = detail::Format_count<Tuple_t> > 0;
98 static constexpr bool has_repeat = detail::Repeat_count<Tuple_t> > 0;
99 static constexpr bool has_checker = detail::Checker_count<Tuple_t> > 0;
105 std::type_identity<Text_format>>
::type;
109template <
class... Args_t>
146 {
get_repeat(opt) } -> std::same_as<Repeat_optional>;
154template <Is_compound_parse_options Compound_parse_options_t>
155 requires Compound_parse_options_t::has_format
157 return mysql::utils::tuple_find<detail::Is_format_pred>(opt.m_tuple);
164template <Is_compound_parse_options Compound_parse_options_t>
165 requires Compound_parse_options_t::has_repeat
167 return mysql::utils::tuple_find<detail::Is_repeat_pred>(opt.m_tuple);
174template <Is_compound_parse_options Compound_parse_options_t>
175 requires Compound_parse_options_t::has_checker
178 mysql::utils::tuple_find<detail::Is_checker_pred>(opt.m_tuple));
190template <Is_format Format_t>
194template <Is_repeat Repeat_t>
198template <Is_checker Checker_t>
209template <Is_parse_options Opt1, Is_parse_options Opt2>
Represents a range of integers specifying the number of times a token or pattern should be repeated w...
Definition: repeat.h:119
True for all Checker specializations.
Definition: checker.h:78
True if Test is a Compound_parse_options object with at most one Format element, at most one Repeat e...
Definition: parse_options.h:120
True for any kind of parse options: Format, Repeat, Checker, or Compound_parse_options.
Definition: parse_options.h:133
True for any kind of parse options for which get_repeat() returns Repeat_optional,...
Definition: parse_options.h:143
True for any kind of parse options: Format, Repeat, Checker, or Compound_parse_options.
Definition: parse_options.h:126
True if Test is either Repeat or Repeat_optional.
Definition: repeat.h:180
Definition: parse_options.h:79
Definition: fts0fts.cc:236
constexpr std::size_t Repeat_count
The number of elements in a Compound_parse_options of Repeat type.
Definition: parse_options.h:70
auto make_compound_parse_options()
Given any form of parse options; Format, Repeat, Checker, or Compound_parse_options; return a Compoun...
Definition: parse_options.h:187
constexpr std::size_t Format_count
The number of elements in a Compound_parse_options of Format type.
Definition: parse_options.h:65
constexpr std::size_t Checker_count
The number of element in a Compound_parse_options of Checker type.
Definition: parse_options.h:75
Definition: gtid_binary_format.h:41
void invoke_checker(const Is_parse_options auto &)
Invoke the Checker member of any parse options, if it exists; otherwise do nothing.
Definition: parse_options.h:172
Compound_parse_options(std::tuple< Args_t... >) -> Compound_parse_options< std::tuple< Args_t... > >
Deduction guide.
auto get_repeat(const Is_parse_options auto &)
Return the Repeat component of any parse options, if it exists; otherwise a default-constructed Repea...
Definition: parse_options.h:162
auto get_format(const Is_parse_options auto &)
Return the Format component of any parse options that has one.
Definition: parse_options.h:152
auto operator|(const Opt1 &opt1, const Opt2 &opt2)
Combine two Parse Options objects into one.
Definition: parse_options.h:210
required string type
Definition: replication_group_member_actions.proto:34
Represents parse options consisting of a tuple where each of the following elements occurs optionally...
Definition: parse_options.h:94
static constexpr bool has_repeat
Definition: parse_options.h:98
Tuple_tp Tuple_t
Definition: parse_options.h:95
std::conditional_t< has_format, mysql::utils::Tuple_find_helper< Tuple_t, detail::Is_format_pred >, std::type_identity< Text_format > >::type Format_t
Definition: parse_options.h:105
static constexpr bool has_format
Definition: parse_options.h:97
Tuple_t m_tuple
Definition: parse_options.h:96
static constexpr bool has_checker
Definition: parse_options.h:99
Format tag to identify text format.
Definition: text_format.h:38
Class template parameterized by an object type, holding a member class template, which is a type pred...
Definition: parse_options.h:61
Type predicate with a member constant value that is true if Test is Repeat.
Definition: parse_options.h:55
Primary template for helper struct used to define Tuple_find_index.
Definition: tuple_find.h:43