MySQL 8.0.40
Source Code Documentation
|
Abstract base with common option functionalities. More...
#include <abstract_option.h>
Public Member Functions | |
~Abstract_option () override | |
void | add_callback (std::function< void(char *)> *callback) |
Adds new callback for this option for option_parsed() event to callback chain. More... | |
T_type * | set_short_character (char code) |
Sets optid to given character to make possible usage of short option alternative. More... | |
Public Member Functions inherited from Mysql::Tools::Base::Options::I_option | |
virtual | ~I_option () |
Protected Member Functions | |
Abstract_option (void *value, ulong var_type, std::string name, std::string description, longlong default_value) | |
Constructs new option. More... | |
my_option | get_my_option () override |
Returns my_getopt internal option data structure representing this option. More... | |
void | set_option_changed_listener (I_option_changed_listener *listener) override |
Method to set listener on option changed events. More... | |
Protected Attributes | |
my_option | m_option_structure |
Private Member Functions | |
void | call_callbacks (char *argument) override |
Calls all option value callbacks. More... | |
Private Attributes | |
std::vector< std::function< void(char *)> * > | m_callbacks |
I_option_changed_listener * | m_option_changed_listener |
Friends | |
class | Abstract_options_provider |
Additional Inherited Members | |
Static Protected Attributes inherited from Mysql::Tools::Base::Options::I_option | |
static uint32 | last_optid = 256 |
Abstract base with common option functionalities.
|
override |
|
protected |
Constructs new option.
value | Pointer to object to receive option value. |
var_type | my_getopt internal option type. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
default_value | default value to be supplied to internal option data structure. |
void Mysql::Tools::Base::Options::Abstract_option< T_type >::add_callback | ( | std::function< void(char *)> * | callback | ) |
Adds new callback for this option for option_parsed() event to callback chain.
I_Callable can be replaced with std::Function<void(char*)> once we get one.
|
overrideprivatevirtual |
Calls all option value callbacks.
To be used only from Abstract_program.
Implements Mysql::Tools::Base::Options::I_option.
|
overrideprotectedvirtual |
Returns my_getopt internal option data structure representing this option.
To be used by Abstract_options_provider when preparing options array to return.
Implements Mysql::Tools::Base::Options::I_option.
|
overrideprotectedvirtual |
Method to set listener on option changed events.
For use from Abstract_options_provider class only.
Implements Mysql::Tools::Base::Options::I_option.
T_type * Mysql::Tools::Base::Options::Abstract_option< T_type >::set_short_character | ( | char | code | ) |
Sets optid to given character to make possible usage of short option alternative.
|
friend |
|
private |
|
private |
|
protected |