26#ifndef MYSQL_HARNESS_SESSION_CONFIG_EXPOSER_INCLUDED
27#define MYSQL_HARNESS_SESSION_CONFIG_EXPOSER_INCLUDED
34#include "harness_export.h"
51 enum class Mode { ExposeInitialConfig, ExposeDefaultConfig };
65 : mode_(initial ?
Mode::ExposeInitialConfig :
Mode::ExposeDefaultConfig),
66 default_section_(default_section),
67 section_id_(section_id) {}
95 void expose_option(std::string_view option,
const OptionValue &value,
96 const OptionValue &default_value,
bool is_common =
false);
109 void expose_option(std::string_view option,
const OptionValue &value,
110 const OptionValue &default_value_cluster,
111 const OptionValue &default_value_clusterset,
115 void expose_str_option(std::string_view option,
const OptionValue &value,
116 const OptionValue &default_value_cluster,
117 const OptionValue &default_value_clusterset,
118 bool is_common =
false);
120 void expose_int_option(std::string_view option,
const OptionValue &value,
121 const OptionValue &default_value_cluster,
122 const OptionValue &default_value_clusterset,
123 bool is_common =
false);
125 void expose_double_option(std::string_view option,
const OptionValue &value,
126 const OptionValue &default_value_cluster,
127 const OptionValue &default_value_clusterset,
128 bool is_common =
false);
130 void expose_bool_option(std::string_view option,
const OptionValue &value,
131 const OptionValue &default_value_cluster,
132 const OptionValue &default_value_clusterset,
133 bool is_common =
false);
136 const auto &default_value_cluster,
137 const auto &default_value_clusterset,
bool is_common) {
138 DC::instance().set_option_default(
139 section_id_, option, default_value_cluster, default_value_clusterset);
141 DC::instance().set_option_default(common_section_id_, option,
142 default_value_cluster,
143 default_value_clusterset);
Configuration section.
Definition: config_parser.h:141
Respresents the current Router configuration.
Definition: dynamic_config.h:48
std::variant< std::monostate, int64_t, bool, double, std::string > OptionValue
Definition: dynamic_config.h:53
std::pair< std::string, std::string > SectionId
Definition: dynamic_config.h:62
Base class for a plugin specific specializations.
Definition: section_config_exposer.h:45
const mysql_harness::ConfigSection & default_section_
Definition: section_config_exposer.h:80
SectionConfigExposer(const SectionConfigExposer &)=delete
const DC::SectionId section_id_
Definition: section_config_exposer.h:82
const Mode mode_
Definition: section_config_exposer.h:79
SectionConfigExposer(bool initial, const mysql_harness::ConfigSection &default_section, const DC::SectionId §ion_id)
Constructor.
Definition: section_config_exposer.h:62
virtual void expose()=0
Exposes plugin instance configuration.
Mode
Definition: section_config_exposer.h:51
virtual ~SectionConfigExposer()=default
void expose_default(std::string_view option, const auto &default_value_cluster, const auto &default_value_clusterset, bool is_common)
Definition: section_config_exposer.h:135
DC::OptionValue OptionValue
Definition: section_config_exposer.h:49