26#ifndef ABSTRACT_OPTION_INCLUDED
27#define ABSTRACT_OPTION_INCLUDED
44class Abstract_options_provider;
49template <
typename T_type>
80 std::string description,
longlong default_value);
107template <
typename T_type>
109 my_free(
const_cast<char *
>(m_option_structure.name));
110 my_free(
const_cast<char *
>(m_option_structure.comment));
112 for (
std::vector<std::function<
void(
char *)> *>::iterator it =
113 this->m_callbacks.begin();
114 it != this->m_callbacks.end(); it++) {
119template <
typename T_type>
121 std::function<
void(
char *)> *callback) {
122 this->m_callbacks.push_back(callback);
125template <
typename T_type>
128 uint32 old_optid = this->m_option_structure.id;
129 this->m_option_structure.id = (int)code;
132 if (this->m_option_changed_listener !=
nullptr) {
133 this->m_option_changed_listener->notify_option_optid_changed(
this,
137 return (T_type *)
this;
140template <
typename T_type>
143 std::string description,
145 : m_option_changed_listener(
nullptr) {
175template <
typename T_type>
177 return this->m_option_structure;
180template <
typename T_type>
183 assert(this->m_option_changed_listener ==
nullptr);
185 this->m_option_changed_listener = listener;
188template <
typename T_type>
190 std::vector<std::function<void(
char *)> *>::iterator callback_it;
191 for (callback_it = this->m_callbacks.begin();
192 callback_it != this->m_callbacks.end(); callback_it++) {
193 (**callback_it)(argument);
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
#define MY_FAE
Definition: my_sys.h:122
@ REQUIRED_ARG
Definition: my_getopt.h:81
long long int longlong
Definition: my_inttypes.h:55
#define MYF(v)
Definition: my_inttypes.h:97
uint32_t uint32
Definition: my_inttypes.h:67
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:81
constexpr pos_type Options
Definition: http_request.h:261
Definition: abstract_connection_program.h:38
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2874
char * my_strdup(PSI_memory_key key, const char *from, myf_t flags)
Definition: my_malloc.cc:548
case opt name
Definition: sslopt-case.h:33
Definition: my_getopt.h:93
const char * comment
option comment, for autom.
Definition: my_getopt.h:113
longlong min_value
Min allowed value (for numbers)
Definition: my_getopt.h:123
ulonglong max_value
Max allowed value (for numbers)
Definition: my_getopt.h:124
longlong def_value
Default value.
Definition: my_getopt.h:122
void * app_type
To be used by an application.
Definition: my_getopt.h:128
long block_size
Value should be a mult.
Definition: my_getopt.h:127
const char * name
Name of the option.
Definition: my_getopt.h:94
void * u_max_value
The user def.
Definition: my_getopt.h:118
ulong var_type
GET_BOOL, GET_ULL, etc.
Definition: my_getopt.h:120
TYPELIB * typelib
Pointer to possible values.
Definition: my_getopt.h:119
void * value
A pointer to the variable value.
Definition: my_getopt.h:117
enum get_opt_arg_type arg_type
e.g.
Definition: my_getopt.h:121
int id
For 0<id<=255 it's means one character for a short option (like -A), if >255 no short option is creat...
Definition: my_getopt.h:98
struct get_opt_arg_source * arg_source
Represents source/path from where this variable is set.
Definition: my_getopt.h:125
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:42