MySQL 8.0.40
Source Code Documentation
abstract_number_option.h
Go to the documentation of this file.
1/*
2 Copyright (c) 2014, 2024, 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 designed to work 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 either included with
14 the program or referenced in the documentation.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License, version 2.0, for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24*/
25
26#ifndef ABSTRACT_NUMBER_OPTION_INCLUDED
27#define ABSTRACT_NUMBER_OPTION_INCLUDED
28
29#include <string>
30
32
33namespace Mysql {
34namespace Tools {
35namespace Base {
36namespace Options {
37
38/**
39 Abstract option to handle numeric option values.
40 */
41template <typename T_type, typename T_value>
43 public:
44 /**
45 Sets minimum value boundary for option value. Smaller values passed as
46 option value will be changed to this minimum value.
47 */
48 virtual T_type *set_minimum_value(T_value minimum) = 0;
49 /**
50 Sets maximum value boundary for option value. Greater values passed as
51 option value will be changed to this maximum value.
52 */
53 virtual T_type *set_maximum_value(T_value maximum) = 0;
54
55 protected:
56 /**
57 Constructs new number option.
58 @param value Pointer to object to receive option value.
59 @param var_type my_getopt internal option type.
60 @param name Name of option. It is used in command line option name as
61 --name.
62 @param description Description of option to be printed in --help.
63 @param default_value default value to be supplied to internal option
64 data structure.
65 */
66 Abstract_number_option(T_value *value, ulong var_type, std::string name,
67 std::string description, uint64 default_value);
68};
69
70template <typename T_type, typename T_value>
72 T_value *value, ulong var_type, std::string name, std::string description,
73 uint64 default_value)
74 : Abstract_value_option<T_type>(value, var_type, name, description,
75 default_value) {}
76
77} // namespace Options
78} // namespace Base
79} // namespace Tools
80} // namespace Mysql
81
82#endif
Abstract option to handle numeric option values.
Definition: abstract_number_option.h:42
virtual T_type * set_minimum_value(T_value minimum)=0
Sets minimum value boundary for option value.
virtual T_type * set_maximum_value(T_value maximum)=0
Sets maximum value boundary for option value.
Abstract_number_option(T_value *value, ulong var_type, std::string name, std::string description, uint64 default_value)
Constructs new number option.
Definition: abstract_number_option.h:71
Abstract option to handle options accepting value argument.
Definition: abstract_value_option.h:43
uint64_t uint64
Definition: my_inttypes.h:69
constexpr pos_type Options
Definition: http_request.h:261
Definition: abstract_connection_program.h:38
case opt name
Definition: sslopt-case.h:33