MySQL 8.1.0
Source Code Documentation
my_host_application_signal.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 2023, Oracle and/or its affiliates.
2
3This program is free software; you can redistribute it and/or modify
4it under the terms of the GNU General Public License, version 2.0,
5as published by the Free Software Foundation.
6
7This program is also distributed with certain software (including
8but not limited to OpenSSL) that is licensed under separate terms,
9as designated in a particular file or component or in included license
10documentation. The authors of MySQL hereby grant you an additional
11permission to link the program and your derivative works with the
12separately licensed software that they have included with MySQL.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License, version 2.0, for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22
23#ifndef MY_HOST_APPLICATION_SIGNAL_H
24#define MY_HOST_APPLICATION_SIGNAL_H
25
26/**
27 @file
28 Convenience wrappers for @ref mysql_service_host_application_signal_t
29 */
30
33
34/**
35 Template to simplify sending application signals via the
36 @ref mysql_service_host_application_signal_t service.
37*/
38template <int signal_number, typename arg_type>
39bool my_host_application_signal(SERVICE_TYPE(registry) * registry,
40 arg_type argument) {
41 const my_service<SERVICE_TYPE(host_application_signal)> host_app(
42 "host_application_signal", registry);
43
44 return host_app->signal(signal_number, argument);
45}
46
47/**
48 Ease of use utility function to emit the @ref HOST_APPLICATION_SIGNAL_SHUTDOWN
49 signal via @ref mysql_service_host_application_signal_t
50
51 @sa host_application_signal, mysql_service_host_application_signal_t
52
53 @param registry the registry handle to use
54 @retval true failure
55 @retval false success
56*/
58 registry) {
59 return my_host_application_signal<HOST_APPLICATION_SIGNAL_SHUTDOWN, void *>(
60 registry, NULL);
61}
62
63#endif /* MY_HOST_APPLICATION_SIGNAL_H */
Wraps my_h_service struct conforming ABI into RAII C++ object with ability to cast to desired service...
Definition: my_service.h:34
bool my_host_application_signal_shutdown(const mysql_service_registry_t *registry)
Ease of use utility function to emit the HOST_APPLICATION_SIGNAL_SHUTDOWN signal via mysql_service_ho...
Definition: my_host_application_signal.h:57
bool my_host_application_signal(const mysql_service_registry_t *registry, arg_type argument)
Template to simplify sending application signals via the mysql_service_host_application_signal_t serv...
Definition: my_host_application_signal.h:39
arg_type
Definition: mysqltest.cc:1149
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:75
#define NULL
Definition: types.h:54