MySQL 9.1.0
Source Code Documentation
my_host_application_signal.h
Go to the documentation of this file.
1/* Copyright (c) 2018, 2024, 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 designed to work 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 either included with
13the program or referenced in the documentation.
14
15This program is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18GNU General Public License, version 2.0, for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24#ifndef MY_HOST_APPLICATION_SIGNAL_H
25#define MY_HOST_APPLICATION_SIGNAL_H
26
27/**
28 @file
29 Convenience wrappers for @ref mysql_service_host_application_signal_t
30 */
31
34
35/**
36 Template to simplify sending application signals via the
37 @ref mysql_service_host_application_signal_t service.
38*/
39template <int signal_number, typename arg_type>
40bool my_host_application_signal(SERVICE_TYPE(registry) * registry,
41 arg_type argument) {
42 const my_service<SERVICE_TYPE(host_application_signal)> host_app(
43 "host_application_signal", registry);
44
45 return host_app->signal(signal_number, argument);
46}
47
48/**
49 Ease of use utility function to emit the @ref HOST_APPLICATION_SIGNAL_SHUTDOWN
50 signal via @ref mysql_service_host_application_signal_t
51
52 @sa host_application_signal, mysql_service_host_application_signal_t
53
54 @param registry the registry handle to use
55 @retval true failure
56 @retval false success
57*/
59 registry) {
60 return my_host_application_signal<HOST_APPLICATION_SIGNAL_SHUTDOWN, void *>(
61 registry, nullptr);
62}
63
64#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:35
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:58
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:40
arg_type
Definition: mysqltest.cc:1146
#define SERVICE_TYPE(name)
Generates the standard Service type name.
Definition: service.h:76