26#ifndef MYSQL_HARNESS_SESSION_CONFIG_EXPOSER_INCLUDED
27#define MYSQL_HARNESS_SESSION_CONFIG_EXPOSER_INCLUDED
33#include "harness_export.h"
50 enum class Mode { ExposeInitialConfig, ExposeDefaultConfig };
64 : mode_(initial ?
Mode::ExposeInitialConfig :
Mode::ExposeDefaultConfig),
65 default_section_(default_section),
66 section_id_(section_id) {}
94 void expose_option(
const std::string &option,
const OptionValue &value,
95 const OptionValue &default_value,
bool is_common =
false);
108 void expose_option(
const std::string &option,
const OptionValue &value,
109 const OptionValue &default_value_cluster,
110 const OptionValue &default_value_clusterset,
114 void expose_str_option(
const std::string &option,
const OptionValue &value,
115 const OptionValue &default_value_cluster,
116 const OptionValue &default_value_clusterset,
117 bool is_common =
false);
119 void expose_int_option(
const std::string &option,
const OptionValue &value,
120 const OptionValue &default_value_cluster,
121 const OptionValue &default_value_clusterset,
122 bool is_common =
false);
124 void expose_double_option(
const std::string &option,
const OptionValue &value,
125 const OptionValue &default_value_cluster,
126 const OptionValue &default_value_clusterset,
127 bool is_common =
false);
129 void expose_bool_option(
const std::string &option,
const OptionValue &value,
130 const OptionValue &default_value_cluster,
131 const OptionValue &default_value_clusterset,
132 bool is_common =
false);
135 const auto &default_value_cluster,
136 const auto &default_value_clusterset,
bool is_common) {
137 DC::instance().set_option_default(
138 section_id_, option, default_value_cluster, default_value_clusterset);
140 DC::instance().set_option_default(common_section_id_, option,
141 default_value_cluster,
142 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:44
const mysql_harness::ConfigSection & default_section_
Definition: section_config_exposer.h:79
SectionConfigExposer(const SectionConfigExposer &)=delete
const DC::SectionId section_id_
Definition: section_config_exposer.h:81
const Mode mode_
Definition: section_config_exposer.h:78
void expose_default(const std::string &option, const auto &default_value_cluster, const auto &default_value_clusterset, bool is_common)
Definition: section_config_exposer.h:134
SectionConfigExposer(bool initial, const mysql_harness::ConfigSection &default_section, const DC::SectionId §ion_id)
Constructor.
Definition: section_config_exposer.h:61
virtual void expose()=0
Exposes plugin instance configuration.
Mode
Definition: section_config_exposer.h:50
virtual ~SectionConfigExposer()=default
DC::OptionValue OptionValue
Definition: section_config_exposer.h:48