MySQL  8.0.17
Source Code Documentation
component_status_var_service.h
Go to the documentation of this file.
1 /* Copyright (c) 2017, 2018, 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_STAUTS_VARIABLE_SERVICE_H
24 #define COMPONENT_STAUTS_VARIABLE_SERVICE_H
25 
28 #include <mysql/status_var.h>
29 
30 extern bool add_status_vars(const SHOW_VAR *);
31 extern void remove_status_vars(SHOW_VAR *);
32 
33 /**
34  An implementation of the component status variables Service to register
35  variable and unregister variable.
36 */
38  public:
39  /**
40  Register status variable.
41 
42  @param status_var fully constructed status variable object.
43  @return Status of performed operation
44  @retval false success
45  @retval true failure
46 
47  Note: Please see the components/test/test_status_var_service.cc file,
48  to know how to construct status varables for different variable types.
49  */
50  static DEFINE_BOOL_METHOD(register_variable, (SHOW_VAR * status_var));
51 
52  /**
53  Unregister's status variable.
54  @param status_var SHOW_VAR object with only the name of the variable,
55  which has to be removed from the global list.
56  @return Status of performed operation
57  @retval false success
58  @retval true failure
59  */
60  static DEFINE_BOOL_METHOD(unregister_variable, (SHOW_VAR * status_var));
61 };
62 #endif /* COMPONENT_STATUS_VARIABLE_SERVICE_H */
#define DEFINE_BOOL_METHOD(name, args)
bool add_status_vars(const SHOW_VAR *)
Definition: sql_show.cc:2209
SHOW STATUS Server status variable.
Definition: status_var.h:78
static mysql_service_status_t unregister_variable(SHOW_VAR *status_var) noexcept
Unregister&#39;s status variable.
Definition: component_status_var_service.cc:70
An implementation of the component status variables Service to register variable and unregister varia...
Definition: component_status_var_service.h:37
void remove_status_vars(SHOW_VAR *)
Definition: sql_show.cc:2322
Specifies macros to define Service Implementations.
static mysql_service_status_t register_variable(SHOW_VAR *status_var) noexcept
Register status variable.
Definition: component_status_var_service.cc:50