lib: rename transforming bt_X_borrow_Y() -> bt_X_as_Y()
[babeltrace.git] / include / babeltrace / graph / private-component-class-filter.h
CommitLineData
d94d92ac
PP
1#ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H
2#define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H
3
4/*
5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26#include <stdint.h>
27
28/* For enum bt_notification_array */
29#include <babeltrace/graph/notification.h>
30
31/* For enum bt_self_component_status */
32#include <babeltrace/graph/self-component.h>
33
34/* For enum bt_query_status */
35#include <babeltrace/graph/query-executor.h>
36
37/* For enum bt_self_notification_iterator_status */
38#include <babeltrace/graph/self-notification-iterator.h>
39
40/* For struct bt_private_component_class_query_method_return */
41#include <babeltrace/graph/private-component-class.h>
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47struct bt_self_component_class_filter;
48struct bt_component_class_filter;
49struct bt_self_component_filter;
50struct bt_private_component_class;
51struct bt_private_component_class_filter;
52struct bt_self_component_port_input;
53struct bt_self_component_port_output;
54struct bt_port_input;
55struct bt_port_output;
56struct bt_query_executor;
57struct bt_value;
58
59typedef enum bt_self_component_status
60(*bt_private_component_class_filter_init_method)(
61 struct bt_self_component_filter *self_component,
62 struct bt_value *params, void *init_method_data);
63
64typedef void (*bt_private_component_class_filter_finalize_method)(
65 struct bt_self_component_filter *self_component);
66
67typedef enum bt_self_notification_iterator_status
68(*bt_private_component_class_filter_notification_iterator_init_method)(
69 struct bt_self_notification_iterator *notification_iterator,
70 struct bt_self_component_filter *self_component,
71 struct bt_self_component_port_output *port);
72
73typedef void
74(*bt_private_component_class_filter_notification_iterator_finalize_method)(
75 struct bt_self_notification_iterator *notification_iterator);
76
77typedef enum bt_self_notification_iterator_status
78(*bt_private_component_class_filter_notification_iterator_next_method)(
79 struct bt_self_notification_iterator *notification_iterator,
80 bt_notification_array notifs, uint64_t capacity,
81 uint64_t *count);
82
83typedef enum bt_query_status
84(*bt_private_component_class_filter_query_method)(
85 struct bt_self_component_class_filter *comp_class,
86 struct bt_query_executor *query_executor,
87 const char *object, struct bt_value *params,
88 struct bt_value **result);
89
90typedef enum bt_self_component_status
91(*bt_private_component_class_filter_accept_input_port_connection_method)(
92 struct bt_self_component_filter *self_component,
93 struct bt_self_component_port_input *self_port,
94 struct bt_port_output *other_port);
95
96typedef enum bt_self_component_status
97(*bt_private_component_class_filter_accept_output_port_connection_method)(
98 struct bt_self_component_filter *self_component,
99 struct bt_self_component_port_output *self_port,
100 struct bt_port_input *other_port);
101
102typedef enum bt_self_component_status
103(*bt_private_component_class_filter_input_port_connected_method)(
104 struct bt_self_component_filter *self_component,
105 struct bt_self_component_port_input *self_port,
106 struct bt_port_output *other_port);
107
108typedef enum bt_self_component_status
109(*bt_private_component_class_filter_output_port_connected_method)(
110 struct bt_self_component_filter *self_component,
111 struct bt_self_component_port_output *self_port,
112 struct bt_port_input *other_port);
113
114typedef void
115(*bt_private_component_class_filter_input_port_disconnected_method)(
116 struct bt_self_component_filter *self_component,
117 struct bt_self_component_port_input *self_port);
118
119typedef void
120(*bt_private_component_class_filter_output_port_disconnected_method)(
121 struct bt_self_component_filter *self_component,
122 struct bt_self_component_port_output *self_port);
123
124static inline
125struct bt_private_component_class *
707b7d35 126bt_private_component_class_filter_as_private_component_class(
d94d92ac
PP
127 struct bt_private_component_class_filter *priv_comp_cls_filter)
128{
129 return (void *) priv_comp_cls_filter;
130}
131
132static inline
133struct bt_component_class_filter *
707b7d35 134bt_private_component_class_filter_as_component_class_filter(
d94d92ac
PP
135 struct bt_private_component_class_filter *priv_comp_cls_filter)
136{
137 return (void *) priv_comp_cls_filter;
138}
139
140extern
141struct bt_private_component_class_filter *
142bt_private_component_class_filter_create(
143 const char *name,
144 bt_private_component_class_filter_notification_iterator_next_method method);
145
146extern int bt_private_component_class_filter_set_init_method(
147 struct bt_private_component_class_filter *comp_class,
148 bt_private_component_class_filter_init_method method);
149
150extern int bt_private_component_class_filter_set_finalize_method(
151 struct bt_private_component_class_filter *comp_class,
152 bt_private_component_class_filter_finalize_method method);
153
154extern int bt_private_component_class_filter_set_accept_input_port_connection_method(
155 struct bt_private_component_class_filter *comp_class,
156 bt_private_component_class_filter_accept_input_port_connection_method method);
157
158extern int bt_private_component_class_filter_set_accept_output_port_connection_method(
159 struct bt_private_component_class_filter *comp_class,
160 bt_private_component_class_filter_accept_output_port_connection_method method);
161
162extern int bt_private_component_class_filter_set_input_port_connected_method(
163 struct bt_private_component_class_filter *comp_class,
164 bt_private_component_class_filter_input_port_connected_method method);
165
166extern int bt_private_component_class_filter_set_output_port_connected_method(
167 struct bt_private_component_class_filter *comp_class,
168 bt_private_component_class_filter_output_port_connected_method method);
169
170extern int bt_private_component_class_filter_set_input_port_disconnected_method(
171 struct bt_private_component_class_filter *comp_class,
172 bt_private_component_class_filter_input_port_disconnected_method method);
173
174extern int bt_private_component_class_filter_set_output_port_disconnected_method(
175 struct bt_private_component_class_filter *comp_class,
176 bt_private_component_class_filter_output_port_disconnected_method method);
177
178extern int bt_private_component_class_filter_set_query_method(
179 struct bt_private_component_class_filter *comp_class,
180 bt_private_component_class_filter_query_method method);
181
182extern int bt_private_component_class_filter_set_notification_iterator_init_method(
183 struct bt_private_component_class_filter *comp_class,
184 bt_private_component_class_filter_notification_iterator_init_method method);
185
186extern int bt_private_component_class_filter_set_notification_iterator_finalize_method(
187 struct bt_private_component_class_filter *comp_class,
188 bt_private_component_class_filter_notification_iterator_finalize_method method);
189
190#ifdef __cplusplus
191}
192#endif
193
194#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H */
This page took 0.030873 seconds and 4 git commands to generate.