Commit | Line | Data |
---|---|---|
43c59509 PP |
1 | #ifndef BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H |
2 | #define BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H | |
3 | ||
4 | /* | |
5 | * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation | |
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 | #ifndef __BT_IN_BABELTRACE_H | |
27 | # error "Please include <babeltrace2/babeltrace.h> instead." | |
28 | #endif | |
29 | ||
30 | #include <babeltrace2/types.h> | |
31 | #include <babeltrace2/logging.h> | |
32 | ||
33 | #ifdef __cplusplus | |
34 | extern "C" { | |
35 | #endif | |
36 | ||
37 | /*! | |
38 | @defgroup api-comp-cls-dev Component class development | |
39 | @ingroup api-graph | |
40 | ||
41 | @brief | |
42 | Component class development (creation). | |
43 | ||
44 | A <strong><em>component class</em></strong> is the class of a \bt_comp: | |
45 | ||
46 | @image html component.png | |
47 | ||
48 | @attention | |
49 | This module (component class development API) offers functions to | |
50 | programatically create component classes. To get the properties of | |
51 | an existing component class, see \ref api-comp-cls. | |
52 | ||
53 | A component class has <em>methods</em>. This module essentially | |
54 | offers: | |
55 | ||
56 | - Component class method type definitions. | |
57 | ||
58 | - Component class creation functions, to which you pass a mandatory | |
59 | \bt_msg_iter_cls or method. | |
60 | ||
61 | - Functions to set optional component class methods. | |
62 | ||
63 | - Functions to set optional component class properties. | |
64 | ||
65 | A component class method is a user function. There are two types of | |
66 | methods: | |
67 | ||
68 | <dl> | |
69 | <dt>\anchor api-comp-cls-dev-instance-meth Instance method</dt> | |
70 | <dd> | |
71 | Operates on an instance (a \bt_comp). | |
72 | ||
73 | The type of the method's first parameter is | |
74 | #bt_self_component_source, #bt_self_component_filter, or | |
75 | bt_self_component_sink, depending on the component class's type. | |
76 | ||
77 | This is similar to an instance method in Python (where the instance | |
78 | object name is generally <code>self</code>) or a member function | |
79 | in C++ (where the instance pointer is named <code>this</code>), | |
80 | for example. | |
81 | </dd> | |
82 | ||
83 | <dt>\anchor api-comp-cls-dev-class-meth Class method</dt> | |
84 | <dd> | |
85 | Operates on a component class. | |
86 | ||
87 | The type of the method's first parameter is | |
88 | #bt_self_component_class_source, #bt_self_component_class_filter, or | |
89 | bt_self_component_class_sink, depending on the component class's | |
90 | type. | |
91 | ||
92 | This is similar to a class method in Python or a static member | |
93 | function in C++, for example. | |
94 | </dd> | |
95 | </dl> | |
96 | ||
97 | See \ref api-comp-cls-dev-methods "Methods" to learn more about the | |
98 | different types of component class methods. | |
99 | ||
100 | A component class is a \ref api-fund-shared-object "shared object": see | |
101 | the \ref api-comp-cls module for the reference count functions. | |
102 | ||
103 | Some library functions \ref api-fund-freezing "freeze" component classes | |
104 | on success. The documentation of those functions indicate this | |
105 | postcondition. | |
106 | ||
107 | Create a component class with bt_component_class_source_create(), | |
108 | bt_component_class_filter_create(), and | |
109 | bt_component_class_sink_create(). You must give the component class a | |
110 | name (not unique in any way) at creation time. | |
111 | ||
112 | When you create a \bt_src_comp_cls or a \bt_flt_comp_cls, you must pass | |
113 | a \bt_msg_iter_cls. This is the class of any \bt_msg_iter created for | |
114 | one of the component class's instance's \bt_oport. | |
115 | ||
116 | When you create a \bt_sink_comp_cls, you must pass a | |
117 | \ref api-comp-cls-dev-meth-consume "consuming method". | |
118 | ||
119 | \ref api-fund-c-typing "Upcast" the #bt_component_class_source, | |
120 | #bt_component_class_filter, and bt_component_class_sink types returned | |
121 | by the creation functions to the #bt_component_class type with | |
122 | bt_component_class_source_as_component_class(), | |
123 | bt_component_class_filter_as_component_class(), and | |
124 | bt_component_class_sink_as_component_class(). | |
125 | ||
126 | Set the \ref api-comp-cls-prop-descr "description" and the | |
127 | \ref api-comp-cls-prop-help "help text" of a component class with | |
128 | bt_component_class_set_description() and | |
129 | bt_component_class_set_help(). | |
130 | ||
131 | <h1>\anchor api-comp-cls-dev-methods Methods</h1> | |
132 | ||
133 | To learn when exactly the methods below are called, see | |
134 | \ref api-graph-lc "Trace processing graph life cycle". | |
135 | ||
136 | The available component class methods to implement are: | |
137 | ||
138 | <table> | |
139 | <tr> | |
140 | <th>Name | |
141 | <th>Method type | |
142 | <th>Component class types | |
143 | <th>Requirement | |
144 | <th>Graph is \ref api-graph-lc "configured"? | |
145 | <th>C types | |
146 | <tr> | |
147 | <td>Consume | |
148 | <td>\ref api-comp-cls-dev-instance-meth "Instance" | |
149 | <td>Sink | |
150 | <td>Mandatory | |
151 | <td>Yes | |
152 | <td>#bt_component_class_sink_consume_method | |
153 | <tr> | |
154 | <td>Finalize | |
155 | <td>Instance | |
156 | <td>All | |
157 | <td>Optional | |
158 | <td>Yes | |
159 | <td> | |
160 | #bt_component_class_source_finalize_method<br> | |
161 | #bt_component_class_filter_finalize_method<br> | |
162 | #bt_component_class_sink_finalize_method | |
163 | <tr> | |
164 | <td>Get supported \bt_mip (MIP) versions | |
165 | <td>\ref api-comp-cls-dev-class-meth "Class" | |
166 | <td>All | |
167 | <td>Optional | |
168 | <td>N/A | |
169 | <td> | |
170 | #bt_component_class_source_get_supported_mip_versions_method<br> | |
171 | #bt_component_class_filter_get_supported_mip_versions_method<br> | |
172 | #bt_component_class_sink_get_supported_mip_versions_method | |
173 | <tr> | |
174 | <td>Graph is \ref api-graph-lc "configured" | |
175 | <td>Instance | |
176 | <td>Sink | |
177 | <td>Mandatory | |
178 | <td>Yes | |
179 | <td>#bt_component_class_sink_graph_is_configured_method | |
180 | <tr> | |
181 | <td>Initialize | |
182 | <td>Instance | |
183 | <td>All | |
184 | <td>Optional | |
185 | <td>No | |
186 | <td> | |
187 | #bt_component_class_source_initialize_method<br> | |
188 | #bt_component_class_filter_initialize_method<br> | |
189 | #bt_component_class_sink_initialize_method | |
190 | <tr> | |
191 | <td>\bt_c_iport connected | |
192 | <td>Instance | |
193 | <td>Filter and sink | |
194 | <td>Optional | |
195 | <td>No | |
196 | <td> | |
197 | #bt_component_class_filter_input_port_connected_method<br> | |
198 | #bt_component_class_sink_input_port_connected_method | |
199 | <tr> | |
200 | <td>\bt_c_oport connected | |
201 | <td>Instance | |
202 | <td>Source and filter | |
203 | <td>Optional | |
204 | <td>No | |
205 | <td> | |
206 | #bt_component_class_source_output_port_connected_method<br> | |
207 | #bt_component_class_filter_output_port_connected_method | |
208 | <tr> | |
209 | <td>Query | |
210 | <td>Class | |
211 | <td>All | |
212 | <td>Optional | |
213 | <td>N/A | |
214 | <td> | |
215 | #bt_component_class_source_query_method<br> | |
216 | #bt_component_class_filter_query_method<br> | |
217 | #bt_component_class_sink_query_method | |
218 | </table> | |
219 | ||
220 | <dl> | |
221 | <dt> | |
222 | \anchor api-comp-cls-dev-meth-consume | |
223 | Consume | |
224 | </dt> | |
225 | <dd> | |
226 | Called within bt_graph_run() or bt_graph_run_once() to make your | |
227 | \bt_sink_comp consume and process \bt_p_msg. | |
228 | ||
229 | This method typically gets \em one message batch from one (or more) | |
230 | upstream \bt_msg_iter. You are free to get more than one batch of | |
231 | messages if needed; however, keep in mind that the \bt_name project | |
232 | recommends that this method executes fast enough so as not to block | |
233 | an interactive application running on the same thread. | |
234 | ||
235 | During what you consider to be a long, blocking operation, the | |
236 | project recommends that you periodically check whether or not you | |
237 | are interrupted with bt_self_component_sink_is_interrupted(). When | |
238 | you are, you can return either | |
239 | #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN or | |
240 | #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR, depending on | |
241 | your capability to continue the current operation later. | |
242 | ||
243 | If you need to block the thread, you can instead report to | |
244 | try again later to the bt_graph_run() or bt_graph_run_once() caller | |
245 | by returning #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN. | |
246 | ||
247 | If your sink component is done consuming and processing, return | |
248 | #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END from this method. | |
249 | The trace processing \bt_graph can continue to run afterwards if | |
250 | other sink components are still consuming. | |
251 | ||
252 | Within this method, you \em cannot add an \bt_iport with | |
253 | bt_self_component_sink_add_input_port(). | |
254 | ||
255 | Set this mandatory method at sink component class creation time with | |
256 | bt_component_class_sink_create(). | |
257 | </dd> | |
258 | ||
259 | <dt> | |
260 | \anchor api-comp-cls-dev-meth-fini | |
261 | Finalize | |
262 | </dt> | |
263 | <dd> | |
264 | Called to finalize your \bt_comp, that is, to let you | |
265 | destroy/free/finalize any user data you have (retrieved with | |
266 | bt_self_component_get_data()). | |
267 | ||
268 | The \bt_name library does not specify exactly when this method is | |
269 | called, but guarantees that it's called before the component is | |
270 | destroyed. | |
271 | ||
272 | For \bt_p_src_comp and \bt_p_flt_comp, the library guarantees that | |
273 | this method is called \em after all the component's \bt_p_msg_iter | |
274 | are finalized. | |
275 | ||
276 | This method is \em not called if the component's | |
277 | \ref api-comp-cls-dev-meth-init "initialization method" | |
278 | previously returned an error status code. | |
279 | ||
280 | Within this method, you cannot: | |
281 | ||
282 | - Add a \bt_port. | |
283 | - Use any \bt_msg_iter. | |
284 | ||
285 | Set this optional method with | |
286 | bt_component_class_source_set_finalize_method(), | |
287 | bt_component_class_filter_set_finalize_method(), and | |
288 | bt_component_class_sink_set_finalize_method(). | |
289 | </dd> | |
290 | ||
291 | <dt> | |
292 | \anchor api-comp-cls-dev-meth-mip | |
293 | Get supported \bt_mip (MIP) versions | |
294 | </dt> | |
295 | <dd> | |
296 | Called within bt_get_greatest_operative_mip_version() to get the | |
297 | set of MIP versions that an eventual \bt_comp supports. | |
298 | ||
299 | This is a \ref api-comp-cls-dev-class-meth "class method" because | |
300 | you can call bt_get_greatest_operative_mip_version() before you even | |
301 | create a trace processing \bt_graph. | |
302 | ||
303 | In this method, you receive initialization parameters as the | |
304 | \bt_p{params} parameter and initialization method data as the | |
305 | \bt_p{initialize_method_data}. Those parameters are set | |
306 | when bt_component_descriptor_set_add_descriptor() is called, before | |
307 | bt_get_greatest_operative_mip_version() is called. | |
308 | ||
309 | Considering those initialization parameters, you need to fill the | |
310 | received \bt_uint_rs \bt_p{supported_versions} with the rangs of | |
311 | MIP versions you support. | |
312 | ||
313 | As of \bt_name_version_min_maj, you can only support MIP version 0. | |
314 | ||
315 | Not having this method is equivalent to having one which adds the | |
316 | [0, 0] range to the \bt_p{supported_versions} set. | |
317 | ||
318 | Set this optional method with | |
319 | bt_component_class_source_set_get_supported_mip_versions_method(), | |
320 | bt_component_class_filter_set_get_supported_mip_versions_method(), | |
321 | and bt_component_class_sink_set_get_supported_mip_versions_method(). | |
322 | </dd> | |
323 | ||
324 | <dt> | |
325 | \anchor api-comp-cls-dev-meth-graph-configured | |
326 | Graph is \ref api-graph-lc "configured" | |
327 | </dt> | |
328 | <dd> | |
329 | For a given trace processing \bt_graph, called the first time | |
330 | bt_graph_run() or bt_graph_run_once() is called to notify your | |
331 | \bt_sink_comp that the graph is now configured. | |
332 | ||
333 | Within this method, you can create \bt_p_msg_iter on your sink | |
334 | component's \bt_p_iport. You can also manipulate those message | |
335 | iterators, for example get and process initial messages or make | |
336 | them. | |
337 | ||
338 | This method is called \em after the component's | |
339 | \ref api-comp-cls-dev-meth-init "initialization method" | |
340 | is called. You cannot create a message iterator in the | |
341 | initialization method. | |
342 | ||
343 | Within this method, you \em cannot add an \bt_iport with | |
344 | bt_self_component_sink_add_input_port(). | |
345 | ||
346 | Set this optional method with | |
347 | bt_component_class_sink_set_graph_is_configured_method(). | |
348 | </dd> | |
349 | ||
350 | <dt> | |
351 | \anchor api-comp-cls-dev-meth-init | |
352 | Initialize | |
353 | </dt> | |
354 | <dd> | |
355 | Called within a <code>bt_graph_add_*_component*()</code> function | |
356 | (see \ref api-graph) to initialize your \bt_comp. | |
357 | ||
358 | Within this method, you receive the initialization parameters and | |
359 | initialization method data passed to the | |
360 | <code>bt_graph_add_*_component*()</code> function. | |
361 | ||
362 | This method is where you can add initial \bt_p_port to your | |
363 | component with bt_self_component_source_add_output_port(), | |
364 | bt_self_component_filter_add_input_port(), | |
365 | bt_self_component_filter_add_output_port(), or | |
366 | bt_self_component_sink_add_input_port(). | |
367 | You can also add ports in the | |
368 | \ref api-comp-cls-dev-meth-iport-connected "input port connected" | |
369 | and | |
370 | \ref api-comp-cls-dev-meth-oport-connected "output port connected" | |
371 | methods. | |
372 | ||
373 | You can create user data and set it as the \bt_self_comp's user data | |
374 | with bt_self_component_set_data(). | |
375 | ||
376 | If you return #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK from | |
377 | this method, then your component's | |
378 | \ref api-comp-cls-dev-meth-fini "finalization method" will be | |
379 | called, if it exists, when your component is finalized. | |
380 | ||
381 | Set this optional method with | |
382 | bt_component_class_source_set_initialize_method(), | |
383 | bt_component_class_filter_set_initialize_method(), | |
384 | and bt_component_class_sink_set_initialize_method(). | |
385 | </dd> | |
386 | ||
387 | <dt> | |
388 | \anchor api-comp-cls-dev-meth-iport-connected | |
389 | \bt_c_iport connected | |
390 | </dt> | |
391 | <dd> | |
392 | Called within bt_graph_connect_ports() to notify your \bt_comp that | |
393 | one of its input ports has been connected. | |
394 | ||
395 | Within this method, you can add more \bt_p_port to your | |
396 | component with bt_self_component_source_add_output_port(), | |
397 | bt_self_component_filter_add_input_port(), | |
398 | bt_self_component_filter_add_output_port(), or | |
399 | bt_self_component_sink_add_input_port(). | |
400 | ||
401 | Set this optional method with | |
402 | bt_component_class_filter_set_input_port_connected_method() and | |
403 | bt_component_class_sink_set_input_port_connected_method(). | |
404 | </dd> | |
405 | ||
406 | <dt> | |
407 | \anchor api-comp-cls-dev-meth-oport-connected | |
408 | \bt_c_oport connected | |
409 | </dt> | |
410 | <dd> | |
411 | Called within bt_graph_connect_ports() to notify your \bt_comp that | |
412 | one of its output ports has been connected. | |
413 | ||
414 | Within this method, you can add more \bt_p_port to your | |
415 | component with bt_self_component_source_add_output_port(), | |
416 | bt_self_component_filter_add_input_port(), | |
417 | bt_self_component_filter_add_output_port(), or | |
418 | bt_self_component_sink_add_input_port(). | |
419 | ||
420 | Set this optional method with | |
421 | bt_component_class_source_set_output_port_connected_method() and | |
422 | bt_component_class_filter_set_output_port_connected_method(). | |
423 | </dd> | |
424 | ||
425 | <dt> | |
426 | \anchor api-comp-cls-dev-meth-query | |
427 | Query | |
428 | </dt> | |
429 | <dd> | |
430 | Called within bt_query_executor_query() to make your \bt_comp_cls | |
431 | perform a query operation. | |
432 | ||
433 | Within this method, you receive the query object name, the | |
434 | query parameters, and the method data passed when the | |
435 | \bt_qexec was created with bt_query_executor_create() or | |
436 | bt_query_executor_create_with_method_data(). | |
437 | ||
438 | You also receive a private view of the query executor which you can | |
439 | cast to a \c const query executor with | |
440 | bt_private_query_executor_as_query_executor_const() to access the | |
441 | executor's logging level with bt_query_executor_get_logging_level(). | |
442 | ||
443 | On success, set \bt_p{*result} to the query operation's result: a | |
444 | \em new \bt_val reference. | |
445 | ||
446 | If the queried object's name (\bt_p{object_name} parameter) is | |
447 | unknown, return | |
448 | #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT. | |
449 | ||
450 | If you need to block the thread, you can instead report to | |
451 | try again later to the bt_query_executor_query() caller | |
452 | by returning #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN. | |
453 | ||
454 | Set this optional method with | |
455 | bt_component_class_source_set_query_method(), | |
456 | bt_component_class_filter_set_query_method(), and | |
457 | bt_component_class_sink_set_query_method(). | |
458 | </dd> | |
459 | </dl> | |
460 | ||
461 | @attention | |
462 | @parblock | |
463 | In any of the methods above: | |
464 | ||
465 | - \em Never call bt_component_get_ref(), | |
466 | bt_component_source_get_ref(), bt_component_filter_get_ref(), or | |
467 | bt_component_sink_get_ref() on your own (upcasted) \bt_self_comp | |
468 | to avoid reference cycles. | |
469 | ||
470 | You can keep a borrowed (weak) \bt_self_comp reference in your | |
471 | component's user data (see bt_self_component_set_data()). | |
472 | ||
473 | - \em Never call bt_port_get_ref(), bt_port_input_get_ref(), or | |
474 | bt_port_output_get_ref() on one of your own (upcasted) | |
475 | \bt_p_self_comp_port to avoid reference cycles. | |
476 | ||
477 | - \em Never call bt_component_class_get_ref(), | |
478 | bt_component_class_source_get_ref(), | |
479 | bt_component_class_filter_get_ref(), or | |
480 | bt_component_class_sink_get_ref() on your own (upcasted) | |
481 | \bt_comp_cls to avoid reference cycles. | |
482 | @endparblock | |
483 | ||
484 | Within any \ref api-comp-cls-dev-instance-meth "instance method", you | |
485 | can access the \bt_comp's configured | |
486 | \ref #bt_logging_level "logging level" by first upcasting the | |
487 | \bt_self_comp to the #bt_component type with | |
488 | bt_self_component_as_component(), and then with | |
489 | bt_component_get_logging_level(). | |
490 | */ | |
491 | ||
492 | /*! @{ */ | |
493 | ||
494 | /*! | |
495 | @name Method types | |
496 | @{ | |
497 | */ | |
498 | ||
499 | /*! | |
500 | @brief | |
501 | Status codes for #bt_component_class_sink_consume_method. | |
502 | */ | |
503 | typedef enum bt_component_class_sink_consume_method_status { | |
504 | /*! | |
505 | @brief | |
506 | Success. | |
507 | */ | |
508 | BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
509 | ||
510 | /*! | |
511 | @brief | |
512 | Sink component is finished processing. | |
513 | */ | |
514 | BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END = __BT_FUNC_STATUS_END, | |
515 | ||
516 | /*! | |
517 | @brief | |
518 | Try again. | |
519 | */ | |
520 | BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN, | |
521 | ||
522 | /*! | |
523 | @brief | |
524 | Out of memory. | |
525 | */ | |
526 | BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
527 | ||
528 | /*! | |
529 | @brief | |
530 | User error. | |
531 | */ | |
532 | BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, | |
533 | } bt_component_class_sink_consume_method_status; | |
534 | ||
535 | /*! | |
536 | @brief | |
537 | \bt_c_sink_comp consuming method. | |
538 | ||
539 | See the \ref api-comp-cls-dev-meth-consume "consume" method. | |
540 | ||
541 | @param[in] self_component | |
542 | \bt_c_sink_comp instance. | |
543 | ||
544 | @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK | |
545 | Success. | |
546 | @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END | |
547 | Finished processing. | |
548 | @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN | |
549 | Try again. | |
550 | @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR | |
551 | Out of memory. | |
552 | @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR | |
553 | User error. | |
554 | ||
555 | @bt_pre_not_null{self_component} | |
556 | ||
557 | @sa bt_component_class_sink_create() — | |
558 | Creates a \bt_sink_comp. | |
559 | */ | |
560 | typedef bt_component_class_sink_consume_method_status | |
561 | (*bt_component_class_sink_consume_method)( | |
562 | bt_self_component_sink *self_component); | |
563 | ||
564 | /*! | |
565 | @brief | |
566 | \bt_c_src_comp finalization method. | |
567 | ||
568 | See the \ref api-comp-cls-dev-meth-fini "finalize" method. | |
569 | ||
570 | @param[in] self_component | |
571 | Source component instance. | |
572 | ||
573 | @bt_pre_not_null{self_component} | |
574 | ||
575 | @bt_post_no_error | |
576 | ||
577 | @sa bt_component_class_source_set_finalize_method() — | |
578 | Sets the finalization method of a source component class. | |
579 | */ | |
580 | typedef void (*bt_component_class_source_finalize_method)( | |
581 | bt_self_component_source *self_component); | |
582 | ||
583 | /*! | |
584 | @brief | |
585 | \bt_c_flt_comp finalization method. | |
586 | ||
587 | See the \ref api-comp-cls-dev-meth-fini "finalize" method. | |
588 | ||
589 | @param[in] self_component | |
590 | Filter component instance. | |
591 | ||
592 | @bt_pre_not_null{self_component} | |
593 | ||
594 | @bt_post_no_error | |
595 | ||
596 | @sa bt_component_class_filter_set_finalize_method() — | |
597 | Sets the finalization method of a filter component class. | |
598 | */ | |
599 | typedef void (*bt_component_class_filter_finalize_method)( | |
600 | bt_self_component_filter *self_component); | |
601 | ||
602 | /*! | |
603 | @brief | |
604 | \bt_c_sink_comp finalization method. | |
605 | ||
606 | See the \ref api-comp-cls-dev-meth-fini "finalize" method. | |
607 | ||
608 | @param[in] self_component | |
609 | Sink component instance. | |
610 | ||
611 | @bt_pre_not_null{self_component} | |
612 | ||
613 | @bt_post_no_error | |
614 | ||
615 | @sa bt_component_class_sink_set_finalize_method() — | |
616 | Sets the finalization method of a sink component class. | |
617 | */ | |
618 | typedef void (*bt_component_class_sink_finalize_method)( | |
619 | bt_self_component_sink *self_component); | |
620 | ||
621 | /*! | |
622 | @brief | |
623 | Status codes for | |
624 | #bt_component_class_source_get_supported_mip_versions_method, | |
625 | #bt_component_class_filter_get_supported_mip_versions_method, and | |
626 | #bt_component_class_sink_get_supported_mip_versions_method. | |
627 | */ | |
628 | typedef enum bt_component_class_get_supported_mip_versions_method_status { | |
629 | /*! | |
630 | @brief | |
631 | Success. | |
632 | */ | |
633 | BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
634 | ||
635 | /*! | |
636 | @brief | |
637 | Out of memory. | |
638 | */ | |
639 | BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
640 | ||
641 | /*! | |
642 | @brief | |
643 | User error. | |
644 | */ | |
645 | BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, | |
646 | } bt_component_class_get_supported_mip_versions_method_status; | |
647 | ||
648 | /*! | |
649 | @brief | |
650 | \bt_c_src_comp_cls \"get supported \bt_mip versions\" method. | |
651 | ||
652 | See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions" | |
653 | method. | |
654 | ||
655 | As of \bt_name_version_min_maj, you can only add the range [0, 0] | |
656 | to \bt_p{supported_versions}. | |
657 | ||
658 | @param[in] self_component_class | |
659 | Source component class. | |
660 | @param[in] params | |
661 | @parblock | |
662 | Initialization parameters, as passed as the \bt_p{params} parameter | |
663 | of bt_component_descriptor_set_add_descriptor() or | |
664 | bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). | |
665 | ||
666 | \bt_p{params} is frozen. | |
667 | @endparblock | |
668 | @param[in] initialize_method_data | |
669 | User data for this method, as passed as the | |
670 | \bt_p{init_method_data} parameter of | |
671 | bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). | |
672 | @param[in] logging_level | |
673 | Logging level to use during this method's execution, as passed | |
674 | as the \bt_p{logging_level} parameter of | |
675 | bt_get_greatest_operative_mip_version(). | |
676 | @param[in] supported_versions | |
677 | \bt_c_uint_rs to which to add the ranges of supported MIP versions | |
678 | of an eventual instance of \bt_p{self_component_class} considering | |
679 | \bt_p{params} and \bt_p{initialize_method_data}. | |
680 | ||
681 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK | |
682 | Success. | |
683 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR | |
684 | Out of memory. | |
685 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR | |
686 | User error. | |
687 | ||
688 | @bt_pre_not_null{self_component_class} | |
689 | @bt_pre_not_null{params} | |
690 | @bt_pre_is_map_val{params} | |
691 | @bt_pre_not_null{supported_versions} | |
692 | @pre | |
693 | \bt_p{supported_versions} is empty. | |
694 | ||
695 | @sa bt_component_class_source_set_get_supported_mip_versions_method() — | |
696 | Sets the "get supported MIP versions" method of a source | |
697 | component class. | |
698 | */ | |
699 | typedef bt_component_class_get_supported_mip_versions_method_status | |
700 | (*bt_component_class_source_get_supported_mip_versions_method)( | |
701 | bt_self_component_class_source *self_component_class, | |
702 | const bt_value *params, void *initialize_method_data, | |
703 | bt_logging_level logging_level, | |
704 | bt_integer_range_set_unsigned *supported_versions); | |
705 | ||
706 | ||
707 | /*! | |
708 | @brief | |
709 | \bt_c_flt_comp_cls \"get supported \bt_mip versions\" method. | |
710 | ||
711 | See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions" | |
712 | method. | |
713 | ||
714 | As of \bt_name_version_min_maj, you can only add the range [0, 0] | |
715 | to \bt_p{supported_versions}. | |
716 | ||
717 | @param[in] self_component_class | |
718 | Filter component class. | |
719 | @param[in] params | |
720 | @parblock | |
721 | Initialization parameters, as passed as the \bt_p{params} parameter | |
722 | of bt_component_descriptor_set_add_descriptor() or | |
723 | bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). | |
724 | ||
725 | \bt_p{params} is frozen. | |
726 | @endparblock | |
727 | @param[in] initialize_method_data | |
728 | User data for this method, as passed as the | |
729 | \bt_p{init_method_data} parameter of | |
730 | bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). | |
731 | @param[in] logging_level | |
732 | Logging level to use during this method's execution, as passed | |
733 | as the \bt_p{logging_level} parameter of | |
734 | bt_get_greatest_operative_mip_version(). | |
735 | @param[in] supported_versions | |
736 | \bt_c_uint_rs to which to add the ranges of supported MIP versions | |
737 | of an eventual instance of \bt_p{self_component_class} considering | |
738 | \bt_p{params} and \bt_p{initialize_method_data}. | |
739 | ||
740 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK | |
741 | Success. | |
742 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR | |
743 | Out of memory. | |
744 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR | |
745 | User error. | |
746 | ||
747 | @bt_pre_not_null{self_component_class} | |
748 | @bt_pre_not_null{params} | |
749 | @bt_pre_is_map_val{params} | |
750 | @bt_pre_not_null{supported_versions} | |
751 | @pre | |
752 | \bt_p{supported_versions} is empty. | |
753 | ||
754 | @sa bt_component_class_filter_set_get_supported_mip_versions_method() — | |
755 | Sets the "get supported MIP versions" method of a filter | |
756 | component class. | |
757 | */ | |
758 | typedef bt_component_class_get_supported_mip_versions_method_status | |
759 | (*bt_component_class_filter_get_supported_mip_versions_method)( | |
760 | bt_self_component_class_filter *source_component_class, | |
761 | const bt_value *params, void *initialize_method_data, | |
762 | bt_logging_level logging_level, | |
763 | bt_integer_range_set_unsigned *supported_versions); | |
764 | ||
765 | /*! | |
766 | @brief | |
767 | \bt_c_sink_comp_cls \"get supported \bt_mip versions\" method. | |
768 | ||
769 | See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions" | |
770 | method. | |
771 | ||
772 | As of \bt_name_version_min_maj, you can only add the range [0, 0] | |
773 | to \bt_p{supported_versions}. | |
774 | ||
775 | @param[in] self_component_class | |
776 | Sink component class. | |
777 | @param[in] params | |
778 | @parblock | |
779 | Initialization parameters, as passed as the \bt_p{params} parameter | |
780 | of bt_component_descriptor_set_add_descriptor() or | |
781 | bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). | |
782 | ||
783 | \bt_p{params} is frozen. | |
784 | @endparblock | |
785 | @param[in] initialize_method_data | |
786 | User data for this method, as passed as the | |
787 | \bt_p{init_method_data} parameter of | |
788 | bt_component_descriptor_set_add_descriptor_with_initialize_method_data(). | |
789 | @param[in] logging_level | |
790 | Logging level to use during this method's execution, as passed | |
791 | as the \bt_p{logging_level} parameter of | |
792 | bt_get_greatest_operative_mip_version(). | |
793 | @param[in] supported_versions | |
794 | \bt_c_uint_rs to which to add the ranges of supported MIP versions | |
795 | of an eventual instance of \bt_p{self_component_class} considering | |
796 | \bt_p{params} and \bt_p{initialize_method_data}. | |
797 | ||
798 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK | |
799 | Success. | |
800 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR | |
801 | Out of memory. | |
802 | @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR | |
803 | User error. | |
804 | ||
805 | @bt_pre_not_null{self_component_class} | |
806 | @bt_pre_not_null{params} | |
807 | @bt_pre_is_map_val{params} | |
808 | @bt_pre_not_null{supported_versions} | |
809 | @pre | |
810 | \bt_p{supported_versions} is empty. | |
811 | ||
812 | @sa bt_component_class_sink_set_get_supported_mip_versions_method() — | |
813 | Sets the "get supported MIP versions" method of a sink | |
814 | component class. | |
815 | */ | |
816 | typedef bt_component_class_get_supported_mip_versions_method_status | |
817 | (*bt_component_class_sink_get_supported_mip_versions_method)( | |
818 | bt_self_component_class_sink *source_component_class, | |
819 | const bt_value *params, void *initialize_method_data, | |
820 | bt_logging_level logging_level, | |
821 | bt_integer_range_set_unsigned *supported_versions); | |
822 | ||
823 | /*! | |
824 | @brief | |
825 | Status codes for | |
826 | #bt_component_class_sink_graph_is_configured_method. | |
827 | */ | |
828 | typedef enum bt_component_class_sink_graph_is_configured_method_status { | |
829 | /*! | |
830 | @brief | |
831 | Success. | |
832 | */ | |
833 | BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
834 | ||
835 | /*! | |
836 | @brief | |
837 | Out of memory. | |
838 | */ | |
839 | BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
840 | ||
841 | /*! | |
842 | @brief | |
843 | User error. | |
844 | */ | |
845 | BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, | |
846 | } bt_component_class_sink_graph_is_configured_method_status; | |
847 | ||
848 | /*! | |
849 | @brief | |
850 | \bt_c_sink_comp "graph is configured" method. | |
851 | ||
852 | See the \ref api-comp-cls-dev-meth-graph-configured | |
853 | "graph is configured" method. | |
854 | ||
855 | @param[in] self_component | |
856 | Sink component instance. | |
857 | ||
858 | @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK | |
859 | Success. | |
860 | @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR | |
861 | Out of memory. | |
862 | @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR | |
863 | User error. | |
864 | ||
865 | @bt_pre_not_null{self_component} | |
866 | ||
867 | @sa bt_component_class_sink_set_graph_is_configured_method() — | |
868 | Sets the "graph is configured" method of a sink component class. | |
869 | */ | |
870 | typedef bt_component_class_sink_graph_is_configured_method_status | |
871 | (*bt_component_class_sink_graph_is_configured_method)( | |
872 | bt_self_component_sink *self_component); | |
873 | ||
874 | /*! | |
875 | @brief | |
876 | Status codes for | |
877 | #bt_component_class_source_initialize_method, | |
878 | #bt_component_class_filter_initialize_method, and | |
879 | #bt_component_class_sink_initialize_method. | |
880 | */ | |
881 | typedef enum bt_component_class_initialize_method_status { | |
882 | /*! | |
883 | @brief | |
884 | Success. | |
885 | */ | |
886 | BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
887 | ||
888 | /*! | |
889 | @brief | |
890 | Out of memory. | |
891 | */ | |
892 | BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
893 | ||
894 | /*! | |
895 | @brief | |
896 | User error. | |
897 | */ | |
898 | BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, | |
899 | } bt_component_class_initialize_method_status; | |
900 | ||
901 | /*! | |
902 | @brief | |
903 | \bt_c_src_comp initialization method. | |
904 | ||
905 | See the \ref api-comp-cls-dev-meth-init "initialize" method. | |
906 | ||
907 | As of \bt_name_version_min_maj, the \bt_p{configuration} parameter | |
908 | is not used. | |
909 | ||
910 | @param[in] self_component | |
911 | Source component instance. | |
912 | @param[in] configuration | |
913 | Initial component configuration (unused). | |
914 | @param[in] params | |
915 | @parblock | |
916 | Initialization parameters, as passed as the \bt_p{params} parameter | |
917 | of bt_graph_add_source_component() or | |
918 | bt_graph_add_source_component_with_initialize_method_data(). | |
919 | ||
920 | \bt_p{params} is frozen. | |
921 | @endparblock | |
922 | @param[in] initialize_method_data | |
923 | User data for this method, as passed as the | |
924 | \bt_p{initialize_method_data} parameter of | |
925 | bt_graph_add_source_component_with_initialize_method_data(). | |
926 | ||
927 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | |
928 | Success. | |
929 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | |
930 | Out of memory. | |
931 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | |
932 | User error. | |
933 | ||
934 | @bt_pre_not_null{self_component} | |
935 | @bt_pre_not_null{configuration} | |
936 | @bt_pre_not_null{params} | |
937 | @bt_pre_is_map_val{params} | |
938 | ||
939 | @sa bt_component_class_source_set_initialize_method() — | |
940 | Sets the initialization method of a source component class. | |
941 | */ | |
942 | typedef bt_component_class_initialize_method_status | |
943 | (*bt_component_class_source_initialize_method)( | |
944 | bt_self_component_source *self_component, | |
945 | bt_self_component_source_configuration *configuration, | |
946 | const bt_value *params, void *initialize_method_data); | |
947 | ||
948 | /*! | |
949 | @brief | |
950 | \bt_c_flt_comp initialization method. | |
951 | ||
952 | See the \ref api-comp-cls-dev-meth-init "initialize" method. | |
953 | ||
954 | As of \bt_name_version_min_maj, the \bt_p{configuration} parameter | |
955 | is not used. | |
956 | ||
957 | @param[in] self_component | |
958 | Filter component instance. | |
959 | @param[in] configuration | |
960 | Initial component configuration (unused). | |
961 | @param[in] params | |
962 | @parblock | |
963 | Initialization parameters, as passed as the \bt_p{params} parameter | |
964 | of bt_graph_add_filter_component() or | |
965 | bt_graph_add_filter_component_with_initialize_method_data(). | |
966 | ||
967 | \bt_p{params} is frozen. | |
968 | @endparblock | |
969 | @param[in] initialize_method_data | |
970 | User data for this method, as passed as the | |
971 | \bt_p{initialize_method_data} parameter of | |
972 | bt_graph_add_filter_component_with_initialize_method_data(). | |
973 | ||
974 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | |
975 | Success. | |
976 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | |
977 | Out of memory. | |
978 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | |
979 | User error. | |
980 | ||
981 | @bt_pre_not_null{self_component} | |
982 | @bt_pre_not_null{configuration} | |
983 | @bt_pre_not_null{params} | |
984 | @bt_pre_is_map_val{params} | |
985 | ||
986 | @sa bt_component_class_filter_set_initialize_method() — | |
987 | Sets the initialization method of a filter component class. | |
988 | */ | |
989 | typedef bt_component_class_initialize_method_status | |
990 | (*bt_component_class_filter_initialize_method)( | |
991 | bt_self_component_filter *self_component, | |
992 | bt_self_component_filter_configuration *configuration, | |
993 | const bt_value *params, void *initialize_method_data); | |
994 | ||
995 | /*! | |
996 | @brief | |
997 | \bt_c_sink_comp initialization method. | |
998 | ||
999 | See the \ref api-comp-cls-dev-meth-init "initialize" method. | |
1000 | ||
1001 | As of \bt_name_version_min_maj, the \bt_p{configuration} parameter | |
1002 | is not used. | |
1003 | ||
1004 | @param[in] self_component | |
1005 | Sink component instance. | |
1006 | @param[in] configuration | |
1007 | Initial component configuration (unused). | |
1008 | @param[in] params | |
1009 | @parblock | |
1010 | Initialization parameters, as passed as the \bt_p{params} parameter | |
1011 | of bt_graph_add_sink_component(), | |
1012 | bt_graph_add_sink_component_with_initialize_method_data(), or | |
1013 | bt_graph_add_simple_sink_component(). | |
1014 | ||
1015 | \bt_p{params} is frozen. | |
1016 | @endparblock | |
1017 | @param[in] initialize_method_data | |
1018 | User data for this method, as passed as the | |
1019 | \bt_p{initialize_method_data} parameter of | |
1020 | bt_graph_add_sink_component_with_initialize_method_data(). | |
1021 | ||
1022 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK | |
1023 | Success. | |
1024 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR | |
1025 | Out of memory. | |
1026 | @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR | |
1027 | User error. | |
1028 | ||
1029 | @bt_pre_not_null{self_component} | |
1030 | @bt_pre_not_null{configuration} | |
1031 | @bt_pre_not_null{params} | |
1032 | @bt_pre_is_map_val{params} | |
1033 | ||
1034 | @sa bt_component_class_sink_set_initialize_method() — | |
1035 | Sets the initialization method of a sink component class. | |
1036 | */ | |
1037 | typedef bt_component_class_initialize_method_status | |
1038 | (*bt_component_class_sink_initialize_method)( | |
1039 | bt_self_component_sink *self_component, | |
1040 | bt_self_component_sink_configuration *configuration, | |
1041 | const bt_value *params, void *initialize_method_data); | |
1042 | ||
1043 | /*! | |
1044 | @brief | |
1045 | Status codes for | |
1046 | #bt_component_class_source_output_port_connected_method, | |
1047 | #bt_component_class_filter_input_port_connected_method, | |
1048 | #bt_component_class_filter_output_port_connected_method, and | |
1049 | #bt_component_class_sink_input_port_connected_method. | |
1050 | */ | |
1051 | typedef enum bt_component_class_port_connected_method_status { | |
1052 | /*! | |
1053 | @brief | |
1054 | Success. | |
1055 | */ | |
1056 | BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
1057 | ||
1058 | /*! | |
1059 | @brief | |
1060 | Out of memory. | |
1061 | */ | |
1062 | BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
1063 | ||
1064 | /*! | |
1065 | @brief | |
1066 | User error. | |
1067 | */ | |
1068 | BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, | |
1069 | } bt_component_class_port_connected_method_status; | |
1070 | ||
1071 | /*! | |
1072 | @brief | |
1073 | \bt_c_src_comp "output port connected" method. | |
1074 | ||
1075 | See the | |
1076 | \ref api-comp-cls-dev-meth-oport-connected "output port connected" | |
1077 | method. | |
1078 | ||
1079 | @param[in] self_component | |
1080 | Source component instance. | |
1081 | @param[in] self_port | |
1082 | Connected \bt_oport of \bt_p{self_component}. | |
1083 | @param[in] other_port | |
1084 | \bt_c_conn's other (input) port. | |
1085 | ||
1086 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | |
1087 | Success. | |
1088 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | |
1089 | Out of memory. | |
1090 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | |
1091 | User error. | |
1092 | ||
1093 | @bt_pre_not_null{self_component} | |
1094 | @bt_pre_not_null{self_port} | |
1095 | @bt_pre_not_null{other_port} | |
1096 | ||
1097 | @sa bt_component_class_source_set_output_port_connected_method() — | |
1098 | Sets the "output port connected" method of a source component class. | |
1099 | */ | |
1100 | typedef bt_component_class_port_connected_method_status | |
1101 | (*bt_component_class_source_output_port_connected_method)( | |
1102 | bt_self_component_source *self_component, | |
1103 | bt_self_component_port_output *self_port, | |
1104 | const bt_port_input *other_port); | |
1105 | ||
1106 | /*! | |
1107 | @brief | |
1108 | \bt_c_flt_comp "input port connected" method. | |
1109 | ||
1110 | See the | |
1111 | \ref api-comp-cls-dev-meth-iport-connected "input port connected" | |
1112 | method. | |
1113 | ||
1114 | @param[in] self_component | |
1115 | Filter component instance. | |
1116 | @param[in] self_port | |
1117 | Connected \bt_iport of \bt_p{self_component}. | |
1118 | @param[in] other_port | |
1119 | \bt_c_conn's other (output) port. | |
1120 | ||
1121 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | |
1122 | Success. | |
1123 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | |
1124 | Out of memory. | |
1125 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | |
1126 | User error. | |
1127 | ||
1128 | @bt_pre_not_null{self_component} | |
1129 | @bt_pre_not_null{self_port} | |
1130 | @bt_pre_not_null{other_port} | |
1131 | ||
1132 | @sa bt_component_class_filter_set_input_port_connected_method() — | |
1133 | Sets the "input port connected" method of a filter component class. | |
1134 | */ | |
1135 | typedef bt_component_class_port_connected_method_status | |
1136 | (*bt_component_class_filter_input_port_connected_method)( | |
1137 | bt_self_component_filter *self_component, | |
1138 | bt_self_component_port_input *self_port, | |
1139 | const bt_port_output *other_port); | |
1140 | ||
1141 | /*! | |
1142 | @brief | |
1143 | \bt_c_flt_comp "output port connected" method. | |
1144 | ||
1145 | See the | |
1146 | \ref api-comp-cls-dev-meth-oport-connected "output port connected" | |
1147 | method. | |
1148 | ||
1149 | @param[in] self_component | |
1150 | Filter component instance. | |
1151 | @param[in] self_port | |
1152 | Connected \bt_oport of \bt_p{self_component}. | |
1153 | @param[in] other_port | |
1154 | \bt_c_conn's other (input) port. | |
1155 | ||
1156 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | |
1157 | Success. | |
1158 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | |
1159 | Out of memory. | |
1160 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | |
1161 | User error. | |
1162 | ||
1163 | @bt_pre_not_null{self_component} | |
1164 | @bt_pre_not_null{self_port} | |
1165 | @bt_pre_not_null{other_port} | |
1166 | ||
1167 | @sa bt_component_class_filter_set_output_port_connected_method() — | |
1168 | Sets the "output port connected" method of a filter component class. | |
1169 | */ | |
1170 | typedef bt_component_class_port_connected_method_status | |
1171 | (*bt_component_class_filter_output_port_connected_method)( | |
1172 | bt_self_component_filter *self_component, | |
1173 | bt_self_component_port_output *self_port, | |
1174 | const bt_port_input *other_port); | |
1175 | ||
1176 | /*! | |
1177 | @brief | |
1178 | \bt_c_sink_comp "input port connected" method. | |
1179 | ||
1180 | See the | |
1181 | \ref api-comp-cls-dev-meth-iport-connected "input port connected" | |
1182 | method. | |
1183 | ||
1184 | @param[in] self_component | |
1185 | Sink component instance. | |
1186 | @param[in] self_port | |
1187 | Connected \bt_iport of \bt_p{self_component}. | |
1188 | @param[in] other_port | |
1189 | \bt_c_conn's other (output) port. | |
1190 | ||
1191 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK | |
1192 | Success. | |
1193 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR | |
1194 | Out of memory. | |
1195 | @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR | |
1196 | User error. | |
1197 | ||
1198 | @bt_pre_not_null{self_component} | |
1199 | @bt_pre_not_null{self_port} | |
1200 | @bt_pre_not_null{other_port} | |
1201 | ||
1202 | @sa bt_component_class_sink_set_input_port_connected_method() — | |
1203 | Sets the "input port connected" method of a sink component class. | |
1204 | */ | |
1205 | typedef bt_component_class_port_connected_method_status | |
1206 | (*bt_component_class_sink_input_port_connected_method)( | |
1207 | bt_self_component_sink *self_component, | |
1208 | bt_self_component_port_input *self_port, | |
1209 | const bt_port_output *other_port); | |
1210 | ||
1211 | /*! | |
1212 | @brief | |
1213 | Status codes for | |
1214 | #bt_component_class_source_query_method, | |
1215 | #bt_component_class_filter_query_method, and | |
1216 | #bt_component_class_sink_query_method. | |
1217 | */ | |
1218 | typedef enum bt_component_class_query_method_status { | |
1219 | /*! | |
1220 | @brief | |
1221 | Success. | |
1222 | */ | |
1223 | BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
1224 | ||
1225 | /*! | |
1226 | @brief | |
1227 | Unknown object to query. | |
1228 | */ | |
1229 | BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT = __BT_FUNC_STATUS_UNKNOWN_OBJECT, | |
1230 | ||
1231 | /*! | |
1232 | @brief | |
1233 | Try again. | |
1234 | */ | |
1235 | BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN = __BT_FUNC_STATUS_AGAIN, | |
1236 | ||
1237 | /*! | |
1238 | @brief | |
1239 | Out of memory. | |
1240 | */ | |
1241 | BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
1242 | ||
1243 | /*! | |
1244 | @brief | |
1245 | User error. | |
1246 | */ | |
1247 | BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR = __BT_FUNC_STATUS_ERROR, | |
1248 | } bt_component_class_query_method_status; | |
1249 | ||
1250 | /*! | |
1251 | @brief | |
1252 | \bt_c_src_comp_cls query method. | |
1253 | ||
1254 | See the \ref api-comp-cls-dev-meth-query "query" method. | |
1255 | ||
1256 | @param[in] self_component_class | |
1257 | Source component class, as passed as the \bt_p{component_class} | |
1258 | parameter of bt_query_executor_create() or | |
1259 | bt_query_executor_create_with_method_data() when creating this query | |
1260 | operation's \ref api-qexec "executor". | |
1261 | @param[in] query_executor | |
1262 | Private view of this query operation's executor. | |
1263 | @param[in] object_name | |
1264 | Name of the object to query, as passed as the \bt_p{object_name} | |
1265 | parameter of bt_query_executor_create() or | |
1266 | bt_query_executor_create_with_method_data() when creating this query | |
1267 | operation's executor. | |
1268 | @param[in] params | |
1269 | @parblock | |
1270 | Query parameters, as passed as the \bt_p{params} | |
1271 | parameter of bt_query_executor_create() or | |
1272 | bt_query_executor_create_with_method_data() when creating this query | |
1273 | operation's executor. | |
1274 | ||
1275 | \bt_p{params} is frozen. | |
1276 | @endparblock | |
1277 | @param[in] method_data | |
1278 | User data for this method, as passed as the \bt_p{method_data} | |
1279 | parameter of bt_query_executor_create_with_method_data() when | |
1280 | creating this query operation's executor. | |
1281 | @param[out] result | |
1282 | <strong>On success</strong>, \bt_p{*result} is | |
1283 | a \em new reference of this query operation's result. | |
1284 | ||
1285 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK | |
1286 | Success. | |
1287 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT | |
1288 | \bt_p{object_name} is unknown. | |
1289 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN | |
1290 | Try again. | |
1291 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR | |
1292 | Out of memory. | |
1293 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR | |
1294 | User error. | |
1295 | ||
1296 | @bt_pre_not_null{self_component_class} | |
1297 | @bt_pre_not_null{query_executor} | |
1298 | @bt_pre_not_null{object_name} | |
1299 | @bt_pre_not_null{params} | |
1300 | @bt_pre_not_null{result} | |
1301 | ||
1302 | @post | |
1303 | <strong>On success</strong>, \bt_p{*result} is set. | |
1304 | ||
1305 | @sa bt_component_class_source_set_query_method() — | |
1306 | Sets the query method of a source component class. | |
1307 | */ | |
1308 | typedef bt_component_class_query_method_status | |
1309 | (*bt_component_class_source_query_method)( | |
1310 | bt_self_component_class_source *self_component_class, | |
1311 | bt_private_query_executor *query_executor, | |
1312 | const char *object_name, const bt_value *params, | |
1313 | void *method_data, const bt_value **result); | |
1314 | ||
1315 | /*! | |
1316 | @brief | |
1317 | \bt_c_flt_comp_cls query method. | |
1318 | ||
1319 | See the \ref api-comp-cls-dev-meth-query "query" method. | |
1320 | ||
1321 | @param[in] self_component_class | |
1322 | Filter component class, as passed as the \bt_p{component_class} | |
1323 | parameter of bt_query_executor_create() or | |
1324 | bt_query_executor_create_with_method_data() when creating this query | |
1325 | operation's \ref api-qexec "executor". | |
1326 | @param[in] query_executor | |
1327 | Private view of this query operation's executor. | |
1328 | @param[in] object_name | |
1329 | Name of the object to query, as passed as the \bt_p{object_name} | |
1330 | parameter of bt_query_executor_create() or | |
1331 | bt_query_executor_create_with_method_data() when creating this query | |
1332 | operation's executor. | |
1333 | @param[in] params | |
1334 | @parblock | |
1335 | Query parameters, as passed as the \bt_p{params} | |
1336 | parameter of bt_query_executor_create() or | |
1337 | bt_query_executor_create_with_method_data() when creating this query | |
1338 | operation's executor. | |
1339 | ||
1340 | \bt_p{params} is frozen. | |
1341 | @endparblock | |
1342 | @param[in] method_data | |
1343 | User data for this method, as passed as the \bt_p{method_data} | |
1344 | parameter of bt_query_executor_create_with_method_data() when | |
1345 | creating this query operation's executor. | |
1346 | @param[out] result | |
1347 | <strong>On success</strong>, \bt_p{*result} is | |
1348 | a \em new reference of this query operation's result. | |
1349 | ||
1350 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK | |
1351 | Success. | |
1352 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT | |
1353 | \bt_p{object_name} is unknown. | |
1354 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN | |
1355 | Try again. | |
1356 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR | |
1357 | Out of memory. | |
1358 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR | |
1359 | User error. | |
1360 | ||
1361 | @bt_pre_not_null{self_component_class} | |
1362 | @bt_pre_not_null{query_executor} | |
1363 | @bt_pre_not_null{object_name} | |
1364 | @bt_pre_not_null{params} | |
1365 | @bt_pre_not_null{result} | |
1366 | ||
1367 | @post | |
1368 | <strong>On success</strong>, \bt_p{*result} is set. | |
1369 | ||
1370 | @sa bt_component_class_filter_set_query_method() — | |
1371 | Sets the query method of a filter component class. | |
1372 | */ | |
1373 | typedef bt_component_class_query_method_status | |
1374 | (*bt_component_class_filter_query_method)( | |
1375 | bt_self_component_class_filter *self_component_class, | |
1376 | bt_private_query_executor *query_executor, | |
1377 | const char *object_name, const bt_value *params, | |
1378 | void *method_data, const bt_value **result); | |
1379 | ||
1380 | /*! | |
1381 | @brief | |
1382 | \bt_c_sink_comp_cls query method. | |
1383 | ||
1384 | See the \ref api-comp-cls-dev-meth-query "query" method. | |
1385 | ||
1386 | @param[in] self_component_class | |
1387 | Sink component class, as passed as the \bt_p{component_class} | |
1388 | parameter of bt_query_executor_create() or | |
1389 | bt_query_executor_create_with_method_data() when creating this query | |
1390 | operation's \ref api-qexec "executor". | |
1391 | @param[in] query_executor | |
1392 | Private view of this query operation's executor. | |
1393 | @param[in] object_name | |
1394 | Name of the object to query, as passed as the \bt_p{object_name} | |
1395 | parameter of bt_query_executor_create() or | |
1396 | bt_query_executor_create_with_method_data() when creating this query | |
1397 | operation's executor. | |
1398 | @param[in] params | |
1399 | @parblock | |
1400 | Query parameters, as passed as the \bt_p{params} | |
1401 | parameter of bt_query_executor_create() or | |
1402 | bt_query_executor_create_with_method_data() when creating this query | |
1403 | operation's executor. | |
1404 | ||
1405 | \bt_p{params} is frozen. | |
1406 | @endparblock | |
1407 | @param[in] method_data | |
1408 | User data for this method, as passed as the \bt_p{method_data} | |
1409 | parameter of bt_query_executor_create_with_method_data() when | |
1410 | creating this query operation's executor. | |
1411 | @param[out] result | |
1412 | <strong>On success</strong>, \bt_p{*result} is | |
1413 | a \em new reference of this query operation's result. | |
1414 | ||
1415 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK | |
1416 | Success. | |
1417 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT | |
1418 | \bt_p{object_name} is unknown. | |
1419 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN | |
1420 | Try again. | |
1421 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR | |
1422 | Out of memory. | |
1423 | @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR | |
1424 | User error. | |
1425 | ||
1426 | @bt_pre_not_null{self_component_class} | |
1427 | @bt_pre_not_null{query_executor} | |
1428 | @bt_pre_not_null{object_name} | |
1429 | @bt_pre_not_null{params} | |
1430 | @bt_pre_not_null{result} | |
1431 | ||
1432 | @post | |
1433 | <strong>On success</strong>, \bt_p{*result} is set. | |
1434 | ||
1435 | @sa bt_component_class_sink_set_query_method() — | |
1436 | Sets the query method of a sink component class. | |
1437 | */ | |
1438 | typedef bt_component_class_query_method_status | |
1439 | (*bt_component_class_sink_query_method)( | |
1440 | bt_self_component_class_sink *self_component_class, | |
1441 | bt_private_query_executor *query_executor, | |
1442 | const char *object_name, const bt_value *params, | |
1443 | void *method_data, const bt_value **result); | |
1444 | ||
1445 | /*! @} */ | |
1446 | ||
1447 | /*! | |
1448 | @name Creation | |
1449 | @{ | |
1450 | */ | |
1451 | ||
1452 | /*! | |
1453 | @brief | |
1454 | Creates a \bt_src_comp_cls named \bt_p{name} and having the | |
1455 | \bt_msg_iter_cls \bt_p{message_iterator_class}. | |
1456 | ||
1457 | On success, the returned source component class has the following | |
1458 | property values: | |
1459 | ||
1460 | <table> | |
1461 | <tr> | |
1462 | <th>Property | |
1463 | <th>Value | |
1464 | <tr> | |
1465 | <td>\ref api-comp-cls-prop-name "Name" | |
1466 | <td>\bt_p{name} | |
1467 | <tr> | |
1468 | <td>\ref api-comp-cls-prop-descr "Description" | |
1469 | <td>\em None | |
1470 | <tr> | |
1471 | <td>\ref api-comp-cls-prop-help "Help text" | |
1472 | <td>\em None | |
1473 | </table> | |
1474 | ||
1475 | @param[in] name | |
1476 | Name of the source component class to create (copied). | |
1477 | @param[in] message_iterator_class | |
1478 | Message iterator class of the source component class to create. | |
1479 | ||
1480 | @returns | |
1481 | New source component class reference, or \c NULL on memory error. | |
1482 | ||
1483 | @bt_pre_not_null{name} | |
1484 | @bt_pre_not_null{message_iterator_class} | |
1485 | ||
1486 | @bt_post_success_frozen{message_iterator_class} | |
1487 | ||
1488 | @sa bt_message_iterator_class_create() — | |
1489 | Creates a message iterator class. | |
1490 | */ | |
1491 | extern | |
1492 | bt_component_class_source *bt_component_class_source_create( | |
1493 | const char *name, | |
1494 | bt_message_iterator_class *message_iterator_class); | |
1495 | ||
1496 | /*! | |
1497 | @brief | |
1498 | Creates a \bt_flt_comp_cls named \bt_p{name} and having the | |
1499 | \bt_msg_iter_cls \bt_p{message_iterator_class}. | |
1500 | ||
1501 | On success, the returned filter component class has the following | |
1502 | property values: | |
1503 | ||
1504 | <table> | |
1505 | <tr> | |
1506 | <th>Property | |
1507 | <th>Value | |
1508 | <tr> | |
1509 | <td>\ref api-comp-cls-prop-name "Name" | |
1510 | <td>\bt_p{name} | |
1511 | <tr> | |
1512 | <td>\ref api-comp-cls-prop-descr "Description" | |
1513 | <td>\em None | |
1514 | <tr> | |
1515 | <td>\ref api-comp-cls-prop-help "Help text" | |
1516 | <td>\em None | |
1517 | </table> | |
1518 | ||
1519 | @param[in] name | |
1520 | Name of the filter component class to create (copied). | |
1521 | @param[in] message_iterator_class | |
1522 | Message iterator class of the filter component class to create. | |
1523 | ||
1524 | @returns | |
1525 | New filter component class reference, or \c NULL on memory error. | |
1526 | ||
1527 | @bt_pre_not_null{name} | |
1528 | @bt_pre_not_null{message_iterator_class} | |
1529 | ||
1530 | @bt_post_success_frozen{message_iterator_class} | |
1531 | ||
1532 | @sa bt_message_iterator_class_create() — | |
1533 | Creates a message iterator class. | |
1534 | */ | |
1535 | extern | |
1536 | bt_component_class_filter *bt_component_class_filter_create( | |
1537 | const char *name, | |
1538 | bt_message_iterator_class *message_iterator_class); | |
1539 | ||
1540 | /*! | |
1541 | @brief | |
1542 | Creates a \bt_sink_comp_cls named \bt_p{name} and having the | |
1543 | \ref api-comp-cls-dev-meth-consume "consuming method" | |
1544 | \bt_p{consume_method}. | |
1545 | ||
1546 | On success, the returned sink component class has the following | |
1547 | property values: | |
1548 | ||
1549 | <table> | |
1550 | <tr> | |
1551 | <th>Property | |
1552 | <th>Value | |
1553 | <tr> | |
1554 | <td>\ref api-comp-cls-prop-name "Name" | |
1555 | <td>\bt_p{name} | |
1556 | <tr> | |
1557 | <td>\ref api-comp-cls-prop-descr "Description" | |
1558 | <td>\em None | |
1559 | <tr> | |
1560 | <td>\ref api-comp-cls-prop-help "Help text" | |
1561 | <td>\em None | |
1562 | </table> | |
1563 | ||
1564 | @param[in] name | |
1565 | Name of the sink component class to create (copied). | |
1566 | @param[in] consume_method | |
1567 | Consuming method of the sink component class to create. | |
1568 | ||
1569 | @returns | |
1570 | New sink component class reference, or \c NULL on memory error. | |
1571 | ||
1572 | @bt_pre_not_null{name} | |
1573 | @bt_pre_not_null{consume_method} | |
1574 | */ | |
1575 | extern | |
1576 | bt_component_class_sink *bt_component_class_sink_create( | |
1577 | const char *name, | |
1578 | bt_component_class_sink_consume_method consume_method); | |
1579 | ||
1580 | /*! @} */ | |
1581 | ||
1582 | /*! | |
1583 | @name Common properties | |
1584 | @{ | |
1585 | */ | |
1586 | ||
1587 | /*! | |
1588 | @brief | |
1589 | Status codes for bt_component_class_set_description(). | |
1590 | */ | |
1591 | typedef enum bt_component_class_set_description_status { | |
1592 | /*! | |
1593 | @brief | |
1594 | Success. | |
1595 | */ | |
1596 | BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK = __BT_FUNC_STATUS_OK, | |
1597 | ||
1598 | /*! | |
1599 | @brief | |
1600 | Out of memory. | |
1601 | */ | |
1602 | BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
1603 | } bt_component_class_set_description_status; | |
1604 | ||
1605 | /*! | |
1606 | @brief | |
1607 | Sets the description of the component class \bt_p{component_class} | |
1608 | to a copy of \bt_p{description}. | |
1609 | ||
1610 | See the \ref api-comp-cls-prop-descr "description" property. | |
1611 | ||
1612 | @param[in] component_class | |
1613 | Component class of which to set the description to | |
1614 | \bt_p{description}. | |
1615 | @param[in] description | |
1616 | New description of \bt_p{component_class} (copied). | |
1617 | ||
1618 | @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK | |
1619 | Success. | |
1620 | @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR | |
1621 | Out of memory. | |
1622 | ||
1623 | @bt_pre_not_null{component_class} | |
1624 | @bt_pre_hot{component_class} | |
1625 | @bt_pre_not_null{description} | |
1626 | ||
1627 | @sa bt_component_class_get_description() — | |
1628 | Returns the description of a component class. | |
1629 | */ | |
1630 | extern bt_component_class_set_description_status | |
1631 | bt_component_class_set_description(bt_component_class *component_class, | |
1632 | const char *description); | |
1633 | ||
1634 | /*! | |
1635 | @brief | |
1636 | Status codes for bt_component_class_set_help(). | |
1637 | */ | |
1638 | typedef enum bt_component_class_set_help_status { | |
1639 | /*! | |
1640 | @brief | |
1641 | Success. | |
1642 | */ | |
1643 | BT_COMPONENT_CLASS_SET_HELP_STATUS_OK = __BT_FUNC_STATUS_OK, | |
1644 | ||
1645 | /*! | |
1646 | @brief | |
1647 | Out of memory. | |
1648 | */ | |
1649 | BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR = __BT_FUNC_STATUS_MEMORY_ERROR, | |
1650 | } bt_component_class_set_help_status; | |
1651 | ||
1652 | /*! | |
1653 | @brief | |
1654 | Sets the help text of the component class \bt_p{component_class} | |
1655 | to a copy of \bt_p{help_text}. | |
1656 | ||
1657 | See the \ref api-comp-cls-prop-help "help text" property. | |
1658 | ||
1659 | @param[in] component_class | |
1660 | Component class of which to set the help text to | |
1661 | \bt_p{help_text}. | |
1662 | @param[in] help_text | |
1663 | New help text of \bt_p{component_class} (copied). | |
1664 | ||
1665 | @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_OK | |
1666 | Success. | |
1667 | @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR | |
1668 | Out of memory. | |
1669 | ||
1670 | @bt_pre_not_null{component_class} | |
1671 | @bt_pre_hot{component_class} | |
1672 | @bt_pre_not_null{help_text} | |
1673 | ||
1674 | @sa bt_component_class_get_help() — | |
1675 | Returns the help text of a component class. | |
1676 | */ | |
1677 | extern bt_component_class_set_help_status bt_component_class_set_help( | |
1678 | bt_component_class *component_class, | |
1679 | const char *help_text); | |
1680 | ||
1681 | /*! @} */ | |
1682 | ||
1683 | /*! | |
1684 | @name Method setting | |
1685 | @{ | |
1686 | */ | |
1687 | ||
1688 | /*! | |
1689 | @brief | |
1690 | Status code for the | |
1691 | <code>bt_component_class_*_set_*_method()</code> functions. | |
1692 | */ | |
1693 | typedef enum bt_component_class_set_method_status { | |
1694 | /*! | |
1695 | @brief | |
1696 | Success. | |
1697 | */ | |
1698 | BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK = __BT_FUNC_STATUS_OK, | |
1699 | } bt_component_class_set_method_status; | |
1700 | ||
1701 | /*! | |
1702 | @brief | |
1703 | Sets the optional finalization method of the \bt_src_comp_cls | |
1704 | \bt_p{component_class} to \bt_p{method}. | |
1705 | ||
1706 | See the \ref api-comp-cls-dev-meth-fini "finalize" method. | |
1707 | ||
1708 | @param[in] component_class | |
1709 | Source component class of which to set the finalization method to | |
1710 | \bt_p{method}. | |
1711 | @param[in] method | |
1712 | New finalization method of \bt_p{component_class}. | |
1713 | ||
1714 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1715 | Success. | |
1716 | ||
1717 | @bt_pre_not_null{component_class} | |
1718 | @bt_pre_hot{component_class} | |
1719 | @bt_pre_not_null{method} | |
1720 | */ | |
1721 | extern bt_component_class_set_method_status | |
1722 | bt_component_class_source_set_finalize_method( | |
1723 | bt_component_class_source *component_class, | |
1724 | bt_component_class_source_finalize_method method); | |
1725 | ||
1726 | /*! | |
1727 | @brief | |
1728 | Sets the optional finalization method of the \bt_flt_comp_cls | |
1729 | \bt_p{component_class} to \bt_p{method}. | |
1730 | ||
1731 | See the \ref api-comp-cls-dev-meth-fini "finalize" method. | |
1732 | ||
1733 | @param[in] component_class | |
1734 | Filter component class of which to set the finalization method to | |
1735 | \bt_p{method}. | |
1736 | @param[in] method | |
1737 | New finalization method of \bt_p{component_class}. | |
1738 | ||
1739 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1740 | Success. | |
1741 | ||
1742 | @bt_pre_not_null{component_class} | |
1743 | @bt_pre_hot{component_class} | |
1744 | @bt_pre_not_null{method} | |
1745 | */ | |
1746 | extern bt_component_class_set_method_status | |
1747 | bt_component_class_filter_set_finalize_method( | |
1748 | bt_component_class_filter *component_class, | |
1749 | bt_component_class_filter_finalize_method method); | |
1750 | ||
1751 | /*! | |
1752 | @brief | |
1753 | Sets the optional finalization method of the \bt_sink_comp_cls | |
1754 | \bt_p{component_class} to \bt_p{method}. | |
1755 | ||
1756 | See the \ref api-comp-cls-dev-meth-fini "finalize" method. | |
1757 | ||
1758 | @param[in] component_class | |
1759 | Sink component class of which to set the finalization method to | |
1760 | \bt_p{method}. | |
1761 | @param[in] method | |
1762 | New finalization method of \bt_p{component_class}. | |
1763 | ||
1764 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1765 | Success. | |
1766 | ||
1767 | @bt_pre_not_null{component_class} | |
1768 | @bt_pre_hot{component_class} | |
1769 | @bt_pre_not_null{method} | |
1770 | */ | |
1771 | extern | |
1772 | bt_component_class_set_method_status | |
1773 | bt_component_class_sink_set_finalize_method( | |
1774 | bt_component_class_sink *component_class, | |
1775 | bt_component_class_sink_finalize_method method); | |
1776 | ||
1777 | /*! | |
1778 | @brief | |
1779 | Sets the \"get supported \bt_mip versions\" method of the | |
1780 | \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}. | |
1781 | ||
1782 | See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions" | |
1783 | method. | |
1784 | ||
1785 | @param[in] component_class | |
1786 | Source component class of which to set the "get supported MIP | |
1787 | versions" method to \bt_p{method}. | |
1788 | @param[in] method | |
1789 | New "get supported MIP versions" method of \bt_p{component_class}. | |
1790 | ||
1791 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1792 | Success. | |
1793 | ||
1794 | @bt_pre_not_null{component_class} | |
1795 | @bt_pre_hot{component_class} | |
1796 | @bt_pre_not_null{method} | |
1797 | */ | |
1798 | extern bt_component_class_set_method_status | |
1799 | bt_component_class_source_set_get_supported_mip_versions_method( | |
1800 | bt_component_class_source *component_class, | |
1801 | bt_component_class_source_get_supported_mip_versions_method method); | |
1802 | ||
1803 | /*! | |
1804 | @brief | |
1805 | Sets the \"get supported \bt_mip versions\" method of the | |
1806 | \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}. | |
1807 | ||
1808 | See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions" | |
1809 | method. | |
1810 | ||
1811 | @param[in] component_class | |
1812 | Filter component class of which to set the "get supported MIP | |
1813 | versions" method to \bt_p{method}. | |
1814 | @param[in] method | |
1815 | New "get supported MIP versions" method of \bt_p{component_class}. | |
1816 | ||
1817 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1818 | Success. | |
1819 | ||
1820 | @bt_pre_not_null{component_class} | |
1821 | @bt_pre_hot{component_class} | |
1822 | @bt_pre_not_null{method} | |
1823 | */ | |
1824 | extern bt_component_class_set_method_status | |
1825 | bt_component_class_filter_set_get_supported_mip_versions_method( | |
1826 | bt_component_class_filter *component_class, | |
1827 | bt_component_class_filter_get_supported_mip_versions_method method); | |
1828 | ||
1829 | /*! | |
1830 | @brief | |
1831 | Sets the \"get supported \bt_mip versions\" method of the | |
1832 | \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}. | |
1833 | ||
1834 | See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions" | |
1835 | method. | |
1836 | ||
1837 | @param[in] component_class | |
1838 | Sink component class of which to set the "get supported MIP | |
1839 | versions" method to \bt_p{method}. | |
1840 | @param[in] method | |
1841 | New "get supported MIP versions" method of \bt_p{component_class}. | |
1842 | ||
1843 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1844 | Success. | |
1845 | ||
1846 | @bt_pre_not_null{component_class} | |
1847 | @bt_pre_hot{component_class} | |
1848 | @bt_pre_not_null{method} | |
1849 | */ | |
1850 | extern bt_component_class_set_method_status | |
1851 | bt_component_class_sink_set_get_supported_mip_versions_method( | |
1852 | bt_component_class_sink *component_class, | |
1853 | bt_component_class_sink_get_supported_mip_versions_method method); | |
1854 | ||
1855 | /*! | |
1856 | @brief | |
1857 | Sets the "graph is configured" method of the | |
1858 | \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}. | |
1859 | ||
1860 | See the | |
1861 | \ref api-comp-cls-dev-meth-graph-configured "graph is configured" | |
1862 | method. | |
1863 | ||
1864 | @param[in] component_class | |
1865 | Sink component class of which to set the "graph is configured" | |
1866 | method to \bt_p{method}. | |
1867 | @param[in] method | |
1868 | New "graph is configured" method of \bt_p{component_class}. | |
1869 | ||
1870 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1871 | Success. | |
1872 | ||
1873 | @bt_pre_not_null{component_class} | |
1874 | @bt_pre_hot{component_class} | |
1875 | @bt_pre_not_null{method} | |
1876 | */ | |
1877 | extern | |
1878 | bt_component_class_set_method_status | |
1879 | bt_component_class_sink_set_graph_is_configured_method( | |
1880 | bt_component_class_sink *component_class, | |
1881 | bt_component_class_sink_graph_is_configured_method method); | |
1882 | ||
1883 | /*! | |
1884 | @brief | |
1885 | Sets the optional initialization method of the \bt_src_comp_cls | |
1886 | \bt_p{component_class} to \bt_p{method}. | |
1887 | ||
1888 | See the \ref api-comp-cls-dev-meth-init "initialize" method. | |
1889 | ||
1890 | @param[in] component_class | |
1891 | Source component class of which to set the initialization method to | |
1892 | \bt_p{method}. | |
1893 | @param[in] method | |
1894 | New initialization method of \bt_p{component_class}. | |
1895 | ||
1896 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1897 | Success. | |
1898 | ||
1899 | @bt_pre_not_null{component_class} | |
1900 | @bt_pre_hot{component_class} | |
1901 | @bt_pre_not_null{method} | |
1902 | */ | |
1903 | extern bt_component_class_set_method_status | |
1904 | bt_component_class_source_set_initialize_method( | |
1905 | bt_component_class_source *component_class, | |
1906 | bt_component_class_source_initialize_method method); | |
1907 | ||
1908 | /*! | |
1909 | @brief | |
1910 | Sets the optional initialization method of the \bt_flt_comp_cls | |
1911 | \bt_p{component_class} to \bt_p{method}. | |
1912 | ||
1913 | See the \ref api-comp-cls-dev-meth-init "initialize" method. | |
1914 | ||
1915 | @param[in] component_class | |
1916 | Filter component class of which to set the initialization method to | |
1917 | \bt_p{method}. | |
1918 | @param[in] method | |
1919 | New initialization method of \bt_p{component_class}. | |
1920 | ||
1921 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1922 | Success. | |
1923 | ||
1924 | @bt_pre_not_null{component_class} | |
1925 | @bt_pre_hot{component_class} | |
1926 | @bt_pre_not_null{method} | |
1927 | */ | |
1928 | extern bt_component_class_set_method_status | |
1929 | bt_component_class_filter_set_initialize_method( | |
1930 | bt_component_class_filter *component_class, | |
1931 | bt_component_class_filter_initialize_method method); | |
1932 | ||
1933 | /*! | |
1934 | @brief | |
1935 | Sets the optional initialization method of the \bt_sink_comp_cls | |
1936 | \bt_p{component_class} to \bt_p{method}. | |
1937 | ||
1938 | See the \ref api-comp-cls-dev-meth-init "initialize" method. | |
1939 | ||
1940 | @param[in] component_class | |
1941 | Sink component class of which to set the initialization method to | |
1942 | \bt_p{method}. | |
1943 | @param[in] method | |
1944 | New initialization method of \bt_p{component_class}. | |
1945 | ||
1946 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1947 | Success. | |
1948 | ||
1949 | @bt_pre_not_null{component_class} | |
1950 | @bt_pre_hot{component_class} | |
1951 | @bt_pre_not_null{method} | |
1952 | */ | |
1953 | extern | |
1954 | bt_component_class_set_method_status | |
1955 | bt_component_class_sink_set_initialize_method( | |
1956 | bt_component_class_sink *component_class, | |
1957 | bt_component_class_sink_initialize_method method); | |
1958 | ||
1959 | /*! | |
1960 | @brief | |
1961 | Sets the optional "output port connected" method of the | |
1962 | \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}. | |
1963 | ||
1964 | See the | |
1965 | \ref api-comp-cls-dev-meth-oport-connected "output port connected" | |
1966 | method. | |
1967 | ||
1968 | @param[in] component_class | |
1969 | Source component class of which to set the "output port connected" | |
1970 | method to \bt_p{method}. | |
1971 | @param[in] method | |
1972 | New "output port connected" method of \bt_p{component_class}. | |
1973 | ||
1974 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
1975 | Success. | |
1976 | ||
1977 | @bt_pre_not_null{component_class} | |
1978 | @bt_pre_hot{component_class} | |
1979 | @bt_pre_not_null{method} | |
1980 | */ | |
1981 | extern bt_component_class_set_method_status | |
1982 | bt_component_class_source_set_output_port_connected_method( | |
1983 | bt_component_class_source *component_class, | |
1984 | bt_component_class_source_output_port_connected_method method); | |
1985 | ||
1986 | /*! | |
1987 | @brief | |
1988 | Sets the optional "input port connected" method of the | |
1989 | \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}. | |
1990 | ||
1991 | See the | |
1992 | \ref api-comp-cls-dev-meth-iport-connected "input port connected" | |
1993 | method. | |
1994 | ||
1995 | @param[in] component_class | |
1996 | Filter component class of which to set the "input port connected" | |
1997 | method to \bt_p{method}. | |
1998 | @param[in] method | |
1999 | New "input port connected" method of \bt_p{component_class}. | |
2000 | ||
2001 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
2002 | Success. | |
2003 | ||
2004 | @bt_pre_not_null{component_class} | |
2005 | @bt_pre_hot{component_class} | |
2006 | @bt_pre_not_null{method} | |
2007 | */ | |
2008 | extern bt_component_class_set_method_status | |
2009 | bt_component_class_filter_set_input_port_connected_method( | |
2010 | bt_component_class_filter *component_class, | |
2011 | bt_component_class_filter_input_port_connected_method method); | |
2012 | ||
2013 | /*! | |
2014 | @brief | |
2015 | Sets the optional "output port connected" method of the | |
2016 | \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}. | |
2017 | ||
2018 | See the | |
2019 | \ref api-comp-cls-dev-meth-oport-connected "output port connected" | |
2020 | method. | |
2021 | ||
2022 | @param[in] component_class | |
2023 | Filter component class of which to set the "output port connected" | |
2024 | method to \bt_p{method}. | |
2025 | @param[in] method | |
2026 | New "output port connected" method of \bt_p{component_class}. | |
2027 | ||
2028 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
2029 | Success. | |
2030 | ||
2031 | @bt_pre_not_null{component_class} | |
2032 | @bt_pre_hot{component_class} | |
2033 | @bt_pre_not_null{method} | |
2034 | */ | |
2035 | extern bt_component_class_set_method_status | |
2036 | bt_component_class_filter_set_output_port_connected_method( | |
2037 | bt_component_class_filter *component_class, | |
2038 | bt_component_class_filter_output_port_connected_method method); | |
2039 | ||
2040 | /*! | |
2041 | @brief | |
2042 | Sets the optional "input port connected" method of the | |
2043 | \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}. | |
2044 | ||
2045 | See the | |
2046 | \ref api-comp-cls-dev-meth-iport-connected "input port connected" | |
2047 | method. | |
2048 | ||
2049 | @param[in] component_class | |
2050 | Sink component class of which to set the "input port connected" | |
2051 | method to \bt_p{method}. | |
2052 | @param[in] method | |
2053 | New "input port connected" method of \bt_p{component_class}. | |
2054 | ||
2055 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
2056 | Success. | |
2057 | ||
2058 | @bt_pre_not_null{component_class} | |
2059 | @bt_pre_hot{component_class} | |
2060 | @bt_pre_not_null{method} | |
2061 | */ | |
2062 | extern | |
2063 | bt_component_class_set_method_status | |
2064 | bt_component_class_sink_set_input_port_connected_method( | |
2065 | bt_component_class_sink *component_class, | |
2066 | bt_component_class_sink_input_port_connected_method method); | |
2067 | ||
2068 | /*! | |
2069 | @brief | |
2070 | Sets the optional query method of the \bt_src_comp_cls | |
2071 | \bt_p{component_class} to \bt_p{method}. | |
2072 | ||
2073 | See the \ref api-comp-cls-dev-meth-query "query" method. | |
2074 | ||
2075 | @param[in] component_class | |
2076 | Source component class of which to set the query method to | |
2077 | \bt_p{method}. | |
2078 | @param[in] method | |
2079 | New query method of \bt_p{component_class}. | |
2080 | ||
2081 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
2082 | Success. | |
2083 | ||
2084 | @bt_pre_not_null{component_class} | |
2085 | @bt_pre_hot{component_class} | |
2086 | @bt_pre_not_null{method} | |
2087 | */ | |
2088 | extern bt_component_class_set_method_status | |
2089 | bt_component_class_source_set_query_method( | |
2090 | bt_component_class_source *component_class, | |
2091 | bt_component_class_source_query_method method); | |
2092 | ||
2093 | /*! | |
2094 | @brief | |
2095 | Sets the optional query method of the \bt_flt_comp_cls | |
2096 | \bt_p{component_class} to \bt_p{method}. | |
2097 | ||
2098 | See the \ref api-comp-cls-dev-meth-query "query" method. | |
2099 | ||
2100 | @param[in] component_class | |
2101 | Filter component class of which to set the query method to | |
2102 | \bt_p{method}. | |
2103 | @param[in] method | |
2104 | New query method of \bt_p{component_class}. | |
2105 | ||
2106 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
2107 | Success. | |
2108 | ||
2109 | @bt_pre_not_null{component_class} | |
2110 | @bt_pre_hot{component_class} | |
2111 | @bt_pre_not_null{method} | |
2112 | */ | |
2113 | extern bt_component_class_set_method_status | |
2114 | bt_component_class_filter_set_query_method( | |
2115 | bt_component_class_filter *component_class, | |
2116 | bt_component_class_filter_query_method method); | |
2117 | ||
2118 | /*! | |
2119 | @brief | |
2120 | Sets the optional query method of the \bt_sink_comp_cls | |
2121 | \bt_p{component_class} to \bt_p{method}. | |
2122 | ||
2123 | See the \ref api-comp-cls-dev-meth-query "query" method. | |
2124 | ||
2125 | @param[in] component_class | |
2126 | Sink component class of which to set the query method to | |
2127 | \bt_p{method}. | |
2128 | @param[in] method | |
2129 | New query method of \bt_p{component_class}. | |
2130 | ||
2131 | @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK | |
2132 | Success. | |
2133 | ||
2134 | @bt_pre_not_null{component_class} | |
2135 | @bt_pre_hot{component_class} | |
2136 | @bt_pre_not_null{method} | |
2137 | */ | |
2138 | extern | |
2139 | bt_component_class_set_method_status | |
2140 | bt_component_class_sink_set_query_method( | |
2141 | bt_component_class_sink *component_class, | |
2142 | bt_component_class_sink_query_method method); | |
2143 | ||
2144 | /*! @} */ | |
2145 | ||
2146 | /*! | |
2147 | @name Upcast | |
2148 | @{ | |
2149 | */ | |
2150 | ||
2151 | /*! | |
2152 | @brief | |
2153 | \ref api-fund-c-typing "Upcasts" the \bt_src_comp_cls | |
2154 | \bt_p{component_class} to the common #bt_component_class type. | |
2155 | ||
2156 | @param[in] component_class | |
2157 | @parblock | |
2158 | Source component class to upcast. | |
2159 | ||
2160 | Can be \c NULL. | |
2161 | @endparblock | |
2162 | ||
2163 | @returns | |
2164 | \bt_p{component_class} as a common component class. | |
2165 | */ | |
2166 | static inline | |
2167 | bt_component_class *bt_component_class_source_as_component_class( | |
2168 | bt_component_class_source *component_class) | |
2169 | { | |
2170 | return __BT_UPCAST(bt_component_class, component_class); | |
2171 | } | |
2172 | ||
2173 | /*! | |
2174 | @brief | |
2175 | \ref api-fund-c-typing "Upcasts" the \bt_flt_comp_cls | |
2176 | \bt_p{component_class} to the common #bt_component_class type. | |
2177 | ||
2178 | @param[in] component_class | |
2179 | @parblock | |
2180 | Filter component class to upcast. | |
2181 | ||
2182 | Can be \c NULL. | |
2183 | @endparblock | |
2184 | ||
2185 | @returns | |
2186 | \bt_p{component_class} as a common component class. | |
2187 | */ | |
2188 | static inline | |
2189 | bt_component_class *bt_component_class_filter_as_component_class( | |
2190 | bt_component_class_filter *component_class) | |
2191 | { | |
2192 | return __BT_UPCAST(bt_component_class, component_class); | |
2193 | } | |
2194 | ||
2195 | /*! | |
2196 | @brief | |
2197 | \ref api-fund-c-typing "Upcasts" the \bt_sink_comp_cls | |
2198 | \bt_p{component_class} to the common #bt_component_class type. | |
2199 | ||
2200 | @param[in] component_class | |
2201 | @parblock | |
2202 | Sink component class to upcast. | |
2203 | ||
2204 | Can be \c NULL. | |
2205 | @endparblock | |
2206 | ||
2207 | @returns | |
2208 | \bt_p{component_class} as a common component class. | |
2209 | */ | |
2210 | static inline | |
2211 | bt_component_class *bt_component_class_sink_as_component_class( | |
2212 | bt_component_class_sink *component_class) | |
2213 | { | |
2214 | return __BT_UPCAST(bt_component_class, component_class); | |
2215 | } | |
2216 | ||
2217 | /*! @} */ | |
2218 | ||
2219 | /*! @} */ | |
2220 | ||
2221 | #ifdef __cplusplus | |
2222 | } | |
2223 | #endif | |
2224 | ||
2225 | #endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H */ |