lib: make plugin API const-correct
[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
d94d92ac
PP
34
35/* For enum bt_self_notification_iterator_status */
36#include <babeltrace/graph/self-notification-iterator.h>
37
d72535e6 38/* For enum bt_query_status */
d94d92ac
PP
39#include <babeltrace/graph/private-component-class.h>
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45struct bt_self_component_class_filter;
46struct bt_component_class_filter;
47struct bt_self_component_filter;
48struct bt_private_component_class;
49struct bt_private_component_class_filter;
50struct bt_self_component_port_input;
51struct bt_self_component_port_output;
52struct bt_port_input;
53struct bt_port_output;
54struct bt_query_executor;
55struct bt_value;
56
57typedef enum bt_self_component_status
58(*bt_private_component_class_filter_init_method)(
59 struct bt_self_component_filter *self_component,
05e21286 60 const struct bt_value *params, void *init_method_data);
d94d92ac
PP
61
62typedef void (*bt_private_component_class_filter_finalize_method)(
63 struct bt_self_component_filter *self_component);
64
65typedef enum bt_self_notification_iterator_status
66(*bt_private_component_class_filter_notification_iterator_init_method)(
67 struct bt_self_notification_iterator *notification_iterator,
68 struct bt_self_component_filter *self_component,
69 struct bt_self_component_port_output *port);
70
71typedef void
72(*bt_private_component_class_filter_notification_iterator_finalize_method)(
73 struct bt_self_notification_iterator *notification_iterator);
74
75typedef enum bt_self_notification_iterator_status
76(*bt_private_component_class_filter_notification_iterator_next_method)(
77 struct bt_self_notification_iterator *notification_iterator,
78 bt_notification_array notifs, uint64_t capacity,
79 uint64_t *count);
80
81typedef enum bt_query_status
82(*bt_private_component_class_filter_query_method)(
83 struct bt_self_component_class_filter *comp_class,
84 struct bt_query_executor *query_executor,
05e21286
PP
85 const char *object, const struct bt_value *params,
86 const struct bt_value **result);
d94d92ac
PP
87
88typedef enum bt_self_component_status
89(*bt_private_component_class_filter_accept_input_port_connection_method)(
90 struct bt_self_component_filter *self_component,
91 struct bt_self_component_port_input *self_port,
92 struct bt_port_output *other_port);
93
94typedef enum bt_self_component_status
95(*bt_private_component_class_filter_accept_output_port_connection_method)(
96 struct bt_self_component_filter *self_component,
97 struct bt_self_component_port_output *self_port,
98 struct bt_port_input *other_port);
99
100typedef enum bt_self_component_status
101(*bt_private_component_class_filter_input_port_connected_method)(
102 struct bt_self_component_filter *self_component,
103 struct bt_self_component_port_input *self_port,
104 struct bt_port_output *other_port);
105
106typedef enum bt_self_component_status
107(*bt_private_component_class_filter_output_port_connected_method)(
108 struct bt_self_component_filter *self_component,
109 struct bt_self_component_port_output *self_port,
110 struct bt_port_input *other_port);
111
112typedef void
113(*bt_private_component_class_filter_input_port_disconnected_method)(
114 struct bt_self_component_filter *self_component,
115 struct bt_self_component_port_input *self_port);
116
117typedef void
118(*bt_private_component_class_filter_output_port_disconnected_method)(
119 struct bt_self_component_filter *self_component,
120 struct bt_self_component_port_output *self_port);
121
122static inline
123struct bt_private_component_class *
707b7d35 124bt_private_component_class_filter_as_private_component_class(
d94d92ac
PP
125 struct bt_private_component_class_filter *priv_comp_cls_filter)
126{
127 return (void *) priv_comp_cls_filter;
128}
129
130static inline
131struct bt_component_class_filter *
707b7d35 132bt_private_component_class_filter_as_component_class_filter(
d94d92ac
PP
133 struct bt_private_component_class_filter *priv_comp_cls_filter)
134{
135 return (void *) priv_comp_cls_filter;
136}
137
138extern
139struct bt_private_component_class_filter *
140bt_private_component_class_filter_create(
141 const char *name,
142 bt_private_component_class_filter_notification_iterator_next_method method);
143
144extern int bt_private_component_class_filter_set_init_method(
145 struct bt_private_component_class_filter *comp_class,
146 bt_private_component_class_filter_init_method method);
147
148extern int bt_private_component_class_filter_set_finalize_method(
149 struct bt_private_component_class_filter *comp_class,
150 bt_private_component_class_filter_finalize_method method);
151
152extern int bt_private_component_class_filter_set_accept_input_port_connection_method(
153 struct bt_private_component_class_filter *comp_class,
154 bt_private_component_class_filter_accept_input_port_connection_method method);
155
156extern int bt_private_component_class_filter_set_accept_output_port_connection_method(
157 struct bt_private_component_class_filter *comp_class,
158 bt_private_component_class_filter_accept_output_port_connection_method method);
159
160extern int bt_private_component_class_filter_set_input_port_connected_method(
161 struct bt_private_component_class_filter *comp_class,
162 bt_private_component_class_filter_input_port_connected_method method);
163
164extern int bt_private_component_class_filter_set_output_port_connected_method(
165 struct bt_private_component_class_filter *comp_class,
166 bt_private_component_class_filter_output_port_connected_method method);
167
168extern int bt_private_component_class_filter_set_input_port_disconnected_method(
169 struct bt_private_component_class_filter *comp_class,
170 bt_private_component_class_filter_input_port_disconnected_method method);
171
172extern int bt_private_component_class_filter_set_output_port_disconnected_method(
173 struct bt_private_component_class_filter *comp_class,
174 bt_private_component_class_filter_output_port_disconnected_method method);
175
176extern int bt_private_component_class_filter_set_query_method(
177 struct bt_private_component_class_filter *comp_class,
178 bt_private_component_class_filter_query_method method);
179
180extern int bt_private_component_class_filter_set_notification_iterator_init_method(
181 struct bt_private_component_class_filter *comp_class,
182 bt_private_component_class_filter_notification_iterator_init_method method);
183
184extern int bt_private_component_class_filter_set_notification_iterator_finalize_method(
185 struct bt_private_component_class_filter *comp_class,
186 bt_private_component_class_filter_notification_iterator_finalize_method method);
187
188#ifdef __cplusplus
189}
190#endif
191
192#endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H */
This page took 0.031251 seconds and 4 git commands to generate.