MySQL 8.1.0
Source Code Documentation
i_option.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2014, 2023, Oracle and/or its affiliates.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License, version 2.0,
6 as published by the Free Software Foundation.
7
8 This program is also distributed with certain software (including
9 but not limited to OpenSSL) that is licensed under separate terms,
10 as designated in a particular file or component or in included license
11 documentation. The authors of MySQL hereby grant you an additional
12 permission to link the program and your derivative works with the
13 separately licensed software that they have included with MySQL.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License, version 2.0, for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23*/
24
25#ifndef I_OPTION_INCLUDED
26#define I_OPTION_INCLUDED
27
28#include "my_getopt.h"
29#include "my_inttypes.h"
30
31namespace Mysql {
32namespace Tools {
33namespace Base {
34
35class Abstract_program;
36
37namespace Options {
38
39class I_option_changed_listener;
40
41/**
42 Common interface for all program option objects.
43 */
44class I_option {
45 public:
46 virtual ~I_option();
47
48 protected:
49 /**
50 Calls all option value callbacks.
51 To be used only from Abstract_program.
52 */
53 virtual void call_callbacks(char *argument) = 0;
54 /**
55 Internal method to get my_getopt internal option data structure.
56 */
57 virtual my_option get_my_option() = 0;
58
59 /**
60 Method to set listener on optid changed event.
61 For use from Abstract_options_provider class only.
62 */
64 I_option_changed_listener *listener) = 0;
65
67
70};
71
72} // namespace Options
73} // namespace Base
74} // namespace Tools
75} // namespace Mysql
76
77#endif
Base class for all MySQL client tools.
Definition: abstract_program.h:46
Common abstract class for options providers.
Definition: abstract_options_provider.h:54
Interface for listeners on some of option changes.
Definition: i_option_changed_listener.h:40
Common interface for all program option objects.
Definition: i_option.h:44
virtual my_option get_my_option()=0
Internal method to get my_getopt internal option data structure.
virtual void set_option_changed_listener(I_option_changed_listener *listener)=0
Method to set listener on optid changed event.
static uint32 last_optid
Definition: i_option.h:66
virtual void call_callbacks(char *argument)=0
Calls all option value callbacks.
Some integer typedefs for easier portability.
uint32_t uint32
Definition: my_inttypes.h:66
constexpr pos_type Options
Definition: http_request.h:260
Definition: abstract_connection_program.h:39
Definition: my_getopt.h:92