Commit | Line | Data |
---|---|---|
1ca80abd PP |
1 | #ifndef BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H |
2 | #define BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H | |
d3e4dcd8 PP |
3 | |
4 | /* | |
e2f7325d | 5 | * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com> |
d3e4dcd8 PP |
6 | * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
7 | * | |
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
9 | * of this software and associated documentation files (the "Software"), to deal | |
10 | * in the Software without restriction, including without limitation the rights | |
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
12 | * copies of the Software, and to permit persons to whom the Software is | |
13 | * furnished to do so, subject to the following conditions: | |
14 | * | |
15 | * The above copyright notice and this permission notice shall be included in | |
16 | * all copies or substantial portions of the Software. | |
17 | * | |
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
24 | * SOFTWARE. | |
25 | */ | |
26 | ||
0d72b8c3 PP |
27 | #include <stdint.h> |
28 | ||
4cdfc5e8 | 29 | /* For bt_self_component_status */ |
3fadfbc0 | 30 | #include <babeltrace2/graph/self-component.h> |
0d72b8c3 | 31 | |
4cdfc5e8 | 32 | /* For bt_self_message_iterator_status */ |
3fadfbc0 | 33 | #include <babeltrace2/graph/self-message-iterator.h> |
0d72b8c3 | 34 | |
4cdfc5e8 | 35 | /* For bt_query_status */ |
3fadfbc0 | 36 | #include <babeltrace2/graph/component-class.h> |
0d72b8c3 | 37 | |
d0cf29ee | 38 | /* For bt_component_class_status */ |
3fadfbc0 | 39 | #include <babeltrace2/graph/component-class-const.h> |
d0cf29ee | 40 | |
b19ff26f PP |
41 | /* |
42 | * For bt_component_class, bt_component_class_filter, bt_port_input, | |
43 | * bt_port_output, bt_query_executor, bt_self_component_class_filter, | |
44 | * bt_self_component_filter, bt_self_component_port_input, | |
7474e7d3 | 45 | * bt_self_component_port_output, bt_value, bt_message_array_const, |
005f1204 | 46 | * bt_bool, bt_self_message_iterator, __BT_UPCAST |
b19ff26f | 47 | */ |
3fadfbc0 | 48 | #include <babeltrace2/types.h> |
b19ff26f | 49 | |
f4e38e70 PP |
50 | /* For bt_logging_level */ |
51 | #include <babeltrace2/logging.h> | |
52 | ||
d3e4dcd8 PP |
53 | #ifdef __cplusplus |
54 | extern "C" { | |
55 | #endif | |
56 | ||
4cdfc5e8 | 57 | typedef bt_self_component_status |
0d72b8c3 | 58 | (*bt_component_class_filter_init_method)( |
b19ff26f PP |
59 | bt_self_component_filter *self_component, |
60 | const bt_value *params, void *init_method_data); | |
0d72b8c3 PP |
61 | |
62 | typedef void (*bt_component_class_filter_finalize_method)( | |
b19ff26f | 63 | bt_self_component_filter *self_component); |
0d72b8c3 | 64 | |
4cdfc5e8 | 65 | typedef bt_self_message_iterator_status |
d6e69534 PP |
66 | (*bt_component_class_filter_message_iterator_init_method)( |
67 | bt_self_message_iterator *message_iterator, | |
b19ff26f PP |
68 | bt_self_component_filter *self_component, |
69 | bt_self_component_port_output *port); | |
0d72b8c3 PP |
70 | |
71 | typedef void | |
d6e69534 PP |
72 | (*bt_component_class_filter_message_iterator_finalize_method)( |
73 | bt_self_message_iterator *message_iterator); | |
0d72b8c3 | 74 | |
4cdfc5e8 | 75 | typedef bt_self_message_iterator_status |
d6e69534 PP |
76 | (*bt_component_class_filter_message_iterator_next_method)( |
77 | bt_self_message_iterator *message_iterator, | |
78 | bt_message_array_const msgs, uint64_t capacity, | |
0d72b8c3 PP |
79 | uint64_t *count); |
80 | ||
7474e7d3 PP |
81 | typedef bt_self_message_iterator_status |
82 | (*bt_component_class_filter_message_iterator_seek_ns_from_origin_method)( | |
83 | bt_self_message_iterator *message_iterator, | |
84 | int64_t ns_from_origin); | |
85 | ||
86 | typedef bt_self_message_iterator_status | |
87 | (*bt_component_class_filter_message_iterator_seek_beginning_method)( | |
88 | bt_self_message_iterator *message_iterator); | |
89 | ||
90 | typedef bt_bool | |
91 | (*bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method)( | |
92 | bt_self_message_iterator *message_iterator, | |
93 | int64_t ns_from_origin); | |
94 | ||
95 | typedef bt_bool | |
96 | (*bt_component_class_filter_message_iterator_can_seek_beginning_method)( | |
97 | bt_self_message_iterator *message_iterator); | |
98 | ||
4cdfc5e8 | 99 | typedef bt_query_status |
0d72b8c3 | 100 | (*bt_component_class_filter_query_method)( |
b19ff26f PP |
101 | bt_self_component_class_filter *comp_class, |
102 | const bt_query_executor *query_executor, | |
103 | const char *object, const bt_value *params, | |
f4e38e70 | 104 | bt_logging_level logging_level, const bt_value **result); |
0d72b8c3 | 105 | |
4cdfc5e8 | 106 | typedef bt_self_component_status |
0d72b8c3 | 107 | (*bt_component_class_filter_accept_input_port_connection_method)( |
b19ff26f PP |
108 | bt_self_component_filter *self_component, |
109 | bt_self_component_port_input *self_port, | |
110 | const bt_port_output *other_port); | |
0d72b8c3 | 111 | |
4cdfc5e8 | 112 | typedef bt_self_component_status |
0d72b8c3 | 113 | (*bt_component_class_filter_accept_output_port_connection_method)( |
b19ff26f PP |
114 | bt_self_component_filter *self_component, |
115 | bt_self_component_port_output *self_port, | |
116 | const bt_port_input *other_port); | |
0d72b8c3 | 117 | |
4cdfc5e8 | 118 | typedef bt_self_component_status |
0d72b8c3 | 119 | (*bt_component_class_filter_input_port_connected_method)( |
b19ff26f PP |
120 | bt_self_component_filter *self_component, |
121 | bt_self_component_port_input *self_port, | |
122 | const bt_port_output *other_port); | |
0d72b8c3 | 123 | |
4cdfc5e8 | 124 | typedef bt_self_component_status |
0d72b8c3 | 125 | (*bt_component_class_filter_output_port_connected_method)( |
b19ff26f PP |
126 | bt_self_component_filter *self_component, |
127 | bt_self_component_port_output *self_port, | |
128 | const bt_port_input *other_port); | |
0d72b8c3 | 129 | |
d94d92ac | 130 | static inline |
b19ff26f PP |
131 | bt_component_class *bt_component_class_filter_as_component_class( |
132 | bt_component_class_filter *comp_cls_filter) | |
d94d92ac | 133 | { |
005f1204 | 134 | return __BT_UPCAST(bt_component_class, comp_cls_filter); |
d94d92ac | 135 | } |
d3eb6e8f | 136 | |
0d72b8c3 | 137 | extern |
b19ff26f | 138 | bt_component_class_filter *bt_component_class_filter_create( |
0d72b8c3 | 139 | const char *name, |
d6e69534 | 140 | bt_component_class_filter_message_iterator_next_method method); |
0d72b8c3 | 141 | |
d0cf29ee PP |
142 | extern bt_component_class_status |
143 | bt_component_class_filter_set_init_method( | |
b19ff26f | 144 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
145 | bt_component_class_filter_init_method method); |
146 | ||
d0cf29ee PP |
147 | extern bt_component_class_status |
148 | bt_component_class_filter_set_finalize_method( | |
b19ff26f | 149 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
150 | bt_component_class_filter_finalize_method method); |
151 | ||
d0cf29ee PP |
152 | extern bt_component_class_status |
153 | bt_component_class_filter_set_accept_input_port_connection_method( | |
b19ff26f | 154 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
155 | bt_component_class_filter_accept_input_port_connection_method method); |
156 | ||
d0cf29ee PP |
157 | extern bt_component_class_status |
158 | bt_component_class_filter_set_accept_output_port_connection_method( | |
b19ff26f | 159 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
160 | bt_component_class_filter_accept_output_port_connection_method method); |
161 | ||
d0cf29ee PP |
162 | extern bt_component_class_status |
163 | bt_component_class_filter_set_input_port_connected_method( | |
b19ff26f | 164 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
165 | bt_component_class_filter_input_port_connected_method method); |
166 | ||
d0cf29ee PP |
167 | extern bt_component_class_status |
168 | bt_component_class_filter_set_output_port_connected_method( | |
b19ff26f | 169 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
170 | bt_component_class_filter_output_port_connected_method method); |
171 | ||
d0cf29ee PP |
172 | extern bt_component_class_status |
173 | bt_component_class_filter_set_query_method( | |
b19ff26f | 174 | bt_component_class_filter *comp_class, |
0d72b8c3 PP |
175 | bt_component_class_filter_query_method method); |
176 | ||
d0cf29ee PP |
177 | extern bt_component_class_status |
178 | bt_component_class_filter_set_message_iterator_init_method( | |
b19ff26f | 179 | bt_component_class_filter *comp_class, |
d6e69534 | 180 | bt_component_class_filter_message_iterator_init_method method); |
0d72b8c3 | 181 | |
d0cf29ee PP |
182 | extern bt_component_class_status |
183 | bt_component_class_filter_set_message_iterator_finalize_method( | |
b19ff26f | 184 | bt_component_class_filter *comp_class, |
d6e69534 | 185 | bt_component_class_filter_message_iterator_finalize_method method); |
0d72b8c3 | 186 | |
7474e7d3 PP |
187 | extern bt_component_class_status |
188 | bt_component_class_filter_set_message_iterator_seek_ns_from_origin_method( | |
189 | bt_component_class_filter *comp_class, | |
190 | bt_component_class_filter_message_iterator_seek_ns_from_origin_method method); | |
191 | ||
192 | extern bt_component_class_status | |
193 | bt_component_class_filter_set_message_iterator_seek_beginning_method( | |
194 | bt_component_class_filter *comp_class, | |
195 | bt_component_class_filter_message_iterator_seek_beginning_method method); | |
196 | ||
197 | extern bt_bool | |
198 | bt_component_class_filter_set_message_iterator_can_seek_ns_from_origin_method( | |
199 | bt_component_class_filter *comp_class, | |
200 | bt_component_class_filter_message_iterator_can_seek_ns_from_origin_method method); | |
201 | ||
202 | extern bt_bool | |
203 | bt_component_class_filter_set_message_iterator_can_seek_beginning_method( | |
204 | bt_component_class_filter *comp_class, | |
205 | bt_component_class_filter_message_iterator_can_seek_beginning_method method); | |
206 | ||
d3eb6e8f PP |
207 | #ifdef __cplusplus |
208 | } | |
209 | #endif | |
210 | ||
90157d89 | 211 | #endif /* BABELTRACE_GRAPH_COMPONENT_CLASS_FILTER_H */ |