MySQL
8.4.2
Source Code Documentation
xcom_input_request.h
Go to the documentation of this file.
1
/* Copyright (c) 2018, 2024, Oracle and/or its affiliates.
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 designed to work 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 either included with
13
the program or referenced in the documentation.
14
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License, version 2.0, for more details.
19
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
23
24
#ifndef XCOM_INPUT_REQUEST_H
25
#define XCOM_INPUT_REQUEST_H
26
27
#include "
xcom/pax_msg.h
"
28
29
/**
30
* A request directed to XCom through the input channel.
31
*/
32
struct
xcom_input_request
;
33
typedef
struct
xcom_input_request
*
xcom_input_request_ptr
;
34
35
/**
36
* The function type that XCom will use to reply to a request.
37
*/
38
typedef
void (*
xcom_input_reply_function_ptr
)(
void
*
reply_arg
,
39
pax_msg
*payload);
40
41
/**
42
* Creates a new XCom request.
43
*
44
* Takes ownership of @c a.
45
*
46
* @param a the request's app_data payload
47
* @param reply_function the function used to reply to the request
48
* @param reply_arg opaque argument to the reply_function
49
* @retval xcom_input_request_ptr if successful
50
* @retval NULL if unsuccessful
51
*/
52
xcom_input_request_ptr
xcom_input_request_new
(
53
app_data_ptr
a
,
xcom_input_reply_function_ptr
reply_function
,
54
void
*
reply_arg
);
55
56
/**
57
* Frees the given request and its payload.
58
*
59
* @param request the request to free
60
*/
61
void
xcom_input_request_free
(
xcom_input_request_ptr
request);
62
63
/**
64
* Links @c request to the list of requests @c next.
65
*
66
* @param request the request to link
67
* @param next the list to be linked to
68
*/
69
void
xcom_input_request_set_next
(
xcom_input_request_ptr
request,
70
xcom_input_request_ptr
next
);
71
72
/**
73
* Unlinks @c request from its list.
74
*
75
* @param request the request to unlink
76
* @returns the tail of the list the request was unlinked from
77
*/
78
xcom_input_request_ptr
xcom_input_request_extract_next
(
79
xcom_input_request_ptr
request);
80
81
/**
82
* Extract the given request's payload.
83
*
84
* Transfers ownership of the result to the caller.
85
*
86
* @param request the request from which to extract the payload
87
* @returns the request's app_data payload
88
*/
89
app_data_ptr
xcom_input_request_extract_app_data
(
90
xcom_input_request_ptr
request);
91
92
/**
93
* Replies to the request using the strategy chosen by the request's origin.
94
*
95
* @param request the request to reply to
96
* @param payload the payload of the reply
97
*/
98
void
xcom_input_request_reply
(
xcom_input_request_ptr
request,
pax_msg
*payload);
99
100
#endif
/* XCOM_INPUT_REQUEST_H */
pax_msg.h
pax_msg
struct pax_msg pax_msg
Definition:
site_struct.h:37
xcom_input_request
Definition:
xcom_input_request.cc:31
xcom_input_request::reply_function
xcom_input_reply_function_ptr reply_function
Definition:
xcom_input_request.cc:33
xcom_input_request::a
app_data_ptr a
Definition:
xcom_input_request.cc:32
xcom_input_request::reply_arg
void * reply_arg
Definition:
xcom_input_request.cc:34
xcom_input_request::next
struct xcom_input_request * next
Definition:
xcom_input_request.cc:35
xcom_input_request_set_next
void xcom_input_request_set_next(xcom_input_request_ptr request, xcom_input_request_ptr next)
Links request to the list of requests next.
Definition:
xcom_input_request.cc:63
xcom_input_request_extract_next
xcom_input_request_ptr xcom_input_request_extract_next(xcom_input_request_ptr request)
Unlinks request from its list.
Definition:
xcom_input_request.cc:68
xcom_input_request_reply
void xcom_input_request_reply(xcom_input_request_ptr request, pax_msg *payload)
Replies to the request using the strategy chosen by the request's origin.
Definition:
xcom_input_request.cc:82
xcom_input_request_new
xcom_input_request_ptr xcom_input_request_new(app_data_ptr a, xcom_input_reply_function_ptr reply_function, void *reply_arg)
Creates a new XCom request.
Definition:
xcom_input_request.cc:38
xcom_input_request_extract_app_data
app_data_ptr xcom_input_request_extract_app_data(xcom_input_request_ptr request)
Extract the given request's payload.
Definition:
xcom_input_request.cc:75
xcom_input_request_free
void xcom_input_request_free(xcom_input_request_ptr request)
Frees the given request and its payload.
Definition:
xcom_input_request.cc:51
xcom_input_request_ptr
struct xcom_input_request * xcom_input_request_ptr
Definition:
xcom_input_request.h:33
xcom_input_reply_function_ptr
void(* xcom_input_reply_function_ptr)(void *reply_arg, pax_msg *payload)
The function type that XCom will use to reply to a request.
Definition:
xcom_input_request.h:38
plugin
group_replication
libmysqlgcs
src
bindings
xcom
xcom
xcom_input_request.h
Generated by
1.9.2