lib: rename plural file names to singular
[babeltrace.git] / include / babeltrace / graph / graph.h
CommitLineData
1ca80abd
PP
1#ifndef BABELTRACE_GRAPH_GRAPH_H
2#define BABELTRACE_GRAPH_GRAPH_H
c0418dd9
JG
3
4/*
f60c8b34 5 * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
c0418dd9
JG
6 *
7 * Author: Jérémie Galarneau <jeremie.galarneau@efficios.com>
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining a copy
10 * of this software and associated documentation files (the "Software"), to deal
11 * in the Software without restriction, including without limitation the rights
12 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 * copies of the Software, and to permit persons to whom the Software is
14 * furnished to do so, subject to the following conditions:
15 *
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
18 *
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 */
27
9d408fca 28/* For bt_bool */
202a3a13 29#include <babeltrace/types.h>
c0418dd9 30
0d72b8c3
PP
31/* For enum bt_graph_status */
32#include <babeltrace/graph/graph-const.h>
33
c0418dd9
JG
34#ifdef __cplusplus
35extern "C" {
36#endif
37
0d72b8c3
PP
38struct bt_component;
39struct bt_component_class;
40struct bt_component_class_filter;
41struct bt_component_class_sink;
42struct bt_component_class_source;
43struct bt_component_filter;
44struct bt_component_sink;
45struct bt_component_source;
46struct bt_connection;
a2d06fd5 47struct bt_graph;
0d72b8c3
PP
48struct bt_port_input;
49struct bt_port_output;
50struct bt_value;
51
52typedef void (*bt_graph_filter_component_input_port_added_listener_func)(
53 const struct bt_component_filter *component,
54 const struct bt_port_input *port, void *data);
55
56typedef void (*bt_graph_sink_component_input_port_added_listener_func)(
57 const struct bt_component_sink *component,
58 const struct bt_port_input *port, void *data);
59
60typedef void (*bt_graph_source_component_output_port_added_listener_func)(
61 const struct bt_component_source *component,
62 const struct bt_port_output *port, void *data);
63
64typedef void (*bt_graph_filter_component_output_port_added_listener_func)(
65 const struct bt_component_filter *component,
66 const struct bt_port_output *port, void *data);
67
68typedef void (*bt_graph_filter_component_input_port_removed_listener_func)(
69 const struct bt_component_filter *component,
70 const struct bt_port_input *port, void *data);
71
72typedef void (*bt_graph_sink_component_input_port_removed_listener_func)(
73 const struct bt_component_sink *component,
74 const struct bt_port_input *port, void *data);
75
76typedef void (*bt_graph_source_component_output_port_removed_listener_func)(
77 const struct bt_component_source *component,
78 const struct bt_port_output *port, void *data);
79
80typedef void (*bt_graph_filter_component_output_port_removed_listener_func)(
81 const struct bt_component_filter *component,
82 const struct bt_port_output *port, void *data);
83
84typedef void (*bt_graph_source_filter_component_ports_connected_listener_func)(
85 const struct bt_component_source *source_component,
86 const struct bt_component_filter *filter_component,
87 const struct bt_port_output *upstream_port,
88 const struct bt_port_input *downstream_port, void *data);
89
90typedef void (*bt_graph_source_sink_component_ports_connected_listener_func)(
91 const struct bt_component_source *source_component,
92 const struct bt_component_sink *sink_component,
93 const struct bt_port_output *upstream_port,
94 const struct bt_port_input *downstream_port, void *data);
95
96typedef void (*bt_graph_filter_sink_component_ports_connected_listener_func)(
97 const struct bt_component_filter *filter_component,
98 const struct bt_component_sink *sink_component,
99 const struct bt_port_output *upstream_port,
100 const struct bt_port_input *downstream_port, void *data);
101
102typedef void (*bt_graph_source_filter_component_ports_disconnected_listener_func)(
103 const struct bt_component_source *source_component,
104 const struct bt_component_filter *filter_component,
105 const struct bt_port_output *upstream_port,
106 const struct bt_port_input *downstream_port,
107 void *data);
108
109typedef void (*bt_graph_source_sink_component_ports_disconnected_listener_func)(
110 const struct bt_component_source *source_component,
111 const struct bt_component_sink *sink_component,
112 const struct bt_port_output *upstream_port,
113 const struct bt_port_input *downstream_port,
114 void *data);
115
116typedef void (*bt_graph_filter_sink_component_ports_disconnected_listener_func)(
117 const struct bt_component_filter *filter_component,
118 const struct bt_component_sink *sink_component,
119 const struct bt_port_output *upstream_port,
120 const struct bt_port_input *downstream_port,
121 void *data);
122
123typedef void (* bt_graph_listener_removed_func)(void *data);
124
125extern struct bt_graph *bt_graph_create(void);
126
127extern enum bt_graph_status bt_graph_add_source_component(
128 struct bt_graph *graph,
129 const struct bt_component_class_source *component_class,
130 const char *name, const struct bt_value *params,
131 const struct bt_component_source **component);
132
133extern enum bt_graph_status
134bt_graph_add_source_component_with_init_method_data(
135 struct bt_graph *graph,
136 const struct bt_component_class_source *component_class,
137 const char *name, const struct bt_value *params,
138 void *init_method_data,
139 const struct bt_component_source **component);
140
141extern enum bt_graph_status bt_graph_add_filter_component(
142 struct bt_graph *graph,
143 const struct bt_component_class_filter *component_class,
144 const char *name, const struct bt_value *params,
145 const struct bt_component_filter **component);
146
147extern enum bt_graph_status
148bt_graph_add_filter_component_with_init_method_data(
149 struct bt_graph *graph,
150 const struct bt_component_class_filter *component_class,
151 const char *name, const struct bt_value *params,
152 void *init_method_data,
153 const struct bt_component_filter **component);
154
155extern enum bt_graph_status bt_graph_add_sink_component(
156 struct bt_graph *graph,
157 const struct bt_component_class_sink *component_class,
158 const char *name, const struct bt_value *params,
159 const struct bt_component_sink **component);
160
161extern enum bt_graph_status
162bt_graph_add_sink_component_with_init_method_data(
163 struct bt_graph *graph,
164 const struct bt_component_class_sink *component_class,
165 const char *name, const struct bt_value *params,
166 void *init_method_data,
167 const struct bt_component_sink **component);
168
169extern enum bt_graph_status bt_graph_connect_ports(
170 struct bt_graph *graph,
171 const struct bt_port_output *upstream,
172 const struct bt_port_input *downstream,
173 const struct bt_connection **connection);
174
175extern enum bt_graph_status bt_graph_run(struct bt_graph *graph);
176
177extern enum bt_graph_status bt_graph_consume(
178 struct bt_graph *graph);
179
180extern enum bt_graph_status
181bt_graph_add_filter_component_input_port_added_listener(
182 struct bt_graph *graph,
183 bt_graph_filter_component_input_port_added_listener_func listener,
184 bt_graph_listener_removed_func listener_removed, void *data,
185 int *listener_id);
186
187extern enum bt_graph_status
188bt_graph_add_sink_component_input_port_added_listener(
189 struct bt_graph *graph,
190 bt_graph_sink_component_input_port_added_listener_func listener,
191 bt_graph_listener_removed_func listener_removed, void *data,
192 int *listener_id);
193
194extern enum bt_graph_status
195bt_graph_add_source_component_output_port_added_listener(
196 struct bt_graph *graph,
197 bt_graph_source_component_output_port_added_listener_func listener,
198 bt_graph_listener_removed_func listener_removed, void *data,
199 int *listener_id);
200
201extern enum bt_graph_status
202bt_graph_add_filter_component_output_port_added_listener(
203 struct bt_graph *graph,
204 bt_graph_filter_component_output_port_added_listener_func listener,
205 bt_graph_listener_removed_func listener_removed, void *data,
206 int *listener_id);
207
208extern enum bt_graph_status
209bt_graph_add_filter_component_input_port_removed_listener(
210 struct bt_graph *graph,
211 bt_graph_filter_component_input_port_removed_listener_func listener,
212 bt_graph_listener_removed_func listener_removed, void *data,
213 int *listener_id);
214
215extern enum bt_graph_status
216bt_graph_add_sink_component_input_port_removed_listener(
217 struct bt_graph *graph,
218 bt_graph_sink_component_input_port_removed_listener_func listener,
219 bt_graph_listener_removed_func listener_removed, void *data,
220 int *listener_id);
221
222extern enum bt_graph_status
223bt_graph_add_source_component_output_port_removed_listener(
224 struct bt_graph *graph,
225 bt_graph_source_component_output_port_removed_listener_func listener,
226 bt_graph_listener_removed_func listener_removed, void *data,
227 int *listener_id);
228
229extern enum bt_graph_status
230bt_graph_add_filter_component_output_port_removed_listener(
231 struct bt_graph *graph,
232 bt_graph_filter_component_output_port_removed_listener_func listener,
233 bt_graph_listener_removed_func listener_removed, void *data,
234 int *listener_id);
235
236extern enum bt_graph_status
237bt_graph_add_source_filter_component_ports_connected_listener(
238 struct bt_graph *graph,
239 bt_graph_source_filter_component_ports_connected_listener_func listener,
240 bt_graph_listener_removed_func listener_removed, void *data,
241 int *listener_id);
242
243extern enum bt_graph_status
244bt_graph_add_source_sink_component_ports_connected_listener(
245 struct bt_graph *graph,
246 bt_graph_source_sink_component_ports_connected_listener_func listener,
247 bt_graph_listener_removed_func listener_removed, void *data,
248 int *listener_id);
249
250extern enum bt_graph_status
251bt_graph_add_filter_sink_component_ports_connected_listener(
252 struct bt_graph *graph,
253 bt_graph_filter_sink_component_ports_connected_listener_func listener,
254 bt_graph_listener_removed_func listener_removed, void *data,
255 int *listener_id);
256
257extern enum bt_graph_status
258bt_graph_add_source_filter_component_ports_disconnected_listener(
259 struct bt_graph *graph,
260 bt_graph_source_filter_component_ports_disconnected_listener_func listener,
261 bt_graph_listener_removed_func listener_removed, void *data,
262 int *listener_id);
263
264extern enum bt_graph_status
265bt_graph_add_source_sink_component_ports_disconnected_listener(
266 struct bt_graph *graph,
267 bt_graph_source_sink_component_ports_disconnected_listener_func listener,
268 bt_graph_listener_removed_func listener_removed, void *data,
269 int *listener_id);
270
271extern enum bt_graph_status
272bt_graph_add_filter_sink_component_ports_disconnected_listener(
273 struct bt_graph *graph,
274 bt_graph_filter_sink_component_ports_disconnected_listener_func listener,
275 bt_graph_listener_removed_func listener_removed, void *data,
276 int *listener_id);
c0418dd9 277
0d72b8c3 278extern enum bt_graph_status bt_graph_cancel(struct bt_graph *graph);
202a3a13 279
c0418dd9
JG
280#ifdef __cplusplus
281}
282#endif
283
1ca80abd 284#endif /* BABELTRACE_GRAPH_GRAPH_H */
This page took 0.052735 seconds and 4 git commands to generate.