25#ifndef ABSTRACT_OPTION_INCLUDED
26#define ABSTRACT_OPTION_INCLUDED
43class Abstract_options_provider;
48template <
typename T_type>
79 std::string description,
longlong default_value);
106template <
typename T_type>
108 my_free(
const_cast<char *
>(m_option_structure.name));
109 my_free(
const_cast<char *
>(m_option_structure.comment));
111 for (
std::vector<std::function<
void(
char *)> *>::iterator it =
112 this->m_callbacks.begin();
113 it != this->m_callbacks.end(); it++) {
118template <
typename T_type>
120 std::function<
void(
char *)> *callback) {
121 this->m_callbacks.push_back(callback);
124template <
typename T_type>
127 uint32 old_optid = this->m_option_structure.id;
128 this->m_option_structure.id = (int)code;
131 if (this->m_option_changed_listener !=
nullptr) {
132 this->m_option_changed_listener->notify_option_optid_changed(
this,
136 return (T_type *)
this;
139template <
typename T_type>
142 std::string description,
144 : m_option_changed_listener(
nullptr) {
174template <
typename T_type>
176 return this->m_option_structure;
179template <
typename T_type>
182 assert(this->m_option_changed_listener ==
nullptr);
184 this->m_option_changed_listener = listener;
187template <
typename T_type>
189 std::vector<std::function<void(
char *)> *>::iterator callback_it;
190 for (callback_it = this->m_callbacks.begin();
191 callback_it != this->m_callbacks.end(); callback_it++) {
192 (**callback_it)(argument);
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:221
#define MY_FAE
Definition: my_sys.h:124
@ REQUIRED_ARG
Definition: my_getopt.h:80
long long int longlong
Definition: my_inttypes.h:54
#define MYF(v)
Definition: my_inttypes.h:96
uint32_t uint32
Definition: my_inttypes.h:66
void my_free(void *ptr)
Frees the memory pointed by the ptr.
Definition: my_memory.cc:80
constexpr pos_type Options
Definition: http_request.h:260
Definition: abstract_connection_program.h:39
std::vector< T, ut::allocator< T > > vector
Specialization of vector which uses allocator.
Definition: ut0new.h:2873
char * my_strdup(PSI_memory_key key, const char *from, myf_t flags)
Definition: my_malloc.cc:547
case opt name
Definition: sslopt-case.h:32
Definition: my_getopt.h:92
const char * comment
option comment, for autom.
Definition: my_getopt.h:112
longlong min_value
Min allowed value (for numbers)
Definition: my_getopt.h:122
ulonglong max_value
Max allowed value (for numbers)
Definition: my_getopt.h:123
longlong def_value
Default value.
Definition: my_getopt.h:121
void * app_type
To be used by an application.
Definition: my_getopt.h:127
long block_size
Value should be a mult.
Definition: my_getopt.h:126
const char * name
Name of the option.
Definition: my_getopt.h:93
void * u_max_value
The user def.
Definition: my_getopt.h:117
ulong var_type
GET_BOOL, GET_ULL, etc.
Definition: my_getopt.h:119
TYPELIB * typelib
Pointer to possible values.
Definition: my_getopt.h:118
void * value
A pointer to the variable value.
Definition: my_getopt.h:116
enum get_opt_arg_type arg_type
e.g.
Definition: my_getopt.h:120
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:97
struct get_opt_arg_source * arg_source
Represents source/path from where this variable is set.
Definition: my_getopt.h:124
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:41