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 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
16 #include <babeltrace2/types.h>
17 #include <babeltrace2/logging.h>
24 @defgroup api-comp-cls-dev Component class development
28 Component class development (creation).
30 A <strong><em>component class</em></strong> is the class of a \bt_comp:
32 @image html component.png
35 This module (component class development API) offers functions to
36 programatically create component classes. To get the properties of
37 an existing component class, see \ref api-comp-cls.
39 A component class has <em>methods</em>. This module essentially
42 - Component class method type definitions.
44 - Component class creation functions, to which you pass a mandatory
45 \bt_msg_iter_cls or method.
47 - Functions to set optional component class methods.
49 - Functions to set optional component class properties.
51 A component class method is a user function. There are two types of
55 <dt>\anchor api-comp-cls-dev-instance-meth Instance method</dt>
57 Operates on an instance (a \bt_comp).
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.
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>),
69 <dt>\anchor api-comp-cls-dev-class-meth Class method</dt>
71 Operates on a component class.
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
78 This is similar to a class method in Python or a static member
79 function in C++, for example.
83 See \ref api-comp-cls-dev-methods "Methods" to learn more about the
84 different types of component class methods.
86 A component class is a \ref api-fund-shared-object "shared object": see
87 the \ref api-comp-cls module for the reference count functions.
89 Some library functions \ref api-fund-freezing "freeze" component classes
90 on success. The documentation of those functions indicate this
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.
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.
102 When you create a \bt_sink_comp_cls, you must pass a
103 \ref api-comp-cls-dev-meth-consume "consuming method".
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().
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().
117 <h1>\anchor api-comp-cls-dev-methods Methods</h1>
119 To learn when exactly the methods below are called, see
120 \ref api-graph-lc "Trace processing graph life cycle".
122 The available component class methods to implement are:
128 <th>Component class types
130 <th>Graph is \ref api-graph-lc "configured"?
134 <td>\ref api-comp-cls-dev-instance-meth "Instance"
138 <td>#bt_component_class_sink_consume_method
146 #bt_component_class_source_finalize_method<br>
147 #bt_component_class_filter_finalize_method<br>
148 #bt_component_class_sink_finalize_method
150 <td>Get supported \bt_mip (MIP) versions
151 <td>\ref api-comp-cls-dev-class-meth "Class"
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
160 <td>Graph is \ref api-graph-lc "configured"
165 <td>#bt_component_class_sink_graph_is_configured_method
173 #bt_component_class_source_initialize_method<br>
174 #bt_component_class_filter_initialize_method<br>
175 #bt_component_class_sink_initialize_method
177 <td>\bt_c_iport connected
183 #bt_component_class_filter_input_port_connected_method<br>
184 #bt_component_class_sink_input_port_connected_method
186 <td>\bt_c_oport connected
188 <td>Source and filter
192 #bt_component_class_source_output_port_connected_method<br>
193 #bt_component_class_filter_output_port_connected_method
201 #bt_component_class_source_query_method<br>
202 #bt_component_class_filter_query_method<br>
203 #bt_component_class_sink_query_method
208 \anchor api-comp-cls-dev-meth-consume
212 Called within bt_graph_run() or bt_graph_run_once() to make your
213 \bt_sink_comp consume and process \bt_p_msg.
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.
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.
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.
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.
238 Within this method, you \em cannot add an \bt_iport with
239 bt_self_component_sink_add_input_port().
241 Set this mandatory method at sink component class creation time with
242 bt_component_class_sink_create().
246 \anchor api-comp-cls-dev-meth-fini
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()).
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
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
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.
266 Within this method, you cannot:
269 - Use any \bt_msg_iter.
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().
278 \anchor api-comp-cls-dev-meth-mip
279 Get supported \bt_mip (MIP) versions
282 Called within bt_get_greatest_operative_mip_version() to get the
283 set of MIP versions that an eventual \bt_comp supports.
285 This is a \ref api-comp-cls-dev-class-meth "class method" because
286 you can call bt_get_greatest_operative_mip_version() before you even
287 create a trace processing \bt_graph.
289 In this method, you receive initialization parameters as the
290 \bt_p{params} parameter and initialization method data as the
291 \bt_p{initialize_method_data}. Those parameters are set
292 when bt_component_descriptor_set_add_descriptor() is called, before
293 bt_get_greatest_operative_mip_version() is called.
295 Considering those initialization parameters, you need to fill the
296 received \bt_uint_rs \bt_p{supported_versions} with the rangs of
297 MIP versions you support.
299 As of \bt_name_version_min_maj, you can only support MIP version 0.
301 Not having this method is equivalent to having one which adds the
302 [0, 0] range to the \bt_p{supported_versions} set.
304 Set this optional method with
305 bt_component_class_source_set_get_supported_mip_versions_method(),
306 bt_component_class_filter_set_get_supported_mip_versions_method(),
307 and bt_component_class_sink_set_get_supported_mip_versions_method().
311 \anchor api-comp-cls-dev-meth-graph-configured
312 Graph is \ref api-graph-lc "configured"
315 For a given trace processing \bt_graph, called the first time
316 bt_graph_run() or bt_graph_run_once() is called to notify your
317 \bt_sink_comp that the graph is now configured.
319 Within this method, you can create \bt_p_msg_iter on your sink
320 component's \bt_p_iport. You can also manipulate those message
321 iterators, for example get and process initial messages or make
324 This method is called \em after the component's
325 \ref api-comp-cls-dev-meth-init "initialization method"
326 is called. You cannot create a message iterator in the
327 initialization method.
329 Within this method, you \em cannot add an \bt_iport with
330 bt_self_component_sink_add_input_port().
332 Set this optional method with
333 bt_component_class_sink_set_graph_is_configured_method().
337 \anchor api-comp-cls-dev-meth-init
341 Called within a <code>bt_graph_add_*_component*()</code> function
342 (see \ref api-graph) to initialize your \bt_comp.
344 Within this method, you receive the initialization parameters and
345 initialization method data passed to the
346 <code>bt_graph_add_*_component*()</code> function.
348 This method is where you can add initial \bt_p_port to your
349 component with bt_self_component_source_add_output_port(),
350 bt_self_component_filter_add_input_port(),
351 bt_self_component_filter_add_output_port(), or
352 bt_self_component_sink_add_input_port().
353 You can also add ports in the
354 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
356 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
359 You can create user data and set it as the \bt_self_comp's user data
360 with bt_self_component_set_data().
362 If you return #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK from
363 this method, then your component's
364 \ref api-comp-cls-dev-meth-fini "finalization method" will be
365 called, if it exists, when your component is finalized.
367 Set this optional method with
368 bt_component_class_source_set_initialize_method(),
369 bt_component_class_filter_set_initialize_method(),
370 and bt_component_class_sink_set_initialize_method().
374 \anchor api-comp-cls-dev-meth-iport-connected
375 \bt_c_iport connected
378 Called within bt_graph_connect_ports() to notify your \bt_comp that
379 one of its input ports has been connected.
381 Within this method, you can add more \bt_p_port to your
382 component with bt_self_component_source_add_output_port(),
383 bt_self_component_filter_add_input_port(),
384 bt_self_component_filter_add_output_port(), or
385 bt_self_component_sink_add_input_port().
387 Set this optional method with
388 bt_component_class_filter_set_input_port_connected_method() and
389 bt_component_class_sink_set_input_port_connected_method().
393 \anchor api-comp-cls-dev-meth-oport-connected
394 \bt_c_oport connected
397 Called within bt_graph_connect_ports() to notify your \bt_comp that
398 one of its output ports has been connected.
400 Within this method, you can add more \bt_p_port to your
401 component with bt_self_component_source_add_output_port(),
402 bt_self_component_filter_add_input_port(),
403 bt_self_component_filter_add_output_port(), or
404 bt_self_component_sink_add_input_port().
406 Set this optional method with
407 bt_component_class_source_set_output_port_connected_method() and
408 bt_component_class_filter_set_output_port_connected_method().
412 \anchor api-comp-cls-dev-meth-query
416 Called within bt_query_executor_query() to make your \bt_comp_cls
417 perform a query operation.
419 Within this method, you receive the query object name, the
420 query parameters, and the method data passed when the
421 \bt_qexec was created with bt_query_executor_create() or
422 bt_query_executor_create_with_method_data().
424 You also receive a private view of the query executor which you can
425 cast to a \c const query executor with
426 bt_private_query_executor_as_query_executor_const() to access the
427 executor's logging level with bt_query_executor_get_logging_level().
429 On success, set \bt_p{*result} to the query operation's result: a
430 \em new \bt_val reference.
432 If the queried object's name (\bt_p{object_name} parameter) is
434 #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT.
436 If you need to block the thread, you can instead report to
437 try again later to the bt_query_executor_query() caller
438 by returning #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN.
440 Set this optional method with
441 bt_component_class_source_set_query_method(),
442 bt_component_class_filter_set_query_method(), and
443 bt_component_class_sink_set_query_method().
449 In any of the methods above:
451 - \em Never call bt_component_get_ref(),
452 bt_component_source_get_ref(), bt_component_filter_get_ref(), or
453 bt_component_sink_get_ref() on your own (upcasted) \bt_self_comp
454 to avoid reference cycles.
456 You can keep a borrowed (weak) \bt_self_comp reference in your
457 component's user data (see bt_self_component_set_data()).
459 - \em Never call bt_port_get_ref(), bt_port_input_get_ref(), or
460 bt_port_output_get_ref() on one of your own (upcasted)
461 \bt_p_self_comp_port to avoid reference cycles.
463 - \em Never call bt_component_class_get_ref(),
464 bt_component_class_source_get_ref(),
465 bt_component_class_filter_get_ref(), or
466 bt_component_class_sink_get_ref() on your own (upcasted)
467 \bt_comp_cls to avoid reference cycles.
470 Within any \ref api-comp-cls-dev-instance-meth "instance method", you
471 can access the \bt_comp's configured
472 \ref #bt_logging_level "logging level" by first upcasting the
473 \bt_self_comp to the #bt_component type with
474 bt_self_component_as_component(), and then with
475 bt_component_get_logging_level().
487 Status codes for #bt_component_class_sink_consume_method.
489 typedef enum bt_component_class_sink_consume_method_status
{
494 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
498 Sink component is finished processing.
500 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END
= __BT_FUNC_STATUS_END
,
506 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
512 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
518 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
519 } bt_component_class_sink_consume_method_status
;
523 \bt_c_sink_comp consuming method.
525 See the \ref api-comp-cls-dev-meth-consume "consume" method.
527 @param[in] self_component
528 \bt_c_sink_comp instance.
530 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK
532 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END
534 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN
536 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR
538 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
541 @bt_pre_not_null{self_component}
543 @sa bt_component_class_sink_create() —
544 Creates a \bt_sink_comp.
546 typedef bt_component_class_sink_consume_method_status
547 (*bt_component_class_sink_consume_method
)(
548 bt_self_component_sink
*self_component
);
552 \bt_c_src_comp finalization method.
554 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
556 @param[in] self_component
557 Source component instance.
559 @bt_pre_not_null{self_component}
563 @sa bt_component_class_source_set_finalize_method() —
564 Sets the finalization method of a source component class.
566 typedef void (*bt_component_class_source_finalize_method
)(
567 bt_self_component_source
*self_component
);
571 \bt_c_flt_comp finalization method.
573 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
575 @param[in] self_component
576 Filter component instance.
578 @bt_pre_not_null{self_component}
582 @sa bt_component_class_filter_set_finalize_method() —
583 Sets the finalization method of a filter component class.
585 typedef void (*bt_component_class_filter_finalize_method
)(
586 bt_self_component_filter
*self_component
);
590 \bt_c_sink_comp finalization method.
592 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
594 @param[in] self_component
595 Sink component instance.
597 @bt_pre_not_null{self_component}
601 @sa bt_component_class_sink_set_finalize_method() —
602 Sets the finalization method of a sink component class.
604 typedef void (*bt_component_class_sink_finalize_method
)(
605 bt_self_component_sink
*self_component
);
610 #bt_component_class_source_get_supported_mip_versions_method,
611 #bt_component_class_filter_get_supported_mip_versions_method, and
612 #bt_component_class_sink_get_supported_mip_versions_method.
614 typedef enum bt_component_class_get_supported_mip_versions_method_status
{
619 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
625 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
631 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
632 } bt_component_class_get_supported_mip_versions_method_status
;
636 \bt_c_src_comp_cls \"get supported \bt_mip versions\" method.
638 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
641 As of \bt_name_version_min_maj, you can only add the range [0, 0]
642 to \bt_p{supported_versions}.
644 @param[in] self_component_class
645 Source component class.
648 Initialization parameters, as passed as the \bt_p{params} parameter
649 of bt_component_descriptor_set_add_descriptor() or
650 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
652 \bt_p{params} is frozen.
654 @param[in] initialize_method_data
655 User data for this method, as passed as the
656 \bt_p{init_method_data} parameter of
657 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
658 @param[in] logging_level
659 Logging level to use during this method's execution, as passed
660 as the \bt_p{logging_level} parameter of
661 bt_get_greatest_operative_mip_version().
662 @param[in] supported_versions
663 \bt_c_uint_rs to which to add the ranges of supported MIP versions
664 of an eventual instance of \bt_p{self_component_class} considering
665 \bt_p{params} and \bt_p{initialize_method_data}.
667 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
669 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
671 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
674 @bt_pre_not_null{self_component_class}
675 @bt_pre_not_null{params}
676 @bt_pre_is_map_val{params}
677 @bt_pre_not_null{supported_versions}
679 \bt_p{supported_versions} is empty.
681 @sa bt_component_class_source_set_get_supported_mip_versions_method() —
682 Sets the "get supported MIP versions" method of a source
685 typedef bt_component_class_get_supported_mip_versions_method_status
686 (*bt_component_class_source_get_supported_mip_versions_method
)(
687 bt_self_component_class_source
*self_component_class
,
688 const bt_value
*params
, void *initialize_method_data
,
689 bt_logging_level logging_level
,
690 bt_integer_range_set_unsigned
*supported_versions
);
694 \bt_c_flt_comp_cls \"get supported \bt_mip versions\" method.
696 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
699 As of \bt_name_version_min_maj, you can only add the range [0, 0]
700 to \bt_p{supported_versions}.
702 @param[in] self_component_class
703 Filter component class.
706 Initialization parameters, as passed as the \bt_p{params} parameter
707 of bt_component_descriptor_set_add_descriptor() or
708 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
710 \bt_p{params} is frozen.
712 @param[in] initialize_method_data
713 User data for this method, as passed as the
714 \bt_p{init_method_data} parameter of
715 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
716 @param[in] logging_level
717 Logging level to use during this method's execution, as passed
718 as the \bt_p{logging_level} parameter of
719 bt_get_greatest_operative_mip_version().
720 @param[in] supported_versions
721 \bt_c_uint_rs to which to add the ranges of supported MIP versions
722 of an eventual instance of \bt_p{self_component_class} considering
723 \bt_p{params} and \bt_p{initialize_method_data}.
725 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
727 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
729 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
732 @bt_pre_not_null{self_component_class}
733 @bt_pre_not_null{params}
734 @bt_pre_is_map_val{params}
735 @bt_pre_not_null{supported_versions}
737 \bt_p{supported_versions} is empty.
739 @sa bt_component_class_filter_set_get_supported_mip_versions_method() —
740 Sets the "get supported MIP versions" method of a filter
743 typedef bt_component_class_get_supported_mip_versions_method_status
744 (*bt_component_class_filter_get_supported_mip_versions_method
)(
745 bt_self_component_class_filter
*source_component_class
,
746 const bt_value
*params
, void *initialize_method_data
,
747 bt_logging_level logging_level
,
748 bt_integer_range_set_unsigned
*supported_versions
);
752 \bt_c_sink_comp_cls \"get supported \bt_mip versions\" method.
754 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
757 As of \bt_name_version_min_maj, you can only add the range [0, 0]
758 to \bt_p{supported_versions}.
760 @param[in] self_component_class
761 Sink component class.
764 Initialization parameters, as passed as the \bt_p{params} parameter
765 of bt_component_descriptor_set_add_descriptor() or
766 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
768 \bt_p{params} is frozen.
770 @param[in] initialize_method_data
771 User data for this method, as passed as the
772 \bt_p{init_method_data} parameter of
773 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
774 @param[in] logging_level
775 Logging level to use during this method's execution, as passed
776 as the \bt_p{logging_level} parameter of
777 bt_get_greatest_operative_mip_version().
778 @param[in] supported_versions
779 \bt_c_uint_rs to which to add the ranges of supported MIP versions
780 of an eventual instance of \bt_p{self_component_class} considering
781 \bt_p{params} and \bt_p{initialize_method_data}.
783 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
785 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
787 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
790 @bt_pre_not_null{self_component_class}
791 @bt_pre_not_null{params}
792 @bt_pre_is_map_val{params}
793 @bt_pre_not_null{supported_versions}
795 \bt_p{supported_versions} is empty.
797 @sa bt_component_class_sink_set_get_supported_mip_versions_method() —
798 Sets the "get supported MIP versions" method of a sink
801 typedef bt_component_class_get_supported_mip_versions_method_status
802 (*bt_component_class_sink_get_supported_mip_versions_method
)(
803 bt_self_component_class_sink
*source_component_class
,
804 const bt_value
*params
, void *initialize_method_data
,
805 bt_logging_level logging_level
,
806 bt_integer_range_set_unsigned
*supported_versions
);
811 #bt_component_class_sink_graph_is_configured_method.
813 typedef enum bt_component_class_sink_graph_is_configured_method_status
{
818 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
824 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
830 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
831 } bt_component_class_sink_graph_is_configured_method_status
;
835 \bt_c_sink_comp "graph is configured" method.
837 See the \ref api-comp-cls-dev-meth-graph-configured
838 "graph is configured" method.
840 @param[in] self_component
841 Sink component instance.
843 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK
845 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR
847 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR
850 @bt_pre_not_null{self_component}
852 @sa bt_component_class_sink_set_graph_is_configured_method() —
853 Sets the "graph is configured" method of a sink component class.
855 typedef bt_component_class_sink_graph_is_configured_method_status
856 (*bt_component_class_sink_graph_is_configured_method
)(
857 bt_self_component_sink
*self_component
);
862 #bt_component_class_source_initialize_method,
863 #bt_component_class_filter_initialize_method, and
864 #bt_component_class_sink_initialize_method.
866 typedef enum bt_component_class_initialize_method_status
{
871 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
877 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
883 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
884 } bt_component_class_initialize_method_status
;
888 \bt_c_src_comp initialization method.
890 See the \ref api-comp-cls-dev-meth-init "initialize" method.
892 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
895 @param[in] self_component
896 Source component instance.
897 @param[in] configuration
898 Initial component configuration (unused).
901 Initialization parameters, as passed as the \bt_p{params} parameter
902 of bt_graph_add_source_component() or
903 bt_graph_add_source_component_with_initialize_method_data().
905 \bt_p{params} is frozen.
907 @param[in] initialize_method_data
908 User data for this method, as passed as the
909 \bt_p{initialize_method_data} parameter of
910 bt_graph_add_source_component_with_initialize_method_data().
912 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
914 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
916 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
919 @bt_pre_not_null{self_component}
920 @bt_pre_not_null{configuration}
921 @bt_pre_not_null{params}
922 @bt_pre_is_map_val{params}
924 @sa bt_component_class_source_set_initialize_method() —
925 Sets the initialization method of a source component class.
927 typedef bt_component_class_initialize_method_status
928 (*bt_component_class_source_initialize_method
)(
929 bt_self_component_source
*self_component
,
930 bt_self_component_source_configuration
*configuration
,
931 const bt_value
*params
, void *initialize_method_data
);
935 \bt_c_flt_comp initialization method.
937 See the \ref api-comp-cls-dev-meth-init "initialize" method.
939 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
942 @param[in] self_component
943 Filter component instance.
944 @param[in] configuration
945 Initial component configuration (unused).
948 Initialization parameters, as passed as the \bt_p{params} parameter
949 of bt_graph_add_filter_component() or
950 bt_graph_add_filter_component_with_initialize_method_data().
952 \bt_p{params} is frozen.
954 @param[in] initialize_method_data
955 User data for this method, as passed as the
956 \bt_p{initialize_method_data} parameter of
957 bt_graph_add_filter_component_with_initialize_method_data().
959 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
961 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
963 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
966 @bt_pre_not_null{self_component}
967 @bt_pre_not_null{configuration}
968 @bt_pre_not_null{params}
969 @bt_pre_is_map_val{params}
971 @sa bt_component_class_filter_set_initialize_method() —
972 Sets the initialization method of a filter component class.
974 typedef bt_component_class_initialize_method_status
975 (*bt_component_class_filter_initialize_method
)(
976 bt_self_component_filter
*self_component
,
977 bt_self_component_filter_configuration
*configuration
,
978 const bt_value
*params
, void *initialize_method_data
);
982 \bt_c_sink_comp initialization method.
984 See the \ref api-comp-cls-dev-meth-init "initialize" method.
986 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
989 @param[in] self_component
990 Sink component instance.
991 @param[in] configuration
992 Initial component configuration (unused).
995 Initialization parameters, as passed as the \bt_p{params} parameter
996 of bt_graph_add_sink_component(),
997 bt_graph_add_sink_component_with_initialize_method_data(), or
998 bt_graph_add_simple_sink_component().
1000 \bt_p{params} is frozen.
1002 @param[in] initialize_method_data
1003 User data for this method, as passed as the
1004 \bt_p{initialize_method_data} parameter of
1005 bt_graph_add_sink_component_with_initialize_method_data().
1007 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
1009 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
1011 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
1014 @bt_pre_not_null{self_component}
1015 @bt_pre_not_null{configuration}
1016 @bt_pre_not_null{params}
1017 @bt_pre_is_map_val{params}
1019 @sa bt_component_class_sink_set_initialize_method() —
1020 Sets the initialization method of a sink component class.
1022 typedef bt_component_class_initialize_method_status
1023 (*bt_component_class_sink_initialize_method
)(
1024 bt_self_component_sink
*self_component
,
1025 bt_self_component_sink_configuration
*configuration
,
1026 const bt_value
*params
, void *initialize_method_data
);
1031 #bt_component_class_source_output_port_connected_method,
1032 #bt_component_class_filter_input_port_connected_method,
1033 #bt_component_class_filter_output_port_connected_method, and
1034 #bt_component_class_sink_input_port_connected_method.
1036 typedef enum bt_component_class_port_connected_method_status
{
1041 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1047 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1053 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
1054 } bt_component_class_port_connected_method_status
;
1058 \bt_c_src_comp "output port connected" method.
1061 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1064 @param[in] self_component
1065 Source component instance.
1066 @param[in] self_port
1067 Connected \bt_oport of \bt_p{self_component}.
1068 @param[in] other_port
1069 \bt_c_conn's other (input) port.
1071 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1073 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1075 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1078 @bt_pre_not_null{self_component}
1079 @bt_pre_not_null{self_port}
1080 @bt_pre_not_null{other_port}
1082 @sa bt_component_class_source_set_output_port_connected_method() —
1083 Sets the "output port connected" method of a source component class.
1085 typedef bt_component_class_port_connected_method_status
1086 (*bt_component_class_source_output_port_connected_method
)(
1087 bt_self_component_source
*self_component
,
1088 bt_self_component_port_output
*self_port
,
1089 const bt_port_input
*other_port
);
1093 \bt_c_flt_comp "input port connected" method.
1096 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1099 @param[in] self_component
1100 Filter component instance.
1101 @param[in] self_port
1102 Connected \bt_iport of \bt_p{self_component}.
1103 @param[in] other_port
1104 \bt_c_conn's other (output) port.
1106 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1108 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1110 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1113 @bt_pre_not_null{self_component}
1114 @bt_pre_not_null{self_port}
1115 @bt_pre_not_null{other_port}
1117 @sa bt_component_class_filter_set_input_port_connected_method() —
1118 Sets the "input port connected" method of a filter component class.
1120 typedef bt_component_class_port_connected_method_status
1121 (*bt_component_class_filter_input_port_connected_method
)(
1122 bt_self_component_filter
*self_component
,
1123 bt_self_component_port_input
*self_port
,
1124 const bt_port_output
*other_port
);
1128 \bt_c_flt_comp "output port connected" method.
1131 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1134 @param[in] self_component
1135 Filter component instance.
1136 @param[in] self_port
1137 Connected \bt_oport of \bt_p{self_component}.
1138 @param[in] other_port
1139 \bt_c_conn's other (input) port.
1141 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1143 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1145 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1148 @bt_pre_not_null{self_component}
1149 @bt_pre_not_null{self_port}
1150 @bt_pre_not_null{other_port}
1152 @sa bt_component_class_filter_set_output_port_connected_method() —
1153 Sets the "output port connected" method of a filter component class.
1155 typedef bt_component_class_port_connected_method_status
1156 (*bt_component_class_filter_output_port_connected_method
)(
1157 bt_self_component_filter
*self_component
,
1158 bt_self_component_port_output
*self_port
,
1159 const bt_port_input
*other_port
);
1163 \bt_c_sink_comp "input port connected" method.
1166 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1169 @param[in] self_component
1170 Sink component instance.
1171 @param[in] self_port
1172 Connected \bt_iport of \bt_p{self_component}.
1173 @param[in] other_port
1174 \bt_c_conn's other (output) port.
1176 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1178 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1180 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1183 @bt_pre_not_null{self_component}
1184 @bt_pre_not_null{self_port}
1185 @bt_pre_not_null{other_port}
1187 @sa bt_component_class_sink_set_input_port_connected_method() —
1188 Sets the "input port connected" method of a sink component class.
1190 typedef bt_component_class_port_connected_method_status
1191 (*bt_component_class_sink_input_port_connected_method
)(
1192 bt_self_component_sink
*self_component
,
1193 bt_self_component_port_input
*self_port
,
1194 const bt_port_output
*other_port
);
1199 #bt_component_class_source_query_method,
1200 #bt_component_class_filter_query_method, and
1201 #bt_component_class_sink_query_method.
1203 typedef enum bt_component_class_query_method_status
{
1208 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1212 Unknown object to query.
1214 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
= __BT_FUNC_STATUS_UNKNOWN_OBJECT
,
1220 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
1226 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1232 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
1233 } bt_component_class_query_method_status
;
1237 \bt_c_src_comp_cls query method.
1239 See the \ref api-comp-cls-dev-meth-query "query" method.
1241 @param[in] self_component_class
1242 Source component class, as passed as the \bt_p{component_class}
1243 parameter of bt_query_executor_create() or
1244 bt_query_executor_create_with_method_data() when creating this query
1245 operation's \ref api-qexec "executor".
1246 @param[in] query_executor
1247 Private view of this query operation's executor.
1248 @param[in] object_name
1249 Name of the object to query, as passed as the \bt_p{object_name}
1250 parameter of bt_query_executor_create() or
1251 bt_query_executor_create_with_method_data() when creating this query
1252 operation's executor.
1255 Query parameters, as passed as the \bt_p{params}
1256 parameter of bt_query_executor_create() or
1257 bt_query_executor_create_with_method_data() when creating this query
1258 operation's executor.
1260 \bt_p{params} is frozen.
1262 @param[in] method_data
1263 User data for this method, as passed as the \bt_p{method_data}
1264 parameter of bt_query_executor_create_with_method_data() when
1265 creating this query operation's executor.
1267 <strong>On success</strong>, \bt_p{*result} is
1268 a \em new reference of this query operation's result.
1270 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
1272 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
1273 \bt_p{object_name} is unknown.
1274 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
1276 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1278 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
1281 @bt_pre_not_null{self_component_class}
1282 @bt_pre_not_null{query_executor}
1283 @bt_pre_not_null{object_name}
1284 @bt_pre_not_null{params}
1285 @bt_pre_not_null{result}
1288 <strong>On success</strong>, \bt_p{*result} is set.
1290 @sa bt_component_class_source_set_query_method() —
1291 Sets the query method of a source component class.
1293 typedef bt_component_class_query_method_status
1294 (*bt_component_class_source_query_method
)(
1295 bt_self_component_class_source
*self_component_class
,
1296 bt_private_query_executor
*query_executor
,
1297 const char *object_name
, const bt_value
*params
,
1298 void *method_data
, const bt_value
**result
);
1302 \bt_c_flt_comp_cls query method.
1304 See the \ref api-comp-cls-dev-meth-query "query" method.
1306 @param[in] self_component_class
1307 Filter component class, as passed as the \bt_p{component_class}
1308 parameter of bt_query_executor_create() or
1309 bt_query_executor_create_with_method_data() when creating this query
1310 operation's \ref api-qexec "executor".
1311 @param[in] query_executor
1312 Private view of this query operation's executor.
1313 @param[in] object_name
1314 Name of the object to query, as passed as the \bt_p{object_name}
1315 parameter of bt_query_executor_create() or
1316 bt_query_executor_create_with_method_data() when creating this query
1317 operation's executor.
1320 Query parameters, as passed as the \bt_p{params}
1321 parameter of bt_query_executor_create() or
1322 bt_query_executor_create_with_method_data() when creating this query
1323 operation's executor.
1325 \bt_p{params} is frozen.
1327 @param[in] method_data
1328 User data for this method, as passed as the \bt_p{method_data}
1329 parameter of bt_query_executor_create_with_method_data() when
1330 creating this query operation's executor.
1332 <strong>On success</strong>, \bt_p{*result} is
1333 a \em new reference of this query operation's result.
1335 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
1337 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
1338 \bt_p{object_name} is unknown.
1339 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
1341 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1343 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
1346 @bt_pre_not_null{self_component_class}
1347 @bt_pre_not_null{query_executor}
1348 @bt_pre_not_null{object_name}
1349 @bt_pre_not_null{params}
1350 @bt_pre_not_null{result}
1353 <strong>On success</strong>, \bt_p{*result} is set.
1355 @sa bt_component_class_filter_set_query_method() —
1356 Sets the query method of a filter component class.
1358 typedef bt_component_class_query_method_status
1359 (*bt_component_class_filter_query_method
)(
1360 bt_self_component_class_filter
*self_component_class
,
1361 bt_private_query_executor
*query_executor
,
1362 const char *object_name
, const bt_value
*params
,
1363 void *method_data
, const bt_value
**result
);
1367 \bt_c_sink_comp_cls query method.
1369 See the \ref api-comp-cls-dev-meth-query "query" method.
1371 @param[in] self_component_class
1372 Sink component class, as passed as the \bt_p{component_class}
1373 parameter of bt_query_executor_create() or
1374 bt_query_executor_create_with_method_data() when creating this query
1375 operation's \ref api-qexec "executor".
1376 @param[in] query_executor
1377 Private view of this query operation's executor.
1378 @param[in] object_name
1379 Name of the object to query, as passed as the \bt_p{object_name}
1380 parameter of bt_query_executor_create() or
1381 bt_query_executor_create_with_method_data() when creating this query
1382 operation's executor.
1385 Query parameters, as passed as the \bt_p{params}
1386 parameter of bt_query_executor_create() or
1387 bt_query_executor_create_with_method_data() when creating this query
1388 operation's executor.
1390 \bt_p{params} is frozen.
1392 @param[in] method_data
1393 User data for this method, as passed as the \bt_p{method_data}
1394 parameter of bt_query_executor_create_with_method_data() when
1395 creating this query operation's executor.
1397 <strong>On success</strong>, \bt_p{*result} is
1398 a \em new reference of this query operation's result.
1400 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
1402 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
1403 \bt_p{object_name} is unknown.
1404 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
1406 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1408 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
1411 @bt_pre_not_null{self_component_class}
1412 @bt_pre_not_null{query_executor}
1413 @bt_pre_not_null{object_name}
1414 @bt_pre_not_null{params}
1415 @bt_pre_not_null{result}
1418 <strong>On success</strong>, \bt_p{*result} is set.
1420 @sa bt_component_class_sink_set_query_method() —
1421 Sets the query method of a sink component class.
1423 typedef bt_component_class_query_method_status
1424 (*bt_component_class_sink_query_method
)(
1425 bt_self_component_class_sink
*self_component_class
,
1426 bt_private_query_executor
*query_executor
,
1427 const char *object_name
, const bt_value
*params
,
1428 void *method_data
, const bt_value
**result
);
1439 Creates a \bt_src_comp_cls named \bt_p{name} and having the
1440 \bt_msg_iter_cls \bt_p{message_iterator_class}.
1442 On success, the returned source component class has the following
1450 <td>\ref api-comp-cls-prop-name "Name"
1453 <td>\ref api-comp-cls-prop-descr "Description"
1456 <td>\ref api-comp-cls-prop-help "Help text"
1461 Name of the source component class to create (copied).
1462 @param[in] message_iterator_class
1463 Message iterator class of the source component class to create.
1466 New source component class reference, or \c NULL on memory error.
1468 @bt_pre_not_null{name}
1469 @bt_pre_not_null{message_iterator_class}
1471 @bt_post_success_frozen{message_iterator_class}
1473 @sa bt_message_iterator_class_create() —
1474 Creates a message iterator class.
1477 bt_component_class_source
*bt_component_class_source_create(
1479 bt_message_iterator_class
*message_iterator_class
)
1484 Creates a \bt_flt_comp_cls named \bt_p{name} and having the
1485 \bt_msg_iter_cls \bt_p{message_iterator_class}.
1487 On success, the returned filter component class has the following
1495 <td>\ref api-comp-cls-prop-name "Name"
1498 <td>\ref api-comp-cls-prop-descr "Description"
1501 <td>\ref api-comp-cls-prop-help "Help text"
1506 Name of the filter component class to create (copied).
1507 @param[in] message_iterator_class
1508 Message iterator class of the filter component class to create.
1511 New filter component class reference, or \c NULL on memory error.
1513 @bt_pre_not_null{name}
1514 @bt_pre_not_null{message_iterator_class}
1516 @bt_post_success_frozen{message_iterator_class}
1518 @sa bt_message_iterator_class_create() —
1519 Creates a message iterator class.
1522 bt_component_class_filter
*bt_component_class_filter_create(
1524 bt_message_iterator_class
*message_iterator_class
)
1529 Creates a \bt_sink_comp_cls named \bt_p{name} and having the
1530 \ref api-comp-cls-dev-meth-consume "consuming method"
1531 \bt_p{consume_method}.
1533 On success, the returned sink component class has the following
1541 <td>\ref api-comp-cls-prop-name "Name"
1544 <td>\ref api-comp-cls-prop-descr "Description"
1547 <td>\ref api-comp-cls-prop-help "Help text"
1552 Name of the sink component class to create (copied).
1553 @param[in] consume_method
1554 Consuming method of the sink component class to create.
1557 New sink component class reference, or \c NULL on memory error.
1559 @bt_pre_not_null{name}
1560 @bt_pre_not_null{consume_method}
1563 bt_component_class_sink
*bt_component_class_sink_create(
1565 bt_component_class_sink_consume_method consume_method
)
1571 @name Common properties
1577 Status codes for bt_component_class_set_description().
1579 typedef enum bt_component_class_set_description_status
{
1584 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1590 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1591 } bt_component_class_set_description_status
;
1595 Sets the description of the component class \bt_p{component_class}
1596 to a copy of \bt_p{description}.
1598 See the \ref api-comp-cls-prop-descr "description" property.
1600 @param[in] component_class
1601 Component class of which to set the description to
1603 @param[in] description
1604 New description of \bt_p{component_class} (copied).
1606 @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK
1608 @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
1611 @bt_pre_not_null{component_class}
1612 @bt_pre_hot{component_class}
1613 @bt_pre_not_null{description}
1615 @sa bt_component_class_get_description() —
1616 Returns the description of a component class.
1618 extern bt_component_class_set_description_status
1619 bt_component_class_set_description(bt_component_class
*component_class
,
1620 const char *description
) __BT_NOEXCEPT
;
1624 Status codes for bt_component_class_set_help().
1626 typedef enum bt_component_class_set_help_status
{
1631 BT_COMPONENT_CLASS_SET_HELP_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1637 BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1638 } bt_component_class_set_help_status
;
1642 Sets the help text of the component class \bt_p{component_class}
1643 to a copy of \bt_p{help_text}.
1645 See the \ref api-comp-cls-prop-help "help text" property.
1647 @param[in] component_class
1648 Component class of which to set the help text to
1650 @param[in] help_text
1651 New help text of \bt_p{component_class} (copied).
1653 @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_OK
1655 @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
1658 @bt_pre_not_null{component_class}
1659 @bt_pre_hot{component_class}
1660 @bt_pre_not_null{help_text}
1662 @sa bt_component_class_get_help() —
1663 Returns the help text of a component class.
1665 extern bt_component_class_set_help_status
bt_component_class_set_help(
1666 bt_component_class
*component_class
,
1667 const char *help_text
) __BT_NOEXCEPT
;
1672 @name Method setting
1679 <code>bt_component_class_*_set_*_method()</code> functions.
1681 typedef enum bt_component_class_set_method_status
{
1686 BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1687 } bt_component_class_set_method_status
;
1691 Sets the optional finalization method of the \bt_src_comp_cls
1692 \bt_p{component_class} to \bt_p{method}.
1694 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1696 @param[in] component_class
1697 Source component class of which to set the finalization method to
1700 New finalization method of \bt_p{component_class}.
1702 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1705 @bt_pre_not_null{component_class}
1706 @bt_pre_hot{component_class}
1707 @bt_pre_not_null{method}
1709 extern bt_component_class_set_method_status
1710 bt_component_class_source_set_finalize_method(
1711 bt_component_class_source
*component_class
,
1712 bt_component_class_source_finalize_method method
) __BT_NOEXCEPT
;
1716 Sets the optional finalization method of the \bt_flt_comp_cls
1717 \bt_p{component_class} to \bt_p{method}.
1719 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1721 @param[in] component_class
1722 Filter component class of which to set the finalization method to
1725 New finalization method of \bt_p{component_class}.
1727 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1730 @bt_pre_not_null{component_class}
1731 @bt_pre_hot{component_class}
1732 @bt_pre_not_null{method}
1734 extern bt_component_class_set_method_status
1735 bt_component_class_filter_set_finalize_method(
1736 bt_component_class_filter
*component_class
,
1737 bt_component_class_filter_finalize_method method
) __BT_NOEXCEPT
;
1741 Sets the optional finalization method of the \bt_sink_comp_cls
1742 \bt_p{component_class} to \bt_p{method}.
1744 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1746 @param[in] component_class
1747 Sink component class of which to set the finalization method to
1750 New finalization method of \bt_p{component_class}.
1752 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1755 @bt_pre_not_null{component_class}
1756 @bt_pre_hot{component_class}
1757 @bt_pre_not_null{method}
1760 bt_component_class_set_method_status
1761 bt_component_class_sink_set_finalize_method(
1762 bt_component_class_sink
*component_class
,
1763 bt_component_class_sink_finalize_method method
) __BT_NOEXCEPT
;
1767 Sets the \"get supported \bt_mip versions\" method of the
1768 \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}.
1770 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1773 @param[in] component_class
1774 Source component class of which to set the "get supported MIP
1775 versions" method to \bt_p{method}.
1777 New "get supported MIP versions" method of \bt_p{component_class}.
1779 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1782 @bt_pre_not_null{component_class}
1783 @bt_pre_hot{component_class}
1784 @bt_pre_not_null{method}
1786 extern bt_component_class_set_method_status
1787 bt_component_class_source_set_get_supported_mip_versions_method(
1788 bt_component_class_source
*component_class
,
1789 bt_component_class_source_get_supported_mip_versions_method method
)
1794 Sets the \"get supported \bt_mip versions\" method of the
1795 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
1797 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1800 @param[in] component_class
1801 Filter component class of which to set the "get supported MIP
1802 versions" method to \bt_p{method}.
1804 New "get supported MIP versions" method of \bt_p{component_class}.
1806 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1809 @bt_pre_not_null{component_class}
1810 @bt_pre_hot{component_class}
1811 @bt_pre_not_null{method}
1813 extern bt_component_class_set_method_status
1814 bt_component_class_filter_set_get_supported_mip_versions_method(
1815 bt_component_class_filter
*component_class
,
1816 bt_component_class_filter_get_supported_mip_versions_method method
)
1821 Sets the \"get supported \bt_mip versions\" method of the
1822 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
1824 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1827 @param[in] component_class
1828 Sink component class of which to set the "get supported MIP
1829 versions" method to \bt_p{method}.
1831 New "get supported MIP versions" method of \bt_p{component_class}.
1833 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1836 @bt_pre_not_null{component_class}
1837 @bt_pre_hot{component_class}
1838 @bt_pre_not_null{method}
1840 extern bt_component_class_set_method_status
1841 bt_component_class_sink_set_get_supported_mip_versions_method(
1842 bt_component_class_sink
*component_class
,
1843 bt_component_class_sink_get_supported_mip_versions_method method
)
1848 Sets the "graph is configured" method of the
1849 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
1852 \ref api-comp-cls-dev-meth-graph-configured "graph is configured"
1855 @param[in] component_class
1856 Sink component class of which to set the "graph is configured"
1857 method to \bt_p{method}.
1859 New "graph is configured" method of \bt_p{component_class}.
1861 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1864 @bt_pre_not_null{component_class}
1865 @bt_pre_hot{component_class}
1866 @bt_pre_not_null{method}
1869 bt_component_class_set_method_status
1870 bt_component_class_sink_set_graph_is_configured_method(
1871 bt_component_class_sink
*component_class
,
1872 bt_component_class_sink_graph_is_configured_method method
)
1877 Sets the optional initialization method of the \bt_src_comp_cls
1878 \bt_p{component_class} to \bt_p{method}.
1880 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1882 @param[in] component_class
1883 Source component class of which to set the initialization method to
1886 New initialization method of \bt_p{component_class}.
1888 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1891 @bt_pre_not_null{component_class}
1892 @bt_pre_hot{component_class}
1893 @bt_pre_not_null{method}
1895 extern bt_component_class_set_method_status
1896 bt_component_class_source_set_initialize_method(
1897 bt_component_class_source
*component_class
,
1898 bt_component_class_source_initialize_method method
)
1903 Sets the optional initialization method of the \bt_flt_comp_cls
1904 \bt_p{component_class} to \bt_p{method}.
1906 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1908 @param[in] component_class
1909 Filter component class of which to set the initialization method to
1912 New initialization method of \bt_p{component_class}.
1914 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1917 @bt_pre_not_null{component_class}
1918 @bt_pre_hot{component_class}
1919 @bt_pre_not_null{method}
1921 extern bt_component_class_set_method_status
1922 bt_component_class_filter_set_initialize_method(
1923 bt_component_class_filter
*component_class
,
1924 bt_component_class_filter_initialize_method method
)
1929 Sets the optional initialization method of the \bt_sink_comp_cls
1930 \bt_p{component_class} to \bt_p{method}.
1932 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1934 @param[in] component_class
1935 Sink component class of which to set the initialization method to
1938 New initialization method of \bt_p{component_class}.
1940 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1943 @bt_pre_not_null{component_class}
1944 @bt_pre_hot{component_class}
1945 @bt_pre_not_null{method}
1948 bt_component_class_set_method_status
1949 bt_component_class_sink_set_initialize_method(
1950 bt_component_class_sink
*component_class
,
1951 bt_component_class_sink_initialize_method method
) __BT_NOEXCEPT
;
1955 Sets the optional "output port connected" method of the
1956 \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}.
1959 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1962 @param[in] component_class
1963 Source component class of which to set the "output port connected"
1964 method to \bt_p{method}.
1966 New "output port connected" method of \bt_p{component_class}.
1968 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1971 @bt_pre_not_null{component_class}
1972 @bt_pre_hot{component_class}
1973 @bt_pre_not_null{method}
1975 extern bt_component_class_set_method_status
1976 bt_component_class_source_set_output_port_connected_method(
1977 bt_component_class_source
*component_class
,
1978 bt_component_class_source_output_port_connected_method method
)
1983 Sets the optional "input port connected" method of the
1984 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
1987 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1990 @param[in] component_class
1991 Filter component class of which to set the "input port connected"
1992 method to \bt_p{method}.
1994 New "input port connected" method of \bt_p{component_class}.
1996 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1999 @bt_pre_not_null{component_class}
2000 @bt_pre_hot{component_class}
2001 @bt_pre_not_null{method}
2003 extern bt_component_class_set_method_status
2004 bt_component_class_filter_set_input_port_connected_method(
2005 bt_component_class_filter
*component_class
,
2006 bt_component_class_filter_input_port_connected_method method
)
2011 Sets the optional "output port connected" method of the
2012 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
2015 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
2018 @param[in] component_class
2019 Filter component class of which to set the "output port connected"
2020 method to \bt_p{method}.
2022 New "output port connected" method of \bt_p{component_class}.
2024 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2027 @bt_pre_not_null{component_class}
2028 @bt_pre_hot{component_class}
2029 @bt_pre_not_null{method}
2031 extern bt_component_class_set_method_status
2032 bt_component_class_filter_set_output_port_connected_method(
2033 bt_component_class_filter
*component_class
,
2034 bt_component_class_filter_output_port_connected_method method
)
2039 Sets the optional "input port connected" method of the
2040 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
2043 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
2046 @param[in] component_class
2047 Sink component class of which to set the "input port connected"
2048 method to \bt_p{method}.
2050 New "input port connected" method of \bt_p{component_class}.
2052 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2055 @bt_pre_not_null{component_class}
2056 @bt_pre_hot{component_class}
2057 @bt_pre_not_null{method}
2060 bt_component_class_set_method_status
2061 bt_component_class_sink_set_input_port_connected_method(
2062 bt_component_class_sink
*component_class
,
2063 bt_component_class_sink_input_port_connected_method method
)
2068 Sets the optional query method of the \bt_src_comp_cls
2069 \bt_p{component_class} to \bt_p{method}.
2071 See the \ref api-comp-cls-dev-meth-query "query" method.
2073 @param[in] component_class
2074 Source component class of which to set the query method to
2077 New query method of \bt_p{component_class}.
2079 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2082 @bt_pre_not_null{component_class}
2083 @bt_pre_hot{component_class}
2084 @bt_pre_not_null{method}
2086 extern bt_component_class_set_method_status
2087 bt_component_class_source_set_query_method(
2088 bt_component_class_source
*component_class
,
2089 bt_component_class_source_query_method method
) __BT_NOEXCEPT
;
2093 Sets the optional query method of the \bt_flt_comp_cls
2094 \bt_p{component_class} to \bt_p{method}.
2096 See the \ref api-comp-cls-dev-meth-query "query" method.
2098 @param[in] component_class
2099 Filter component class of which to set the query method to
2102 New query method of \bt_p{component_class}.
2104 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2107 @bt_pre_not_null{component_class}
2108 @bt_pre_hot{component_class}
2109 @bt_pre_not_null{method}
2111 extern bt_component_class_set_method_status
2112 bt_component_class_filter_set_query_method(
2113 bt_component_class_filter
*component_class
,
2114 bt_component_class_filter_query_method method
) __BT_NOEXCEPT
;
2118 Sets the optional query method of the \bt_sink_comp_cls
2119 \bt_p{component_class} to \bt_p{method}.
2121 See the \ref api-comp-cls-dev-meth-query "query" method.
2123 @param[in] component_class
2124 Sink component class of which to set the query method to
2127 New query method of \bt_p{component_class}.
2129 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2132 @bt_pre_not_null{component_class}
2133 @bt_pre_hot{component_class}
2134 @bt_pre_not_null{method}
2137 bt_component_class_set_method_status
2138 bt_component_class_sink_set_query_method(
2139 bt_component_class_sink
*component_class
,
2140 bt_component_class_sink_query_method method
) __BT_NOEXCEPT
;
2151 \ref api-fund-c-typing "Upcasts" the \bt_src_comp_cls
2152 \bt_p{component_class} to the common #bt_component_class type.
2154 @param[in] component_class
2156 Source component class to upcast.
2162 \bt_p{component_class} as a common component class.
2165 bt_component_class
*bt_component_class_source_as_component_class(
2166 bt_component_class_source
*component_class
) __BT_NOEXCEPT
2168 return __BT_UPCAST(bt_component_class
, component_class
);
2173 \ref api-fund-c-typing "Upcasts" the \bt_flt_comp_cls
2174 \bt_p{component_class} to the common #bt_component_class type.
2176 @param[in] component_class
2178 Filter component class to upcast.
2184 \bt_p{component_class} as a common component class.
2187 bt_component_class
*bt_component_class_filter_as_component_class(
2188 bt_component_class_filter
*component_class
) __BT_NOEXCEPT
2190 return __BT_UPCAST(bt_component_class
, component_class
);
2195 \ref api-fund-c-typing "Upcasts" the \bt_sink_comp_cls
2196 \bt_p{component_class} to the common #bt_component_class type.
2198 @param[in] component_class
2200 Sink component class to upcast.
2206 \bt_p{component_class} as a common component class.
2209 bt_component_class
*bt_component_class_sink_as_component_class(
2210 bt_component_class_sink
*component_class
) __BT_NOEXCEPT
2212 return __BT_UPCAST(bt_component_class
, component_class
);
2223 #endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H */