MySQL  8.0.22
Source Code Documentation
component_sys_var_service_imp.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2 
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6 
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation. The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License, version 2.0, for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef COMPONENT_SYSTEM_VAR_SERVICE_H
24 #define COMPONENT_SYSTEM_VAR_SERVICE_H
25 
28 
30 
31 /**
32  An implementation of the configutration system variables Service to register
33  variable and unregister variable.
34 */
36  public:
37  /**
38  Register's component system variables.
39  @param component_name name of the componentnt
40  @param var_name variable name
41  @param flags tells about the variable type
42  @param comment variable comment message
43  @param check_func function pointer, which is called at variable check time
44  @param update_func function pointer, which is called at update time
45  @param check_arg type defined check constraints block
46  @param variable_value place holder for variable value
47  @return Status of performed operation
48  @retval false success
49  @retval true failure
50  */
52  (const char *component_name, const char *var_name,
53  int flags, const char *comment,
54  mysql_sys_var_check_func check_func,
55  mysql_sys_var_update_func update_func,
56  void *check_arg, void *variable_value));
57 
58  /**
59  Get the component system variable value from the global structure.
60  @param component_name Name of the component
61  @param var_name Name of the variable
62  @param[in,out] val On input: a buffer to hold the value. On output a pointer
63  to the value.
64  @param[in,out] out_length_of_val On input: size of longest string that the
65  buffer can contain. On output the length of the copied string.
66  @return Status of performed operation
67  @retval false success
68  @retval true failure
69  */
71  (const char *component_name, const char *var_name,
72  void **val, size_t *out_length_of_val));
73 
74  /**
75  Unregister's component system variable.
76  @param component_name name of the component
77  @param var_name Variable name
78  @return Status of performed operation
79  @retval false success
80  @retval true failure
81  */
83  (const char *component_name, const char *var_name));
84 };
85 #endif /* COMPONENT_SYSTEM_VAR_SERVICE_H */
void mysql_comp_sys_var_services_init()
Definition: component_sys_var_service.cc:88
#define DEFINE_BOOL_METHOD(name, args)
static mysql_service_status_t get_variable(const char *component_name, const char *var_name, void **val, size_t *out_length_of_val) noexcept
Get the component system variable value from the global structure.
Definition: component_sys_var_service.cc:477
void(* mysql_sys_var_update_func)(MYSQL_THD thd, SYS_VAR *var, void *val_ptr, const void *save)
Signature for the update function.
Definition: component_sys_var_service.h:152
int(* mysql_sys_var_check_func)(MYSQL_THD thd, SYS_VAR *var, void *save, struct st_mysql_value *value)
Signature for the check function.
Definition: component_sys_var_service.h:124
static mysql_service_status_t register_variable(const char *component_name, const char *var_name, int flags, const char *comment, mysql_sys_var_check_func check_func, mysql_sys_var_update_func update_func, void *check_arg, void *variable_value) noexcept
Register's component system variables.
Definition: component_sys_var_service.cc:132
static int flags[50]
Definition: hp_test1.cc:39
Specifies macros to define Service Implementations.
static mysql_service_status_t unregister_variable(const char *component_name, const char *var_name) noexcept
Unregister's component system variable.
Definition: component_sys_var_service.cc:517
#define comment
Definition: lexyy.cc:959
An implementation of the configutration system variables Service to register variable and unregister ...
Definition: component_sys_var_service_imp.h:35