Commit | Line | Data |
---|---|---|
d27a81b2 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 | ||
d27a81b2 PP |
34 | |
35 | /* For enum bt_self_notification_iterator_status */ | |
36 | #include <babeltrace/graph/self-notification-iterator.h> | |
37 | ||
6b4f0dac | 38 | /* For enum bt_query_status */ |
d27a81b2 PP |
39 | #include <babeltrace/graph/private-component-class.h> |
40 | ||
41 | #ifdef __cplusplus | |
42 | extern "C" { | |
43 | #endif | |
44 | ||
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; | |
52 | struct bt_port_input; | |
53 | struct bt_port_output; | |
54 | struct bt_query_executor; | |
55 | struct bt_value; | |
56 | ||
57 | typedef enum bt_self_component_status | |
58 | (*bt_private_component_class_filter_init_method)( | |
59 | struct bt_self_component_filter *self_component, | |
82fa4539 | 60 | const struct bt_value *params, void *init_method_data); |
d27a81b2 PP |
61 | |
62 | typedef void (*bt_private_component_class_filter_finalize_method)( | |
63 | struct bt_self_component_filter *self_component); | |
64 | ||
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); | |
70 | ||
71 | typedef void | |
72 | (*bt_private_component_class_filter_notification_iterator_finalize_method)( | |
73 | struct bt_self_notification_iterator *notification_iterator); | |
74 | ||
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, | |
79 | uint64_t *count); | |
80 | ||
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, | |
82fa4539 PP |
85 | const char *object, const struct bt_value *params, |
86 | const struct bt_value **result); | |
d27a81b2 PP |
87 | |
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); | |
93 | ||
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); | |
99 | ||
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); | |
105 | ||
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); | |
111 | ||
112 | typedef 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 | ||
117 | typedef 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 | ||
122 | static inline | |
123 | struct bt_private_component_class * | |
27c0f01f | 124 | bt_private_component_class_filter_as_private_component_class( |
d27a81b2 PP |
125 | struct bt_private_component_class_filter *priv_comp_cls_filter) |
126 | { | |
127 | return (void *) priv_comp_cls_filter; | |
128 | } | |
129 | ||
130 | static inline | |
131 | struct bt_component_class_filter * | |
27c0f01f | 132 | bt_private_component_class_filter_as_component_class_filter( |
d27a81b2 PP |
133 | struct bt_private_component_class_filter *priv_comp_cls_filter) |
134 | { | |
135 | return (void *) priv_comp_cls_filter; | |
136 | } | |
137 | ||
138 | extern | |
139 | struct bt_private_component_class_filter * | |
140 | bt_private_component_class_filter_create( | |
141 | const char *name, | |
142 | bt_private_component_class_filter_notification_iterator_next_method method); | |
143 | ||
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); | |
147 | ||
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); | |
151 | ||
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); | |
155 | ||
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); | |
159 | ||
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); | |
163 | ||
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); | |
167 | ||
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); | |
171 | ||
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); | |
175 | ||
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); | |
179 | ||
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); | |
183 | ||
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); | |
187 | ||
188 | #ifdef __cplusplus | |
189 | } | |
190 | #endif | |
191 | ||
192 | #endif /* BABELTRACE_GRAPH_PRIVATE_COMPONENT_CLASS_FILTER_H */ |