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