lib: graph: add "self" and some "private" APIs
[babeltrace.git] / include / babeltrace / graph / private-component-class-filter.h
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
44 extern "C" {
45 #endif
46
47 struct bt_self_component_class_filter;
48 struct bt_component_class_filter;
49 struct bt_self_component_filter;
50 struct bt_private_component_class;
51 struct bt_private_component_class_filter;
52 struct bt_self_component_port_input;
53 struct bt_self_component_port_output;
54 struct bt_port_input;
55 struct bt_port_output;
56 struct bt_query_executor;
57 struct bt_value;
58
59 typedef 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
64 typedef void (*bt_private_component_class_filter_finalize_method)(
65 struct bt_self_component_filter *self_component);
66
67 typedef 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
73 typedef void
74 (*bt_private_component_class_filter_notification_iterator_finalize_method)(
75 struct bt_self_notification_iterator *notification_iterator);
76
77 typedef 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
83 typedef 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
90 typedef 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
96 typedef 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
102 typedef 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
108 typedef 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
114 typedef 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
119 typedef 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
124 static inline
125 struct bt_private_component_class *
126 bt_private_component_class_filter_borrow_private_component_class(
127 struct bt_private_component_class_filter *priv_comp_cls_filter)
128 {
129 return (void *) priv_comp_cls_filter;
130 }
131
132 static inline
133 struct bt_component_class_filter *
134 bt_private_component_class_filter_borrow_component_class_filter(
135 struct bt_private_component_class_filter *priv_comp_cls_filter)
136 {
137 return (void *) priv_comp_cls_filter;
138 }
139
140 extern
141 struct bt_private_component_class_filter *
142 bt_private_component_class_filter_create(
143 const char *name,
144 bt_private_component_class_filter_notification_iterator_next_method method);
145
146 extern 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
150 extern 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
154 extern 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
158 extern 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
162 extern 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
166 extern 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
170 extern 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
174 extern 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
178 extern 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
182 extern 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
186 extern 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.047266 seconds and 4 git commands to generate.