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