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>
35 /* For enum bt_self_notification_iterator_status */
36 #include <babeltrace/graph/self-notification-iterator.h>
38 /* For enum bt_query_status */
39 #include <babeltrace/graph/private-component-class.h>
45 struct bt_self_component_class_filter
;
46 struct bt_component_class_filter
;
47 struct bt_self_component_filter
;
48 struct bt_private_component_class
;
49 struct bt_private_component_class_filter
;
50 struct bt_self_component_port_input
;
51 struct bt_self_component_port_output
;
53 struct bt_port_output
;
54 struct bt_query_executor
;
57 typedef enum bt_self_component_status
58 (*bt_private_component_class_filter_init_method
)(
59 struct bt_self_component_filter
*self_component
,
60 struct bt_value
*params
, void *init_method_data
);
62 typedef void (*bt_private_component_class_filter_finalize_method
)(
63 struct bt_self_component_filter
*self_component
);
65 typedef 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
);
72 (*bt_private_component_class_filter_notification_iterator_finalize_method
)(
73 struct bt_self_notification_iterator
*notification_iterator
);
75 typedef 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
,
81 typedef 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
,
85 const char *object
, struct bt_value
*params
,
86 struct bt_value
**result
);
88 typedef 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
);
94 typedef 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
);
100 typedef 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
);
106 typedef 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
);
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
);
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
);
123 struct bt_private_component_class
*
124 bt_private_component_class_filter_as_private_component_class(
125 struct bt_private_component_class_filter
*priv_comp_cls_filter
)
127 return (void *) priv_comp_cls_filter
;
131 struct bt_component_class_filter
*
132 bt_private_component_class_filter_as_component_class_filter(
133 struct bt_private_component_class_filter
*priv_comp_cls_filter
)
135 return (void *) priv_comp_cls_filter
;
139 struct bt_private_component_class_filter
*
140 bt_private_component_class_filter_create(
142 bt_private_component_class_filter_notification_iterator_next_method method
);
144 extern 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
);
148 extern 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
);
152 extern 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
);
156 extern 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
);
160 extern 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
);
164 extern 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
);
168 extern 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
);
172 extern 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
);
176 extern 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
);
180 extern 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
);
184 extern 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
);
192 #endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H */