1 #ifndef BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H
2 #define BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H
5 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
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:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
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
28 /* For enum bt_notification_array */
29 #include <babeltrace/graph/notification.h>
31 /* For enum bt_self_component_status */
32 #include <babeltrace/graph/self-component.h>
34 /* For enum bt_query_status */
35 #include <babeltrace/graph/query-executor.h>
37 /* For enum bt_self_notification_iterator_status */
38 #include <babeltrace/graph/self-notification-iterator.h>
40 /* For struct bt_private_component_class_query_method_return */
41 #include <babeltrace/graph/private-component-class.h>
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
;
55 struct bt_port_output
;
56 struct bt_query_executor
;
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
);
64 typedef void (*bt_private_component_class_filter_finalize_method
)(
65 struct bt_self_component_filter
*self_component
);
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
);
74 (*bt_private_component_class_filter_notification_iterator_finalize_method
)(
75 struct bt_self_notification_iterator
*notification_iterator
);
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
,
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
);
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
);
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
);
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
);
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
);
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
);
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
);
125 struct bt_private_component_class
*
126 bt_private_component_class_filter_as_private_component_class(
127 struct bt_private_component_class_filter
*priv_comp_cls_filter
)
129 return (void *) priv_comp_cls_filter
;
133 struct bt_component_class_filter
*
134 bt_private_component_class_filter_as_component_class_filter(
135 struct bt_private_component_class_filter
*priv_comp_cls_filter
)
137 return (void *) priv_comp_cls_filter
;
141 struct bt_private_component_class_filter
*
142 bt_private_component_class_filter_create(
144 bt_private_component_class_filter_notification_iterator_next_method method
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
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
);
194 #endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H */