![]() |
MySQL 8.1.0
Source Code Documentation
|
Common abstract class for options providers. More...
#include <abstract_options_provider.h>
Public Member Functions | |
Simple_option * | create_new_option (std::string name, std::string description) |
Creates and attach new simple option. More... | |
Disabled_option * | create_new_disabled_option (std::string name, std::string description) |
Creates and attach new disabled option. More... | |
Char_array_option * | create_new_option (char **value, std::string name, std::string description) |
Creates and attach new string option stored in char* type object. More... | |
Password_option * | create_new_password_option (std::optional< std::string > *value, std::string name, std::string description) |
Creates and attach new password option. More... | |
String_option * | create_new_option (std::optional< std::string > *value, std::string name, std::string description) |
Creates and attach new string option. More... | |
Number_option< int32 > * | create_new_option (int32 *value, std::string name, std::string description) |
Creates and attach new 32-bit signed number option. More... | |
Number_option< uint32 > * | create_new_option (uint32 *value, std::string name, std::string description) |
Creates and attach new 32-bit unsigned number option. More... | |
Number_option< int64 > * | create_new_option (int64 *value, std::string name, std::string description) |
Creates and attach new 64-bit signed number option. More... | |
Number_option< uint64 > * | create_new_option (uint64 *value, std::string name, std::string description) |
Creates and attach new 64-bit unsigned number option. More... | |
Number_option< double > * | create_new_option (double *value, std::string name, std::string description) |
Creates and attach new floating-point number option. More... | |
Bool_option * | create_new_option (bool *value, std::string name, std::string description) |
Creates and attach new boolean option with value received from argument. More... | |
template<typename T_type , typename T_typelib > | |
Enum_option< T_type, T_typelib > * | create_new_enum_option (T_type *value, const T_typelib *type, std::string name, std::string description) |
virtual void | create_options ()=0 |
Creates all options that will be provided. More... | |
std::vector< my_option > | generate_options () override |
Creates list of options provided by this provider. More... | |
void | options_parsed () override |
Callback to be called when command-line options parsing have finished. More... | |
![]() | |
virtual | ~I_option_changed_listener ()=default |
Protected Member Functions | |
Abstract_options_provider () | |
~Abstract_options_provider () override | |
void | set_option_changed_listener (I_option_changed_listener *listener) override |
Sets optional option changes listener to which all changes in all options contained in this provider should be reported. More... | |
Private Member Functions | |
template<typename T_type > | |
T_type * | attach_new_option (T_type *option) |
Makes sure this provider will be able to watch name and optid usage. More... | |
void | notify_option_name_changed (I_option *source, std::string old_name) override |
Called after specified option has name changed. More... | |
void | notify_option_optid_changed (I_option *source, uint32 old_optid) override |
Called after specified option has option ID changed. More... | |
Private Attributes | |
bool | m_are_options_created |
std::map< std::string, I_option * > | m_name_usage |
std::map< uint32, I_option * > | m_optid_usage |
I_option_changed_listener * | m_option_changed_listener |
std::vector< I_option * > | m_options_created |
Common abstract class for options providers.
Provides common functionalities.
|
protected |
|
overrideprotected |
|
inlineprivate |
Makes sure this provider will be able to watch name and optid usage.
Disabled_option * Abstract_options_provider::create_new_disabled_option | ( | std::string | name, |
std::string | description | ||
) |
Creates and attach new disabled option.
This option is to mark existence of options inavailable due to distribution configuration.
name | Name of option. It is used in command-line option name as –name. |
description | Description of option to be printed in –help. |
|
inline |
Bool_option * Abstract_options_provider::create_new_option | ( | bool * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new boolean option with value received from argument.
value | Pointer to double object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Char_array_option * Abstract_options_provider::create_new_option | ( | char ** | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new string option stored in char* type object.
value | Pointer to char* object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Number_option< double > * Abstract_options_provider::create_new_option | ( | double * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new floating-point number option.
value | Pointer to double object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Number_option< int32 > * Abstract_options_provider::create_new_option | ( | int32 * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new 32-bit signed number option.
value | Pointer to int32 object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Number_option< int64 > * Abstract_options_provider::create_new_option | ( | int64 * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new 64-bit signed number option.
value | Pointer to int64 object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
String_option * Abstract_options_provider::create_new_option | ( | std::optional< std::string > * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new string option.
value | Pointer to std::optional<string> object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Simple_option * Abstract_options_provider::create_new_option | ( | std::string | name, |
std::string | description | ||
) |
Creates and attach new simple option.
name | Name of option. It is used in command-line option name as –name. |
description | Description of option to be printed in –help. |
Number_option< uint32 > * Abstract_options_provider::create_new_option | ( | uint32 * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new 32-bit unsigned number option.
value | Pointer to uint32 object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Number_option< uint64 > * Abstract_options_provider::create_new_option | ( | uint64 * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new 64-bit unsigned number option.
value | Pointer to uint64 object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
Password_option * Abstract_options_provider::create_new_password_option | ( | std::optional< std::string > * | value, |
std::string | name, | ||
std::string | description | ||
) |
Creates and attach new password option.
It removes password from command-line on UNIX systems to prevent password to be seen when listing processes.
value | Pointer to std::optional<string> object to receive option value. |
name | Name of option. It is used in command line option name as –name. |
description | Description of option to be printed in –help. |
|
pure virtual |
Creates all options that will be provided.
Implemented in Mysql::Tools::Base::Options::Debug_options, Mysql::Tools::Base::Options::Help_options, Mysql::Tools::Base::Options::Mysql_connection_options::Ssl_options, Mysql::Tools::Base::Options::Mysql_connection_options, Mysql::Tools::Dump::Mysql_chain_element_options, Mysql::Tools::Dump::Mysql_object_reader_options, Mysql::Tools::Dump::Mysqldump_tool_chain_maker_options, Mysql::Tools::Dump::Object_filter, Mysql::Tools::Dump::Program, Mysql::Tools::Dump::Sql_formatter_options, and Mysql::Tools::Upgrade::Program.
|
overridevirtual |
Creates list of options provided by this provider.
Part of I_options_provider interface implementation.
Implements Mysql::Tools::Base::Options::I_options_provider.
Reimplemented in Mysql::Tools::Base::Options::Composite_options_provider.
|
overrideprivatevirtual |
Called after specified option has name changed.
It is also called when new option is added, old_name is empty string in that case. Part of I_option_changed_listener interface implementation.
Implements Mysql::Tools::Base::Options::I_option_changed_listener.
|
overrideprivatevirtual |
Called after specified option has option ID changed.
It is also called when new option is added, old_optid is 0 in that case. Part of I_option_changed_listener interface implementation.
Implements Mysql::Tools::Base::Options::I_option_changed_listener.
|
overridevirtual |
Callback to be called when command-line options parsing have finished.
Part of I_options_provider interface implementation.
Implements Mysql::Tools::Base::Options::I_options_provider.
Reimplemented in Mysql::Tools::Base::Options::Composite_options_provider, and Mysql::Tools::Base::Options::Debug_options.
|
overrideprotectedvirtual |
Sets optional option changes listener to which all changes in all options contained in this provider should be reported.
This is used when this provider is attached to another. Part of I_options_provider interface implementation.
Implements Mysql::Tools::Base::Options::I_options_provider.
|
private |
|
private |
|
private |
|
private |
|
private |