2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
7 #ifndef BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H
8 #define BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H
10 #ifndef __BT_IN_BABELTRACE_H
11 # error "Please include <babeltrace2/babeltrace.h> instead."
14 #include <babeltrace2/types.h>
15 #include <babeltrace2/logging.h>
22 @defgroup api-comp-cls-dev Component class development
26 Component class development (creation).
28 A <strong><em>component class</em></strong> is the class of a \bt_comp:
30 @image html component.png
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.
37 A component class has <em>methods</em>. This module essentially
40 - Component class method type definitions.
42 - Component class creation functions, to which you pass a mandatory
43 \bt_msg_iter_cls or method.
45 - Functions to set optional component class methods.
47 - Functions to set optional component class properties.
49 A component class method is a user function. There are two types of
53 <dt>\anchor api-comp-cls-dev-instance-meth Instance method</dt>
55 Operates on an instance (a \bt_comp).
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.
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>),
67 <dt>\anchor api-comp-cls-dev-class-meth Class method</dt>
69 Operates on a component class.
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
76 This is similar to a class method in Python or a static member
77 function in C++, for example.
81 See \ref api-comp-cls-dev-methods "Methods" to learn more about the
82 different types of component class methods.
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.
87 Some library functions \ref api-fund-freezing "freeze" component classes
88 on success. The documentation of those functions indicate this
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.
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.
100 When you create a \bt_sink_comp_cls, you must pass a
101 \ref api-comp-cls-dev-meth-consume "consuming method".
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().
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().
115 <h1>\anchor api-comp-cls-dev-methods Methods</h1>
117 To learn when exactly the methods below are called, see
118 \ref api-graph-lc "Trace processing graph life cycle".
120 The available component class methods to implement are:
126 <th>Component class types
128 <th>Graph is \ref api-graph-lc "configured"?
132 <td>\ref api-comp-cls-dev-instance-meth "Instance"
136 <td>#bt_component_class_sink_consume_method
144 #bt_component_class_source_finalize_method<br>
145 #bt_component_class_filter_finalize_method<br>
146 #bt_component_class_sink_finalize_method
148 <td>Get supported \bt_mip (MIP) versions
149 <td>\ref api-comp-cls-dev-class-meth "Class"
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
158 <td>Graph is \ref api-graph-lc "configured"
163 <td>#bt_component_class_sink_graph_is_configured_method
171 #bt_component_class_source_initialize_method<br>
172 #bt_component_class_filter_initialize_method<br>
173 #bt_component_class_sink_initialize_method
175 <td>\bt_c_iport connected
181 #bt_component_class_filter_input_port_connected_method<br>
182 #bt_component_class_sink_input_port_connected_method
184 <td>\bt_c_oport connected
186 <td>Source and filter
190 #bt_component_class_source_output_port_connected_method<br>
191 #bt_component_class_filter_output_port_connected_method
199 #bt_component_class_source_query_method<br>
200 #bt_component_class_filter_query_method<br>
201 #bt_component_class_sink_query_method
206 \anchor api-comp-cls-dev-meth-consume
210 Called within bt_graph_run() or bt_graph_run_once() to make your
211 \bt_sink_comp consume and process \bt_p_msg.
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.
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.
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.
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.
236 Within this method, you \em cannot add an \bt_iport with
237 bt_self_component_sink_add_input_port().
239 Set this mandatory method at sink component class creation time with
240 bt_component_class_sink_create().
244 \anchor api-comp-cls-dev-meth-fini
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()).
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
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
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.
264 Within this method, you cannot:
267 - Use any \bt_msg_iter.
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().
276 \anchor api-comp-cls-dev-meth-mip
277 Get supported \bt_mip (MIP) versions
280 Called within bt_get_greatest_operative_mip_version() to get the
281 set of MIP versions that an eventual \bt_comp supports.
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.
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.
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.
297 As of \bt_name_version_min_maj, you can only support MIP version 0.
299 Not having this method is equivalent to having one which adds the
300 [0, 0] range to the \bt_p{supported_versions} set.
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().
309 \anchor api-comp-cls-dev-meth-graph-configured
310 Graph is \ref api-graph-lc "configured"
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.
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
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.
327 Within this method, you \em cannot add an \bt_iport with
328 bt_self_component_sink_add_input_port().
330 Set this optional method with
331 bt_component_class_sink_set_graph_is_configured_method().
335 \anchor api-comp-cls-dev-meth-init
339 Called within a <code>bt_graph_add_*_component*()</code> function
340 (see \ref api-graph) to initialize your \bt_comp.
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.
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"
354 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
357 You can create user data and set it as the \bt_self_comp's user data
358 with bt_self_component_set_data().
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.
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().
372 \anchor api-comp-cls-dev-meth-iport-connected
373 \bt_c_iport connected
376 Called within bt_graph_connect_ports() to notify your \bt_comp that
377 one of its input ports has been connected.
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().
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().
391 \anchor api-comp-cls-dev-meth-oport-connected
392 \bt_c_oport connected
395 Called within bt_graph_connect_ports() to notify your \bt_comp that
396 one of its output ports has been connected.
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().
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().
410 \anchor api-comp-cls-dev-meth-query
414 Called within bt_query_executor_query() to make your \bt_comp_cls
415 perform a query operation.
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().
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().
427 On success, set \bt_p{*result} to the query operation's result: a
428 \em new \bt_val reference.
430 If the queried object's name (\bt_p{object_name} parameter) is
432 #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT.
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.
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().
447 In any of the methods above:
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.
454 You can keep a borrowed (weak) \bt_self_comp reference in your
455 component's user data (see bt_self_component_set_data()).
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.
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.
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().
485 Status codes for #bt_component_class_sink_consume_method.
487 typedef enum bt_component_class_sink_consume_method_status
{
492 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
496 Sink component is finished processing.
498 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END
= __BT_FUNC_STATUS_END
,
504 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
510 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
516 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
517 } bt_component_class_sink_consume_method_status
;
521 \bt_c_sink_comp consuming method.
523 See the \ref api-comp-cls-dev-meth-consume "consume" method.
525 @param[in] self_component
526 \bt_c_sink_comp instance.
528 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK
530 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END
532 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN
534 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR
536 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
539 @bt_pre_not_null{self_component}
541 @sa bt_component_class_sink_create() —
542 Creates a \bt_sink_comp.
544 typedef bt_component_class_sink_consume_method_status
545 (*bt_component_class_sink_consume_method
)(
546 bt_self_component_sink
*self_component
);
550 \bt_c_src_comp finalization method.
552 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
554 @param[in] self_component
555 Source component instance.
557 @bt_pre_not_null{self_component}
561 @sa bt_component_class_source_set_finalize_method() —
562 Sets the finalization method of a source component class.
564 typedef void (*bt_component_class_source_finalize_method
)(
565 bt_self_component_source
*self_component
);
569 \bt_c_flt_comp finalization method.
571 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
573 @param[in] self_component
574 Filter component instance.
576 @bt_pre_not_null{self_component}
580 @sa bt_component_class_filter_set_finalize_method() —
581 Sets the finalization method of a filter component class.
583 typedef void (*bt_component_class_filter_finalize_method
)(
584 bt_self_component_filter
*self_component
);
588 \bt_c_sink_comp finalization method.
590 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
592 @param[in] self_component
593 Sink component instance.
595 @bt_pre_not_null{self_component}
599 @sa bt_component_class_sink_set_finalize_method() —
600 Sets the finalization method of a sink component class.
602 typedef void (*bt_component_class_sink_finalize_method
)(
603 bt_self_component_sink
*self_component
);
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.
612 typedef enum bt_component_class_get_supported_mip_versions_method_status
{
617 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
623 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
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
;
634 \bt_c_src_comp_cls \"get supported \bt_mip versions\" method.
636 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
639 As of \bt_name_version_min_maj, you can only add the range [0, 0]
640 to \bt_p{supported_versions}.
642 @param[in] self_component_class
643 Source component class.
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().
650 \bt_p{params} is frozen.
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}.
665 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
667 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
669 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
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}
677 \bt_p{supported_versions} is empty.
679 @sa bt_component_class_source_set_get_supported_mip_versions_method() —
680 Sets the "get supported MIP versions" method of a source
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
);
692 \bt_c_flt_comp_cls \"get supported \bt_mip versions\" method.
694 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
697 As of \bt_name_version_min_maj, you can only add the range [0, 0]
698 to \bt_p{supported_versions}.
700 @param[in] self_component_class
701 Filter component class.
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().
708 \bt_p{params} is frozen.
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}.
723 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
725 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
727 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
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}
735 \bt_p{supported_versions} is empty.
737 @sa bt_component_class_filter_set_get_supported_mip_versions_method() —
738 Sets the "get supported MIP versions" method of a filter
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
);
750 \bt_c_sink_comp_cls \"get supported \bt_mip versions\" method.
752 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
755 As of \bt_name_version_min_maj, you can only add the range [0, 0]
756 to \bt_p{supported_versions}.
758 @param[in] self_component_class
759 Sink component class.
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().
766 \bt_p{params} is frozen.
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}.
781 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
783 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
785 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
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}
793 \bt_p{supported_versions} is empty.
795 @sa bt_component_class_sink_set_get_supported_mip_versions_method() —
796 Sets the "get supported MIP versions" method of a sink
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
);
809 #bt_component_class_sink_graph_is_configured_method.
811 typedef enum bt_component_class_sink_graph_is_configured_method_status
{
816 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
822 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
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
;
833 \bt_c_sink_comp "graph is configured" method.
835 See the \ref api-comp-cls-dev-meth-graph-configured
836 "graph is configured" method.
838 @param[in] self_component
839 Sink component instance.
841 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK
843 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR
845 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR
848 @bt_pre_not_null{self_component}
850 @sa bt_component_class_sink_set_graph_is_configured_method() —
851 Sets the "graph is configured" method of a sink component class.
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
);
860 #bt_component_class_source_initialize_method,
861 #bt_component_class_filter_initialize_method, and
862 #bt_component_class_sink_initialize_method.
864 typedef enum bt_component_class_initialize_method_status
{
869 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
875 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
881 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
882 } bt_component_class_initialize_method_status
;
886 \bt_c_src_comp initialization method.
888 See the \ref api-comp-cls-dev-meth-init "initialize" method.
890 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
893 @param[in] self_component
894 Source component instance.
895 @param[in] configuration
896 Initial component configuration (unused).
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().
903 \bt_p{params} is frozen.
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().
910 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
912 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
914 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
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}
922 @sa bt_component_class_source_set_initialize_method() —
923 Sets the initialization method of a source component class.
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
);
933 \bt_c_flt_comp initialization method.
935 See the \ref api-comp-cls-dev-meth-init "initialize" method.
937 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
940 @param[in] self_component
941 Filter component instance.
942 @param[in] configuration
943 Initial component configuration (unused).
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().
950 \bt_p{params} is frozen.
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().
957 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
959 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
961 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
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}
969 @sa bt_component_class_filter_set_initialize_method() —
970 Sets the initialization method of a filter component class.
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
);
980 \bt_c_sink_comp initialization method.
982 See the \ref api-comp-cls-dev-meth-init "initialize" method.
984 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
987 @param[in] self_component
988 Sink component instance.
989 @param[in] configuration
990 Initial component configuration (unused).
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().
998 \bt_p{params} is frozen.
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().
1005 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
1007 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
1009 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
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}
1017 @sa bt_component_class_sink_set_initialize_method() —
1018 Sets the initialization method of a sink component class.
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
);
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.
1034 typedef enum bt_component_class_port_connected_method_status
{
1039 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1045 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1051 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
1052 } bt_component_class_port_connected_method_status
;
1056 \bt_c_src_comp "output port connected" method.
1059 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
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.
1069 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1071 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1073 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1076 @bt_pre_not_null{self_component}
1077 @bt_pre_not_null{self_port}
1078 @bt_pre_not_null{other_port}
1080 @sa bt_component_class_source_set_output_port_connected_method() —
1081 Sets the "output port connected" method of a source component class.
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
);
1091 \bt_c_flt_comp "input port connected" method.
1094 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
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.
1104 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1106 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1108 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1111 @bt_pre_not_null{self_component}
1112 @bt_pre_not_null{self_port}
1113 @bt_pre_not_null{other_port}
1115 @sa bt_component_class_filter_set_input_port_connected_method() —
1116 Sets the "input port connected" method of a filter component class.
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
);
1126 \bt_c_flt_comp "output port connected" method.
1129 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
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.
1139 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1141 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1143 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1146 @bt_pre_not_null{self_component}
1147 @bt_pre_not_null{self_port}
1148 @bt_pre_not_null{other_port}
1150 @sa bt_component_class_filter_set_output_port_connected_method() —
1151 Sets the "output port connected" method of a filter component class.
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
);
1161 \bt_c_sink_comp "input port connected" method.
1164 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
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.
1174 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1176 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1178 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1181 @bt_pre_not_null{self_component}
1182 @bt_pre_not_null{self_port}
1183 @bt_pre_not_null{other_port}
1185 @sa bt_component_class_sink_set_input_port_connected_method() —
1186 Sets the "input port connected" method of a sink component class.
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
);
1197 #bt_component_class_source_query_method,
1198 #bt_component_class_filter_query_method, and
1199 #bt_component_class_sink_query_method.
1201 typedef enum bt_component_class_query_method_status
{
1206 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1210 Unknown object to query.
1212 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
= __BT_FUNC_STATUS_UNKNOWN_OBJECT
,
1218 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
1224 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1230 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
1231 } bt_component_class_query_method_status
;
1235 \bt_c_src_comp_cls query method.
1237 See the \ref api-comp-cls-dev-meth-query "query" method.
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.
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.
1258 \bt_p{params} is frozen.
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.
1265 <strong>On success</strong>, \bt_p{*result} is
1266 a \em new reference of this query operation's result.
1268 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
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
1274 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1276 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
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}
1286 <strong>On success</strong>, \bt_p{*result} is set.
1288 @sa bt_component_class_source_set_query_method() —
1289 Sets the query method of a source component class.
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
);
1300 \bt_c_flt_comp_cls query method.
1302 See the \ref api-comp-cls-dev-meth-query "query" method.
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.
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.
1323 \bt_p{params} is frozen.
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.
1330 <strong>On success</strong>, \bt_p{*result} is
1331 a \em new reference of this query operation's result.
1333 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
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
1339 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1341 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
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}
1351 <strong>On success</strong>, \bt_p{*result} is set.
1353 @sa bt_component_class_filter_set_query_method() —
1354 Sets the query method of a filter component class.
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
);
1365 \bt_c_sink_comp_cls query method.
1367 See the \ref api-comp-cls-dev-meth-query "query" method.
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.
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.
1388 \bt_p{params} is frozen.
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.
1395 <strong>On success</strong>, \bt_p{*result} is
1396 a \em new reference of this query operation's result.
1398 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
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
1404 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1406 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
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}
1416 <strong>On success</strong>, \bt_p{*result} is set.
1418 @sa bt_component_class_sink_set_query_method() —
1419 Sets the query method of a sink component class.
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
);
1437 Creates a \bt_src_comp_cls named \bt_p{name} and having the
1438 \bt_msg_iter_cls \bt_p{message_iterator_class}.
1440 On success, the returned source component class has the following
1448 <td>\ref api-comp-cls-prop-name "Name"
1451 <td>\ref api-comp-cls-prop-descr "Description"
1454 <td>\ref api-comp-cls-prop-help "Help text"
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.
1464 New source component class reference, or \c NULL on memory error.
1466 @bt_pre_not_null{name}
1467 @bt_pre_not_null{message_iterator_class}
1469 @bt_post_success_frozen{message_iterator_class}
1471 @sa bt_message_iterator_class_create() —
1472 Creates a message iterator class.
1475 bt_component_class_source
*bt_component_class_source_create(
1477 bt_message_iterator_class
*message_iterator_class
);
1481 Creates a \bt_flt_comp_cls named \bt_p{name} and having the
1482 \bt_msg_iter_cls \bt_p{message_iterator_class}.
1484 On success, the returned filter component class has the following
1492 <td>\ref api-comp-cls-prop-name "Name"
1495 <td>\ref api-comp-cls-prop-descr "Description"
1498 <td>\ref api-comp-cls-prop-help "Help text"
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.
1508 New filter component class reference, or \c NULL on memory error.
1510 @bt_pre_not_null{name}
1511 @bt_pre_not_null{message_iterator_class}
1513 @bt_post_success_frozen{message_iterator_class}
1515 @sa bt_message_iterator_class_create() —
1516 Creates a message iterator class.
1519 bt_component_class_filter
*bt_component_class_filter_create(
1521 bt_message_iterator_class
*message_iterator_class
);
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}.
1529 On success, the returned sink component class has the following
1537 <td>\ref api-comp-cls-prop-name "Name"
1540 <td>\ref api-comp-cls-prop-descr "Description"
1543 <td>\ref api-comp-cls-prop-help "Help text"
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.
1553 New sink component class reference, or \c NULL on memory error.
1555 @bt_pre_not_null{name}
1556 @bt_pre_not_null{consume_method}
1559 bt_component_class_sink
*bt_component_class_sink_create(
1561 bt_component_class_sink_consume_method consume_method
);
1566 @name Common properties
1572 Status codes for bt_component_class_set_description().
1574 typedef enum bt_component_class_set_description_status
{
1579 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1585 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1586 } bt_component_class_set_description_status
;
1590 Sets the description of the component class \bt_p{component_class}
1591 to a copy of \bt_p{description}.
1593 See the \ref api-comp-cls-prop-descr "description" property.
1595 @param[in] component_class
1596 Component class of which to set the description to
1598 @param[in] description
1599 New description of \bt_p{component_class} (copied).
1601 @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK
1603 @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
1606 @bt_pre_not_null{component_class}
1607 @bt_pre_hot{component_class}
1608 @bt_pre_not_null{description}
1610 @sa bt_component_class_get_description() —
1611 Returns the description of a component class.
1613 extern bt_component_class_set_description_status
1614 bt_component_class_set_description(bt_component_class
*component_class
,
1615 const char *description
);
1619 Status codes for bt_component_class_set_help().
1621 typedef enum bt_component_class_set_help_status
{
1626 BT_COMPONENT_CLASS_SET_HELP_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1632 BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1633 } bt_component_class_set_help_status
;
1637 Sets the help text of the component class \bt_p{component_class}
1638 to a copy of \bt_p{help_text}.
1640 See the \ref api-comp-cls-prop-help "help text" property.
1642 @param[in] component_class
1643 Component class of which to set the help text to
1645 @param[in] help_text
1646 New help text of \bt_p{component_class} (copied).
1648 @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_OK
1650 @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
1653 @bt_pre_not_null{component_class}
1654 @bt_pre_hot{component_class}
1655 @bt_pre_not_null{help_text}
1657 @sa bt_component_class_get_help() —
1658 Returns the help text of a component class.
1660 extern bt_component_class_set_help_status
bt_component_class_set_help(
1661 bt_component_class
*component_class
,
1662 const char *help_text
);
1667 @name Method setting
1674 <code>bt_component_class_*_set_*_method()</code> functions.
1676 typedef enum bt_component_class_set_method_status
{
1681 BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1682 } bt_component_class_set_method_status
;
1686 Sets the optional finalization method of the \bt_src_comp_cls
1687 \bt_p{component_class} to \bt_p{method}.
1689 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1691 @param[in] component_class
1692 Source component class of which to set the finalization method to
1695 New finalization method of \bt_p{component_class}.
1697 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1700 @bt_pre_not_null{component_class}
1701 @bt_pre_hot{component_class}
1702 @bt_pre_not_null{method}
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
);
1711 Sets the optional finalization method of the \bt_flt_comp_cls
1712 \bt_p{component_class} to \bt_p{method}.
1714 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1716 @param[in] component_class
1717 Filter component class of which to set the finalization method to
1720 New finalization method of \bt_p{component_class}.
1722 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1725 @bt_pre_not_null{component_class}
1726 @bt_pre_hot{component_class}
1727 @bt_pre_not_null{method}
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
);
1736 Sets the optional finalization method of the \bt_sink_comp_cls
1737 \bt_p{component_class} to \bt_p{method}.
1739 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1741 @param[in] component_class
1742 Sink component class of which to set the finalization method to
1745 New finalization method of \bt_p{component_class}.
1747 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1750 @bt_pre_not_null{component_class}
1751 @bt_pre_hot{component_class}
1752 @bt_pre_not_null{method}
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
);
1762 Sets the \"get supported \bt_mip versions\" method of the
1763 \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}.
1765 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1768 @param[in] component_class
1769 Source component class of which to set the "get supported MIP
1770 versions" method to \bt_p{method}.
1772 New "get supported MIP versions" method of \bt_p{component_class}.
1774 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1777 @bt_pre_not_null{component_class}
1778 @bt_pre_hot{component_class}
1779 @bt_pre_not_null{method}
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
);
1788 Sets the \"get supported \bt_mip versions\" method of the
1789 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
1791 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1794 @param[in] component_class
1795 Filter component class of which to set the "get supported MIP
1796 versions" method to \bt_p{method}.
1798 New "get supported MIP versions" method of \bt_p{component_class}.
1800 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1803 @bt_pre_not_null{component_class}
1804 @bt_pre_hot{component_class}
1805 @bt_pre_not_null{method}
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
);
1814 Sets the \"get supported \bt_mip versions\" method of the
1815 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
1817 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1820 @param[in] component_class
1821 Sink component class of which to set the "get supported MIP
1822 versions" method to \bt_p{method}.
1824 New "get supported MIP versions" method of \bt_p{component_class}.
1826 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1829 @bt_pre_not_null{component_class}
1830 @bt_pre_hot{component_class}
1831 @bt_pre_not_null{method}
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
);
1840 Sets the "graph is configured" method of the
1841 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
1844 \ref api-comp-cls-dev-meth-graph-configured "graph is configured"
1847 @param[in] component_class
1848 Sink component class of which to set the "graph is configured"
1849 method to \bt_p{method}.
1851 New "graph is configured" method of \bt_p{component_class}.
1853 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1856 @bt_pre_not_null{component_class}
1857 @bt_pre_hot{component_class}
1858 @bt_pre_not_null{method}
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
);
1868 Sets the optional initialization method of the \bt_src_comp_cls
1869 \bt_p{component_class} to \bt_p{method}.
1871 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1873 @param[in] component_class
1874 Source component class of which to set the initialization method to
1877 New initialization method of \bt_p{component_class}.
1879 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1882 @bt_pre_not_null{component_class}
1883 @bt_pre_hot{component_class}
1884 @bt_pre_not_null{method}
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
);
1893 Sets the optional initialization method of the \bt_flt_comp_cls
1894 \bt_p{component_class} to \bt_p{method}.
1896 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1898 @param[in] component_class
1899 Filter component class of which to set the initialization method to
1902 New initialization method of \bt_p{component_class}.
1904 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1907 @bt_pre_not_null{component_class}
1908 @bt_pre_hot{component_class}
1909 @bt_pre_not_null{method}
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
);
1918 Sets the optional initialization method of the \bt_sink_comp_cls
1919 \bt_p{component_class} to \bt_p{method}.
1921 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1923 @param[in] component_class
1924 Sink component class of which to set the initialization method to
1927 New initialization method of \bt_p{component_class}.
1929 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1932 @bt_pre_not_null{component_class}
1933 @bt_pre_hot{component_class}
1934 @bt_pre_not_null{method}
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
);
1944 Sets the optional "output port connected" method of the
1945 \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}.
1948 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1951 @param[in] component_class
1952 Source component class of which to set the "output port connected"
1953 method to \bt_p{method}.
1955 New "output port connected" method of \bt_p{component_class}.
1957 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1960 @bt_pre_not_null{component_class}
1961 @bt_pre_hot{component_class}
1962 @bt_pre_not_null{method}
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
);
1971 Sets the optional "input port connected" method of the
1972 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
1975 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1978 @param[in] component_class
1979 Filter component class of which to set the "input port connected"
1980 method to \bt_p{method}.
1982 New "input port connected" method of \bt_p{component_class}.
1984 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1987 @bt_pre_not_null{component_class}
1988 @bt_pre_hot{component_class}
1989 @bt_pre_not_null{method}
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
);
1998 Sets the optional "output port connected" method of the
1999 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
2002 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
2005 @param[in] component_class
2006 Filter component class of which to set the "output port connected"
2007 method to \bt_p{method}.
2009 New "output port connected" method of \bt_p{component_class}.
2011 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2014 @bt_pre_not_null{component_class}
2015 @bt_pre_hot{component_class}
2016 @bt_pre_not_null{method}
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
);
2025 Sets the optional "input port connected" method of the
2026 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
2029 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
2032 @param[in] component_class
2033 Sink component class of which to set the "input port connected"
2034 method to \bt_p{method}.
2036 New "input port connected" method of \bt_p{component_class}.
2038 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2041 @bt_pre_not_null{component_class}
2042 @bt_pre_hot{component_class}
2043 @bt_pre_not_null{method}
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
);
2053 Sets the optional query method of the \bt_src_comp_cls
2054 \bt_p{component_class} to \bt_p{method}.
2056 See the \ref api-comp-cls-dev-meth-query "query" method.
2058 @param[in] component_class
2059 Source component class of which to set the query method to
2062 New query method of \bt_p{component_class}.
2064 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2067 @bt_pre_not_null{component_class}
2068 @bt_pre_hot{component_class}
2069 @bt_pre_not_null{method}
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
);
2078 Sets the optional query method of the \bt_flt_comp_cls
2079 \bt_p{component_class} to \bt_p{method}.
2081 See the \ref api-comp-cls-dev-meth-query "query" method.
2083 @param[in] component_class
2084 Filter component class of which to set the query method to
2087 New query method of \bt_p{component_class}.
2089 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2092 @bt_pre_not_null{component_class}
2093 @bt_pre_hot{component_class}
2094 @bt_pre_not_null{method}
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
);
2103 Sets the optional query method of the \bt_sink_comp_cls
2104 \bt_p{component_class} to \bt_p{method}.
2106 See the \ref api-comp-cls-dev-meth-query "query" method.
2108 @param[in] component_class
2109 Sink component class of which to set the query method to
2112 New query method of \bt_p{component_class}.
2114 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2117 @bt_pre_not_null{component_class}
2118 @bt_pre_hot{component_class}
2119 @bt_pre_not_null{method}
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
);
2136 \ref api-fund-c-typing "Upcasts" the \bt_src_comp_cls
2137 \bt_p{component_class} to the common #bt_component_class type.
2139 @param[in] component_class
2141 Source component class to upcast.
2147 \bt_p{component_class} as a common component class.
2150 bt_component_class
*bt_component_class_source_as_component_class(
2151 bt_component_class_source
*component_class
)
2153 return __BT_UPCAST(bt_component_class
, component_class
);
2158 \ref api-fund-c-typing "Upcasts" the \bt_flt_comp_cls
2159 \bt_p{component_class} to the common #bt_component_class type.
2161 @param[in] component_class
2163 Filter component class to upcast.
2169 \bt_p{component_class} as a common component class.
2172 bt_component_class
*bt_component_class_filter_as_component_class(
2173 bt_component_class_filter
*component_class
)
2175 return __BT_UPCAST(bt_component_class
, component_class
);
2180 \ref api-fund-c-typing "Upcasts" the \bt_sink_comp_cls
2181 \bt_p{component_class} to the common #bt_component_class type.
2183 @param[in] component_class
2185 Sink component class to upcast.
2191 \bt_p{component_class} as a common component class.
2194 bt_component_class
*bt_component_class_sink_as_component_class(
2195 bt_component_class_sink
*component_class
)
2197 return __BT_UPCAST(bt_component_class
, component_class
);
2208 #endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H */