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 API (component class development API) offers functions to
36 programmatically create component classes. To get the properties of
37 an existing component class, see \ref api-comp-cls.
39 A component class has <em>methods</em>. This API 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 API 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
283 bt_get_greatest_operative_mip_version() or
284 bt_get_greatest_operative_mip_version_with_restriction() to get the
285 set of MIP versions that an eventual \bt_comp supports.
287 This is a \ref api-comp-cls-dev-class-meth "class method" because
289 bt_get_greatest_operative_mip_version() or
290 bt_get_greatest_operative_mip_version_with_restriction() before you
291 even create a trace processing \bt_graph.
293 In this method, you receive initialization parameters as the
294 \bt_p{params} parameter and initialization method data as the
295 \bt_p{initialize_method_data}. Those parameters are set
296 when bt_component_descriptor_set_add_descriptor() is called, before
297 bt_get_greatest_operative_mip_version() or
298 bt_get_greatest_operative_mip_version_with_restriction() is called.
300 Considering those initialization parameters, you need to fill the
301 received \bt_uint_rs \bt_p{supported_versions} with the rangs of
302 MIP versions you support.
304 As of \bt_name_version_min_maj, you can only support MIP version 0.
306 Not having this method is equivalent to having one which adds the
307 [0, 0] range to the \bt_p{supported_versions} set.
309 Set this optional method with
310 bt_component_class_source_set_get_supported_mip_versions_method(),
311 bt_component_class_filter_set_get_supported_mip_versions_method(),
312 and bt_component_class_sink_set_get_supported_mip_versions_method().
316 \anchor api-comp-cls-dev-meth-graph-configured
317 Graph is \ref api-graph-lc "configured"
320 For a given trace processing \bt_graph, called the first time
321 bt_graph_run() or bt_graph_run_once() is called to notify your
322 \bt_sink_comp that the graph is now configured.
324 Within this method, you can create \bt_p_msg_iter on your sink
325 component's \bt_p_iport. You can also manipulate those message
326 iterators, for example get and process initial messages or make
329 This method is called \em after the component's
330 \ref api-comp-cls-dev-meth-init "initialization method"
331 is called. You cannot create a message iterator in the
332 initialization method.
334 Within this method, you \em cannot add an \bt_iport with
335 bt_self_component_sink_add_input_port().
337 Set this optional method with
338 bt_component_class_sink_set_graph_is_configured_method().
342 \anchor api-comp-cls-dev-meth-init
346 Called within a <code>bt_graph_add_*_component*()</code> function
347 (see \ref api-graph) to initialize your \bt_comp.
349 Within this method, you receive the initialization parameters and
350 initialization method data passed to the
351 <code>bt_graph_add_*_component*()</code> function.
353 This method is where you can add initial \bt_p_port to your
354 component with bt_self_component_source_add_output_port(),
355 bt_self_component_filter_add_input_port(),
356 bt_self_component_filter_add_output_port(), or
357 bt_self_component_sink_add_input_port().
358 You can also add ports in the
359 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
361 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
364 You can create user data and set it as the \bt_self_comp's user data
365 with bt_self_component_set_data().
367 If you return #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK from
368 this method, then your component's
369 \ref api-comp-cls-dev-meth-fini "finalization method" will be
370 called, if it exists, when your component is finalized.
372 Set this optional method with
373 bt_component_class_source_set_initialize_method(),
374 bt_component_class_filter_set_initialize_method(),
375 and bt_component_class_sink_set_initialize_method().
379 \anchor api-comp-cls-dev-meth-iport-connected
380 \bt_c_iport connected
383 Called within bt_graph_connect_ports() to notify your \bt_comp that
384 one of its input ports has been connected.
386 Within this method, you can add more \bt_p_port to your
387 component with bt_self_component_source_add_output_port(),
388 bt_self_component_filter_add_input_port(),
389 bt_self_component_filter_add_output_port(), or
390 bt_self_component_sink_add_input_port().
392 Set this optional method with
393 bt_component_class_filter_set_input_port_connected_method() and
394 bt_component_class_sink_set_input_port_connected_method().
398 \anchor api-comp-cls-dev-meth-oport-connected
399 \bt_c_oport connected
402 Called within bt_graph_connect_ports() to notify your \bt_comp that
403 one of its output ports has been connected.
405 Within this method, you can add more \bt_p_port to your
406 component with bt_self_component_source_add_output_port(),
407 bt_self_component_filter_add_input_port(),
408 bt_self_component_filter_add_output_port(), or
409 bt_self_component_sink_add_input_port().
411 Set this optional method with
412 bt_component_class_source_set_output_port_connected_method() and
413 bt_component_class_filter_set_output_port_connected_method().
417 \anchor api-comp-cls-dev-meth-query
421 Called within bt_query_executor_query() to make your \bt_comp_cls
422 perform a query operation.
424 Within this method, you receive the query object name, the
425 query parameters, and the method data passed when the
426 \bt_qexec was created with bt_query_executor_create() or
427 bt_query_executor_create_with_method_data().
429 You also receive a private view of the query executor which you can
430 cast to a \c const query executor with
431 bt_private_query_executor_as_query_executor_const() to access the
432 executor's logging level with bt_query_executor_get_logging_level().
434 On success, set \bt_p{*result} to the query operation's result: a
435 \em new \bt_val reference.
437 If the queried object's name (\bt_p{object_name} parameter) is
439 #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT.
441 If you need to block the thread, you can instead report to
442 try again later to the bt_query_executor_query() caller
443 by returning #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN.
445 Set this optional method with
446 bt_component_class_source_set_query_method(),
447 bt_component_class_filter_set_query_method(), and
448 bt_component_class_sink_set_query_method().
454 In any of the methods above:
456 - \em Never call bt_component_get_ref(),
457 bt_component_source_get_ref(), bt_component_filter_get_ref(), or
458 bt_component_sink_get_ref() on your own (upcasted) \bt_self_comp
459 to avoid reference cycles.
461 You can keep a borrowed (weak) \bt_self_comp reference in your
462 component's user data (see bt_self_component_set_data()).
464 - \em Never call bt_port_get_ref(), bt_port_input_get_ref(), or
465 bt_port_output_get_ref() on one of your own (upcasted)
466 \bt_p_self_comp_port to avoid reference cycles.
468 - \em Never call bt_component_class_get_ref(),
469 bt_component_class_source_get_ref(),
470 bt_component_class_filter_get_ref(), or
471 bt_component_class_sink_get_ref() on your own (upcasted)
472 \bt_comp_cls to avoid reference cycles.
475 Within any \ref api-comp-cls-dev-instance-meth "instance method", you
476 can access the \bt_comp's configured
477 \ref #bt_logging_level "logging level" by first upcasting the
478 \bt_self_comp to the #bt_component type with
479 bt_self_component_as_component(), and then with
480 bt_component_get_logging_level().
492 Status codes for #bt_component_class_sink_consume_method.
494 typedef enum bt_component_class_sink_consume_method_status
{
499 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
503 Sink component is finished processing.
505 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END
= __BT_FUNC_STATUS_END
,
511 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
517 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
523 BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
524 } bt_component_class_sink_consume_method_status
;
528 \bt_c_sink_comp consuming method.
530 See the \ref api-comp-cls-dev-meth-consume "consume" method.
532 @param[in] self_component
533 \bt_c_sink_comp instance.
535 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK
537 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_END
539 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_AGAIN
541 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_MEMORY_ERROR
543 @retval #BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_ERROR
546 @bt_pre_not_null{self_component}
548 @sa bt_component_class_sink_create() —
549 Creates a \bt_sink_comp.
551 typedef bt_component_class_sink_consume_method_status
552 (*bt_component_class_sink_consume_method
)(
553 bt_self_component_sink
*self_component
);
557 \bt_c_src_comp finalization method.
559 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
561 @param[in] self_component
562 Source component instance.
564 @bt_pre_not_null{self_component}
568 @sa bt_component_class_source_set_finalize_method() —
569 Sets the finalization method of a source component class.
571 typedef void (*bt_component_class_source_finalize_method
)(
572 bt_self_component_source
*self_component
);
576 \bt_c_flt_comp finalization method.
578 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
580 @param[in] self_component
581 Filter component instance.
583 @bt_pre_not_null{self_component}
587 @sa bt_component_class_filter_set_finalize_method() —
588 Sets the finalization method of a filter component class.
590 typedef void (*bt_component_class_filter_finalize_method
)(
591 bt_self_component_filter
*self_component
);
595 \bt_c_sink_comp finalization method.
597 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
599 @param[in] self_component
600 Sink component instance.
602 @bt_pre_not_null{self_component}
606 @sa bt_component_class_sink_set_finalize_method() —
607 Sets the finalization method of a sink component class.
609 typedef void (*bt_component_class_sink_finalize_method
)(
610 bt_self_component_sink
*self_component
);
615 #bt_component_class_source_get_supported_mip_versions_method,
616 #bt_component_class_filter_get_supported_mip_versions_method, and
617 #bt_component_class_sink_get_supported_mip_versions_method.
619 typedef enum bt_component_class_get_supported_mip_versions_method_status
{
624 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
630 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
636 BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
637 } bt_component_class_get_supported_mip_versions_method_status
;
641 \bt_c_src_comp_cls \"get supported \bt_mip versions\" method.
643 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
646 As of \bt_name_version_min_maj, you can only add the range [0, 0]
647 to \bt_p{supported_versions}.
649 @param[in] self_component_class
650 Source component class.
653 Initialization parameters, as passed as the \bt_p{params} parameter
654 of bt_component_descriptor_set_add_descriptor() or
655 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
657 \bt_p{params} is frozen.
659 @param[in] initialize_method_data
660 User data for this method, as passed as the
661 \bt_p{init_method_data} parameter of
662 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
663 @param[in] logging_level
664 Logging level to use during this method's execution, as passed
665 as the \bt_p{logging_level} parameter of
666 bt_get_greatest_operative_mip_version() and
667 bt_get_greatest_operative_mip_version_with_restriction().
668 @param[in] supported_versions
669 \bt_c_uint_rs to which to add the ranges of supported MIP versions
670 of an eventual instance of \bt_p{self_component_class} considering
671 \bt_p{params} and \bt_p{initialize_method_data}.
673 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
675 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
677 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
680 @bt_pre_not_null{self_component_class}
681 @bt_pre_not_null{params}
682 @bt_pre_is_map_val{params}
683 @bt_pre_not_null{supported_versions}
685 \bt_p{supported_versions} is empty.
687 @sa bt_component_class_source_set_get_supported_mip_versions_method() —
688 Sets the "get supported MIP versions" method of a source
691 typedef bt_component_class_get_supported_mip_versions_method_status
692 (*bt_component_class_source_get_supported_mip_versions_method
)(
693 bt_self_component_class_source
*self_component_class
,
694 const bt_value
*params
, void *initialize_method_data
,
695 bt_logging_level logging_level
,
696 bt_integer_range_set_unsigned
*supported_versions
);
700 \bt_c_flt_comp_cls \"get supported \bt_mip versions\" method.
702 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
705 As of \bt_name_version_min_maj, you can only add the range [0, 0]
706 to \bt_p{supported_versions}.
708 @param[in] self_component_class
709 Filter component class.
712 Initialization parameters, as passed as the \bt_p{params} parameter
713 of bt_component_descriptor_set_add_descriptor() or
714 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
716 \bt_p{params} is frozen.
718 @param[in] initialize_method_data
719 User data for this method, as passed as the
720 \bt_p{init_method_data} parameter of
721 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
722 @param[in] logging_level
723 Logging level to use during this method's execution, as passed
724 as the \bt_p{logging_level} parameter of
725 bt_get_greatest_operative_mip_version() and
726 bt_get_greatest_operative_mip_version_with_restriction().
727 @param[in] supported_versions
728 \bt_c_uint_rs to which to add the ranges of supported MIP versions
729 of an eventual instance of \bt_p{self_component_class} considering
730 \bt_p{params} and \bt_p{initialize_method_data}.
732 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
734 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
736 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
739 @bt_pre_not_null{self_component_class}
740 @bt_pre_not_null{params}
741 @bt_pre_is_map_val{params}
742 @bt_pre_not_null{supported_versions}
744 \bt_p{supported_versions} is empty.
746 @sa bt_component_class_filter_set_get_supported_mip_versions_method() —
747 Sets the "get supported MIP versions" method of a filter
750 typedef bt_component_class_get_supported_mip_versions_method_status
751 (*bt_component_class_filter_get_supported_mip_versions_method
)(
752 bt_self_component_class_filter
*source_component_class
,
753 const bt_value
*params
, void *initialize_method_data
,
754 bt_logging_level logging_level
,
755 bt_integer_range_set_unsigned
*supported_versions
);
759 \bt_c_sink_comp_cls \"get supported \bt_mip versions\" method.
761 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
764 As of \bt_name_version_min_maj, you can only add the range [0, 0]
765 to \bt_p{supported_versions}.
767 @param[in] self_component_class
768 Sink component class.
771 Initialization parameters, as passed as the \bt_p{params} parameter
772 of bt_component_descriptor_set_add_descriptor() or
773 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
775 \bt_p{params} is frozen.
777 @param[in] initialize_method_data
778 User data for this method, as passed as the
779 \bt_p{init_method_data} parameter of
780 bt_component_descriptor_set_add_descriptor_with_initialize_method_data().
781 @param[in] logging_level
782 Logging level to use during this method's execution, as passed
783 as the \bt_p{logging_level} parameter of
784 bt_get_greatest_operative_mip_version() and
785 bt_get_greatest_operative_mip_version_with_restriction().
786 @param[in] supported_versions
787 \bt_c_uint_rs to which to add the ranges of supported MIP versions
788 of an eventual instance of \bt_p{self_component_class} considering
789 \bt_p{params} and \bt_p{initialize_method_data}.
791 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_OK
793 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_MEMORY_ERROR
795 @retval #BT_COMPONENT_CLASS_GET_SUPPORTED_MIP_VERSIONS_METHOD_STATUS_ERROR
798 @bt_pre_not_null{self_component_class}
799 @bt_pre_not_null{params}
800 @bt_pre_is_map_val{params}
801 @bt_pre_not_null{supported_versions}
803 \bt_p{supported_versions} is empty.
805 @sa bt_component_class_sink_set_get_supported_mip_versions_method() —
806 Sets the "get supported MIP versions" method of a sink
809 typedef bt_component_class_get_supported_mip_versions_method_status
810 (*bt_component_class_sink_get_supported_mip_versions_method
)(
811 bt_self_component_class_sink
*source_component_class
,
812 const bt_value
*params
, void *initialize_method_data
,
813 bt_logging_level logging_level
,
814 bt_integer_range_set_unsigned
*supported_versions
);
819 #bt_component_class_sink_graph_is_configured_method.
821 typedef enum bt_component_class_sink_graph_is_configured_method_status
{
826 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
832 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
838 BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
839 } bt_component_class_sink_graph_is_configured_method_status
;
843 \bt_c_sink_comp "graph is configured" method.
845 See the \ref api-comp-cls-dev-meth-graph-configured
846 "graph is configured" method.
848 @param[in] self_component
849 Sink component instance.
851 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_OK
853 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_MEMORY_ERROR
855 @retval #BT_COMPONENT_CLASS_SINK_GRAPH_IS_CONFIGURED_METHOD_STATUS_ERROR
858 @bt_pre_not_null{self_component}
860 @sa bt_component_class_sink_set_graph_is_configured_method() —
861 Sets the "graph is configured" method of a sink component class.
863 typedef bt_component_class_sink_graph_is_configured_method_status
864 (*bt_component_class_sink_graph_is_configured_method
)(
865 bt_self_component_sink
*self_component
);
870 #bt_component_class_source_initialize_method,
871 #bt_component_class_filter_initialize_method, and
872 #bt_component_class_sink_initialize_method.
874 typedef enum bt_component_class_initialize_method_status
{
879 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
885 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
891 BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
892 } bt_component_class_initialize_method_status
;
896 \bt_c_src_comp initialization method.
898 See the \ref api-comp-cls-dev-meth-init "initialize" method.
900 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
903 @param[in] self_component
904 Source component instance.
905 @param[in] configuration
906 Initial component configuration (unused).
909 Initialization parameters, as passed as the \bt_p{params} parameter
910 of bt_graph_add_source_component() or
911 bt_graph_add_source_component_with_initialize_method_data().
913 \bt_p{params} is frozen.
915 @param[in] initialize_method_data
916 User data for this method, as passed as the
917 \bt_p{initialize_method_data} parameter of
918 bt_graph_add_source_component_with_initialize_method_data().
920 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
922 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
924 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
927 @bt_pre_not_null{self_component}
928 @bt_pre_not_null{configuration}
929 @bt_pre_not_null{params}
930 @bt_pre_is_map_val{params}
932 @sa bt_component_class_source_set_initialize_method() —
933 Sets the initialization method of a source component class.
935 typedef bt_component_class_initialize_method_status
936 (*bt_component_class_source_initialize_method
)(
937 bt_self_component_source
*self_component
,
938 bt_self_component_source_configuration
*configuration
,
939 const bt_value
*params
, void *initialize_method_data
);
943 \bt_c_flt_comp initialization method.
945 See the \ref api-comp-cls-dev-meth-init "initialize" method.
947 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
950 @param[in] self_component
951 Filter component instance.
952 @param[in] configuration
953 Initial component configuration (unused).
956 Initialization parameters, as passed as the \bt_p{params} parameter
957 of bt_graph_add_filter_component() or
958 bt_graph_add_filter_component_with_initialize_method_data().
960 \bt_p{params} is frozen.
962 @param[in] initialize_method_data
963 User data for this method, as passed as the
964 \bt_p{initialize_method_data} parameter of
965 bt_graph_add_filter_component_with_initialize_method_data().
967 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
969 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
971 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
974 @bt_pre_not_null{self_component}
975 @bt_pre_not_null{configuration}
976 @bt_pre_not_null{params}
977 @bt_pre_is_map_val{params}
979 @sa bt_component_class_filter_set_initialize_method() —
980 Sets the initialization method of a filter component class.
982 typedef bt_component_class_initialize_method_status
983 (*bt_component_class_filter_initialize_method
)(
984 bt_self_component_filter
*self_component
,
985 bt_self_component_filter_configuration
*configuration
,
986 const bt_value
*params
, void *initialize_method_data
);
990 \bt_c_sink_comp initialization method.
992 See the \ref api-comp-cls-dev-meth-init "initialize" method.
994 As of \bt_name_version_min_maj, the \bt_p{configuration} parameter
997 @param[in] self_component
998 Sink component instance.
999 @param[in] configuration
1000 Initial component configuration (unused).
1003 Initialization parameters, as passed as the \bt_p{params} parameter
1004 of bt_graph_add_sink_component(),
1005 bt_graph_add_sink_component_with_initialize_method_data(), or
1006 bt_graph_add_simple_sink_component().
1008 \bt_p{params} is frozen.
1010 @param[in] initialize_method_data
1011 User data for this method, as passed as the
1012 \bt_p{initialize_method_data} parameter of
1013 bt_graph_add_sink_component_with_initialize_method_data().
1015 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK
1017 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_MEMORY_ERROR
1019 @retval #BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_ERROR
1022 @bt_pre_not_null{self_component}
1023 @bt_pre_not_null{configuration}
1024 @bt_pre_not_null{params}
1025 @bt_pre_is_map_val{params}
1027 @sa bt_component_class_sink_set_initialize_method() —
1028 Sets the initialization method of a sink component class.
1030 typedef bt_component_class_initialize_method_status
1031 (*bt_component_class_sink_initialize_method
)(
1032 bt_self_component_sink
*self_component
,
1033 bt_self_component_sink_configuration
*configuration
,
1034 const bt_value
*params
, void *initialize_method_data
);
1039 #bt_component_class_source_output_port_connected_method,
1040 #bt_component_class_filter_input_port_connected_method,
1041 #bt_component_class_filter_output_port_connected_method, and
1042 #bt_component_class_sink_input_port_connected_method.
1044 typedef enum bt_component_class_port_connected_method_status
{
1049 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1055 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1061 BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
1062 } bt_component_class_port_connected_method_status
;
1066 \bt_c_src_comp "output port connected" method.
1069 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1072 @param[in] self_component
1073 Source component instance.
1074 @param[in] self_port
1075 Connected \bt_oport of \bt_p{self_component}.
1076 @param[in] other_port
1077 \bt_c_conn's other (input) port.
1079 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1081 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1083 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1086 @bt_pre_not_null{self_component}
1087 @bt_pre_not_null{self_port}
1088 @bt_pre_not_null{other_port}
1090 @sa bt_component_class_source_set_output_port_connected_method() —
1091 Sets the "output port connected" method of a source component class.
1093 typedef bt_component_class_port_connected_method_status
1094 (*bt_component_class_source_output_port_connected_method
)(
1095 bt_self_component_source
*self_component
,
1096 bt_self_component_port_output
*self_port
,
1097 const bt_port_input
*other_port
);
1101 \bt_c_flt_comp "input port connected" method.
1104 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1107 @param[in] self_component
1108 Filter component instance.
1109 @param[in] self_port
1110 Connected \bt_iport of \bt_p{self_component}.
1111 @param[in] other_port
1112 \bt_c_conn's other (output) port.
1114 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1116 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1118 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1121 @bt_pre_not_null{self_component}
1122 @bt_pre_not_null{self_port}
1123 @bt_pre_not_null{other_port}
1125 @sa bt_component_class_filter_set_input_port_connected_method() —
1126 Sets the "input port connected" method of a filter component class.
1128 typedef bt_component_class_port_connected_method_status
1129 (*bt_component_class_filter_input_port_connected_method
)(
1130 bt_self_component_filter
*self_component
,
1131 bt_self_component_port_input
*self_port
,
1132 const bt_port_output
*other_port
);
1136 \bt_c_flt_comp "output port connected" method.
1139 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1142 @param[in] self_component
1143 Filter component instance.
1144 @param[in] self_port
1145 Connected \bt_oport of \bt_p{self_component}.
1146 @param[in] other_port
1147 \bt_c_conn's other (input) port.
1149 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1151 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1153 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1156 @bt_pre_not_null{self_component}
1157 @bt_pre_not_null{self_port}
1158 @bt_pre_not_null{other_port}
1160 @sa bt_component_class_filter_set_output_port_connected_method() —
1161 Sets the "output port connected" method of a filter component class.
1163 typedef bt_component_class_port_connected_method_status
1164 (*bt_component_class_filter_output_port_connected_method
)(
1165 bt_self_component_filter
*self_component
,
1166 bt_self_component_port_output
*self_port
,
1167 const bt_port_input
*other_port
);
1171 \bt_c_sink_comp "input port connected" method.
1174 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1177 @param[in] self_component
1178 Sink component instance.
1179 @param[in] self_port
1180 Connected \bt_iport of \bt_p{self_component}.
1181 @param[in] other_port
1182 \bt_c_conn's other (output) port.
1184 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_OK
1186 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_MEMORY_ERROR
1188 @retval #BT_COMPONENT_CLASS_PORT_CONNECTED_METHOD_STATUS_ERROR
1191 @bt_pre_not_null{self_component}
1192 @bt_pre_not_null{self_port}
1193 @bt_pre_not_null{other_port}
1195 @sa bt_component_class_sink_set_input_port_connected_method() —
1196 Sets the "input port connected" method of a sink component class.
1198 typedef bt_component_class_port_connected_method_status
1199 (*bt_component_class_sink_input_port_connected_method
)(
1200 bt_self_component_sink
*self_component
,
1201 bt_self_component_port_input
*self_port
,
1202 const bt_port_output
*other_port
);
1207 #bt_component_class_source_query_method,
1208 #bt_component_class_filter_query_method, and
1209 #bt_component_class_sink_query_method.
1211 typedef enum bt_component_class_query_method_status
{
1216 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1220 Unknown object to query.
1222 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
= __BT_FUNC_STATUS_UNKNOWN_OBJECT
,
1228 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
= __BT_FUNC_STATUS_AGAIN
,
1234 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1240 BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
= __BT_FUNC_STATUS_ERROR
,
1241 } bt_component_class_query_method_status
;
1245 \bt_c_src_comp_cls query method.
1247 See the \ref api-comp-cls-dev-meth-query "query" method.
1249 @param[in] self_component_class
1250 Source component class, as passed as the \bt_p{component_class}
1251 parameter of bt_query_executor_create() or
1252 bt_query_executor_create_with_method_data() when creating this query
1253 operation's \ref api-qexec "executor".
1254 @param[in] query_executor
1255 Private view of this query operation's executor.
1256 @param[in] object_name
1257 Name of the object to query, as passed as the \bt_p{object_name}
1258 parameter of bt_query_executor_create() or
1259 bt_query_executor_create_with_method_data() when creating this query
1260 operation's executor.
1263 Query parameters, as passed as the \bt_p{params}
1264 parameter of bt_query_executor_create() or
1265 bt_query_executor_create_with_method_data() when creating this query
1266 operation's executor.
1268 \bt_p{params} is frozen.
1270 @param[in] method_data
1271 User data for this method, as passed as the \bt_p{method_data}
1272 parameter of bt_query_executor_create_with_method_data() when
1273 creating this query operation's executor.
1275 <strong>On success</strong>, \bt_p{*result} is
1276 a \em new reference of this query operation's result.
1278 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
1280 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
1281 \bt_p{object_name} is unknown.
1282 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
1284 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1286 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
1289 @bt_pre_not_null{self_component_class}
1290 @bt_pre_not_null{query_executor}
1291 @bt_pre_not_null{object_name}
1292 @bt_pre_not_null{params}
1293 @bt_pre_not_null{result}
1296 <strong>On success</strong>, \bt_p{*result} is set.
1298 @sa bt_component_class_source_set_query_method() —
1299 Sets the query method of a source component class.
1301 typedef bt_component_class_query_method_status
1302 (*bt_component_class_source_query_method
)(
1303 bt_self_component_class_source
*self_component_class
,
1304 bt_private_query_executor
*query_executor
,
1305 const char *object_name
, const bt_value
*params
,
1306 void *method_data
, const bt_value
**result
);
1310 \bt_c_flt_comp_cls query method.
1312 See the \ref api-comp-cls-dev-meth-query "query" method.
1314 @param[in] self_component_class
1315 Filter component class, as passed as the \bt_p{component_class}
1316 parameter of bt_query_executor_create() or
1317 bt_query_executor_create_with_method_data() when creating this query
1318 operation's \ref api-qexec "executor".
1319 @param[in] query_executor
1320 Private view of this query operation's executor.
1321 @param[in] object_name
1322 Name of the object to query, as passed as the \bt_p{object_name}
1323 parameter of bt_query_executor_create() or
1324 bt_query_executor_create_with_method_data() when creating this query
1325 operation's executor.
1328 Query parameters, as passed as the \bt_p{params}
1329 parameter of bt_query_executor_create() or
1330 bt_query_executor_create_with_method_data() when creating this query
1331 operation's executor.
1333 \bt_p{params} is frozen.
1335 @param[in] method_data
1336 User data for this method, as passed as the \bt_p{method_data}
1337 parameter of bt_query_executor_create_with_method_data() when
1338 creating this query operation's executor.
1340 <strong>On success</strong>, \bt_p{*result} is
1341 a \em new reference of this query operation's result.
1343 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
1345 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
1346 \bt_p{object_name} is unknown.
1347 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
1349 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1351 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
1354 @bt_pre_not_null{self_component_class}
1355 @bt_pre_not_null{query_executor}
1356 @bt_pre_not_null{object_name}
1357 @bt_pre_not_null{params}
1358 @bt_pre_not_null{result}
1361 <strong>On success</strong>, \bt_p{*result} is set.
1363 @sa bt_component_class_filter_set_query_method() —
1364 Sets the query method of a filter component class.
1366 typedef bt_component_class_query_method_status
1367 (*bt_component_class_filter_query_method
)(
1368 bt_self_component_class_filter
*self_component_class
,
1369 bt_private_query_executor
*query_executor
,
1370 const char *object_name
, const bt_value
*params
,
1371 void *method_data
, const bt_value
**result
);
1375 \bt_c_sink_comp_cls query method.
1377 See the \ref api-comp-cls-dev-meth-query "query" method.
1379 @param[in] self_component_class
1380 Sink component class, as passed as the \bt_p{component_class}
1381 parameter of bt_query_executor_create() or
1382 bt_query_executor_create_with_method_data() when creating this query
1383 operation's \ref api-qexec "executor".
1384 @param[in] query_executor
1385 Private view of this query operation's executor.
1386 @param[in] object_name
1387 Name of the object to query, as passed as the \bt_p{object_name}
1388 parameter of bt_query_executor_create() or
1389 bt_query_executor_create_with_method_data() when creating this query
1390 operation's executor.
1393 Query parameters, as passed as the \bt_p{params}
1394 parameter of bt_query_executor_create() or
1395 bt_query_executor_create_with_method_data() when creating this query
1396 operation's executor.
1398 \bt_p{params} is frozen.
1400 @param[in] method_data
1401 User data for this method, as passed as the \bt_p{method_data}
1402 parameter of bt_query_executor_create_with_method_data() when
1403 creating this query operation's executor.
1405 <strong>On success</strong>, \bt_p{*result} is
1406 a \em new reference of this query operation's result.
1408 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_OK
1410 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_UNKNOWN_OBJECT
1411 \bt_p{object_name} is unknown.
1412 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_AGAIN
1414 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_MEMORY_ERROR
1416 @retval #BT_COMPONENT_CLASS_QUERY_METHOD_STATUS_ERROR
1419 @bt_pre_not_null{self_component_class}
1420 @bt_pre_not_null{query_executor}
1421 @bt_pre_not_null{object_name}
1422 @bt_pre_not_null{params}
1423 @bt_pre_not_null{result}
1426 <strong>On success</strong>, \bt_p{*result} is set.
1428 @sa bt_component_class_sink_set_query_method() —
1429 Sets the query method of a sink component class.
1431 typedef bt_component_class_query_method_status
1432 (*bt_component_class_sink_query_method
)(
1433 bt_self_component_class_sink
*self_component_class
,
1434 bt_private_query_executor
*query_executor
,
1435 const char *object_name
, const bt_value
*params
,
1436 void *method_data
, const bt_value
**result
);
1447 Creates a \bt_src_comp_cls named \bt_p{name} and having the
1448 \bt_msg_iter_cls \bt_p{message_iterator_class}.
1450 On success, the returned source component class has the following
1458 <td>\ref api-comp-cls-prop-name "Name"
1461 <td>\ref api-comp-cls-prop-descr "Description"
1464 <td>\ref api-comp-cls-prop-help "Help text"
1469 Name of the source component class to create (copied).
1470 @param[in] message_iterator_class
1471 Message iterator class of the source component class to create.
1474 New source component class reference, or \c NULL on memory error.
1476 @bt_pre_not_null{name}
1477 @bt_pre_not_null{message_iterator_class}
1479 @bt_post_success_frozen{message_iterator_class}
1481 @sa bt_message_iterator_class_create() —
1482 Creates a message iterator class.
1485 bt_component_class_source
*bt_component_class_source_create(
1487 bt_message_iterator_class
*message_iterator_class
)
1492 Creates a \bt_flt_comp_cls named \bt_p{name} and having the
1493 \bt_msg_iter_cls \bt_p{message_iterator_class}.
1495 On success, the returned filter component class has the following
1503 <td>\ref api-comp-cls-prop-name "Name"
1506 <td>\ref api-comp-cls-prop-descr "Description"
1509 <td>\ref api-comp-cls-prop-help "Help text"
1514 Name of the filter component class to create (copied).
1515 @param[in] message_iterator_class
1516 Message iterator class of the filter component class to create.
1519 New filter component class reference, or \c NULL on memory error.
1521 @bt_pre_not_null{name}
1522 @bt_pre_not_null{message_iterator_class}
1524 @bt_post_success_frozen{message_iterator_class}
1526 @sa bt_message_iterator_class_create() —
1527 Creates a message iterator class.
1530 bt_component_class_filter
*bt_component_class_filter_create(
1532 bt_message_iterator_class
*message_iterator_class
)
1537 Creates a \bt_sink_comp_cls named \bt_p{name} and having the
1538 \ref api-comp-cls-dev-meth-consume "consuming method"
1539 \bt_p{consume_method}.
1541 On success, the returned sink component class has the following
1549 <td>\ref api-comp-cls-prop-name "Name"
1552 <td>\ref api-comp-cls-prop-descr "Description"
1555 <td>\ref api-comp-cls-prop-help "Help text"
1560 Name of the sink component class to create (copied).
1561 @param[in] consume_method
1562 Consuming method of the sink component class to create.
1565 New sink component class reference, or \c NULL on memory error.
1567 @bt_pre_not_null{name}
1568 @bt_pre_not_null{consume_method}
1571 bt_component_class_sink
*bt_component_class_sink_create(
1573 bt_component_class_sink_consume_method consume_method
)
1579 @name Common properties
1585 Status codes for bt_component_class_set_description().
1587 typedef enum bt_component_class_set_description_status
{
1592 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1598 BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1599 } bt_component_class_set_description_status
;
1603 Sets the description of the component class \bt_p{component_class}
1604 to a copy of \bt_p{description}.
1606 See the \ref api-comp-cls-prop-descr "description" property.
1608 @param[in] component_class
1609 Component class of which to set the description to
1611 @param[in] description
1612 New description of \bt_p{component_class} (copied).
1614 @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_OK
1616 @retval #BT_COMPONENT_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR
1619 @bt_pre_not_null{component_class}
1620 @bt_pre_hot{component_class}
1621 @bt_pre_not_null{description}
1623 @sa bt_component_class_get_description() —
1624 Returns the description of a component class.
1626 extern bt_component_class_set_description_status
1627 bt_component_class_set_description(bt_component_class
*component_class
,
1628 const char *description
) __BT_NOEXCEPT
;
1632 Status codes for bt_component_class_set_help().
1634 typedef enum bt_component_class_set_help_status
{
1639 BT_COMPONENT_CLASS_SET_HELP_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1645 BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
= __BT_FUNC_STATUS_MEMORY_ERROR
,
1646 } bt_component_class_set_help_status
;
1650 Sets the help text of the component class \bt_p{component_class}
1651 to a copy of \bt_p{help_text}.
1653 See the \ref api-comp-cls-prop-help "help text" property.
1655 @param[in] component_class
1656 Component class of which to set the help text to
1658 @param[in] help_text
1659 New help text of \bt_p{component_class} (copied).
1661 @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_OK
1663 @retval #BT_COMPONENT_CLASS_SET_HELP_STATUS_MEMORY_ERROR
1666 @bt_pre_not_null{component_class}
1667 @bt_pre_hot{component_class}
1668 @bt_pre_not_null{help_text}
1670 @sa bt_component_class_get_help() —
1671 Returns the help text of a component class.
1673 extern bt_component_class_set_help_status
bt_component_class_set_help(
1674 bt_component_class
*component_class
,
1675 const char *help_text
) __BT_NOEXCEPT
;
1680 @name Method setting
1687 <code>bt_component_class_*_set_*_method()</code> functions.
1689 typedef enum bt_component_class_set_method_status
{
1694 BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
= __BT_FUNC_STATUS_OK
,
1695 } bt_component_class_set_method_status
;
1699 Sets the optional finalization method of the \bt_src_comp_cls
1700 \bt_p{component_class} to \bt_p{method}.
1702 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1704 @param[in] component_class
1705 Source component class of which to set the finalization method to
1708 New finalization method of \bt_p{component_class}.
1710 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1713 @bt_pre_not_null{component_class}
1714 @bt_pre_hot{component_class}
1715 @bt_pre_not_null{method}
1717 extern bt_component_class_set_method_status
1718 bt_component_class_source_set_finalize_method(
1719 bt_component_class_source
*component_class
,
1720 bt_component_class_source_finalize_method method
) __BT_NOEXCEPT
;
1724 Sets the optional finalization method of the \bt_flt_comp_cls
1725 \bt_p{component_class} to \bt_p{method}.
1727 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1729 @param[in] component_class
1730 Filter component class of which to set the finalization method to
1733 New finalization method of \bt_p{component_class}.
1735 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1738 @bt_pre_not_null{component_class}
1739 @bt_pre_hot{component_class}
1740 @bt_pre_not_null{method}
1742 extern bt_component_class_set_method_status
1743 bt_component_class_filter_set_finalize_method(
1744 bt_component_class_filter
*component_class
,
1745 bt_component_class_filter_finalize_method method
) __BT_NOEXCEPT
;
1749 Sets the optional finalization method of the \bt_sink_comp_cls
1750 \bt_p{component_class} to \bt_p{method}.
1752 See the \ref api-comp-cls-dev-meth-fini "finalize" method.
1754 @param[in] component_class
1755 Sink component class of which to set the finalization method to
1758 New finalization method of \bt_p{component_class}.
1760 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1763 @bt_pre_not_null{component_class}
1764 @bt_pre_hot{component_class}
1765 @bt_pre_not_null{method}
1768 bt_component_class_set_method_status
1769 bt_component_class_sink_set_finalize_method(
1770 bt_component_class_sink
*component_class
,
1771 bt_component_class_sink_finalize_method method
) __BT_NOEXCEPT
;
1775 Sets the \"get supported \bt_mip versions\" method of the
1776 \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}.
1778 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1781 @param[in] component_class
1782 Source component class of which to set the "get supported MIP
1783 versions" method to \bt_p{method}.
1785 New "get supported MIP versions" method of \bt_p{component_class}.
1787 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1790 @bt_pre_not_null{component_class}
1791 @bt_pre_hot{component_class}
1792 @bt_pre_not_null{method}
1794 extern bt_component_class_set_method_status
1795 bt_component_class_source_set_get_supported_mip_versions_method(
1796 bt_component_class_source
*component_class
,
1797 bt_component_class_source_get_supported_mip_versions_method method
)
1802 Sets the \"get supported \bt_mip versions\" method of the
1803 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
1805 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1808 @param[in] component_class
1809 Filter component class of which to set the "get supported MIP
1810 versions" method to \bt_p{method}.
1812 New "get supported MIP versions" method of \bt_p{component_class}.
1814 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1817 @bt_pre_not_null{component_class}
1818 @bt_pre_hot{component_class}
1819 @bt_pre_not_null{method}
1821 extern bt_component_class_set_method_status
1822 bt_component_class_filter_set_get_supported_mip_versions_method(
1823 bt_component_class_filter
*component_class
,
1824 bt_component_class_filter_get_supported_mip_versions_method method
)
1829 Sets the \"get supported \bt_mip versions\" method of the
1830 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
1832 See the \ref api-comp-cls-dev-meth-mip "get supported MIP versions"
1835 @param[in] component_class
1836 Sink component class of which to set the "get supported MIP
1837 versions" method to \bt_p{method}.
1839 New "get supported MIP versions" method of \bt_p{component_class}.
1841 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1844 @bt_pre_not_null{component_class}
1845 @bt_pre_hot{component_class}
1846 @bt_pre_not_null{method}
1848 extern bt_component_class_set_method_status
1849 bt_component_class_sink_set_get_supported_mip_versions_method(
1850 bt_component_class_sink
*component_class
,
1851 bt_component_class_sink_get_supported_mip_versions_method method
)
1856 Sets the "graph is configured" method of the
1857 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
1860 \ref api-comp-cls-dev-meth-graph-configured "graph is configured"
1863 @param[in] component_class
1864 Sink component class of which to set the "graph is configured"
1865 method to \bt_p{method}.
1867 New "graph is configured" method of \bt_p{component_class}.
1869 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1872 @bt_pre_not_null{component_class}
1873 @bt_pre_hot{component_class}
1874 @bt_pre_not_null{method}
1877 bt_component_class_set_method_status
1878 bt_component_class_sink_set_graph_is_configured_method(
1879 bt_component_class_sink
*component_class
,
1880 bt_component_class_sink_graph_is_configured_method method
)
1885 Sets the optional initialization method of the \bt_src_comp_cls
1886 \bt_p{component_class} to \bt_p{method}.
1888 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1890 @param[in] component_class
1891 Source component class of which to set the initialization method to
1894 New initialization method of \bt_p{component_class}.
1896 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1899 @bt_pre_not_null{component_class}
1900 @bt_pre_hot{component_class}
1901 @bt_pre_not_null{method}
1903 extern bt_component_class_set_method_status
1904 bt_component_class_source_set_initialize_method(
1905 bt_component_class_source
*component_class
,
1906 bt_component_class_source_initialize_method method
)
1911 Sets the optional initialization method of the \bt_flt_comp_cls
1912 \bt_p{component_class} to \bt_p{method}.
1914 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1916 @param[in] component_class
1917 Filter component class of which to set the initialization method to
1920 New initialization method of \bt_p{component_class}.
1922 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1925 @bt_pre_not_null{component_class}
1926 @bt_pre_hot{component_class}
1927 @bt_pre_not_null{method}
1929 extern bt_component_class_set_method_status
1930 bt_component_class_filter_set_initialize_method(
1931 bt_component_class_filter
*component_class
,
1932 bt_component_class_filter_initialize_method method
)
1937 Sets the optional initialization method of the \bt_sink_comp_cls
1938 \bt_p{component_class} to \bt_p{method}.
1940 See the \ref api-comp-cls-dev-meth-init "initialize" method.
1942 @param[in] component_class
1943 Sink component class of which to set the initialization method to
1946 New initialization method of \bt_p{component_class}.
1948 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1951 @bt_pre_not_null{component_class}
1952 @bt_pre_hot{component_class}
1953 @bt_pre_not_null{method}
1956 bt_component_class_set_method_status
1957 bt_component_class_sink_set_initialize_method(
1958 bt_component_class_sink
*component_class
,
1959 bt_component_class_sink_initialize_method method
) __BT_NOEXCEPT
;
1963 Sets the optional "output port connected" method of the
1964 \bt_src_comp_cls \bt_p{component_class} to \bt_p{method}.
1967 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
1970 @param[in] component_class
1971 Source component class of which to set the "output port connected"
1972 method to \bt_p{method}.
1974 New "output port connected" method of \bt_p{component_class}.
1976 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
1979 @bt_pre_not_null{component_class}
1980 @bt_pre_hot{component_class}
1981 @bt_pre_not_null{method}
1983 extern bt_component_class_set_method_status
1984 bt_component_class_source_set_output_port_connected_method(
1985 bt_component_class_source
*component_class
,
1986 bt_component_class_source_output_port_connected_method method
)
1991 Sets the optional "input port connected" method of the
1992 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
1995 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
1998 @param[in] component_class
1999 Filter component class of which to set the "input port connected"
2000 method to \bt_p{method}.
2002 New "input port connected" method of \bt_p{component_class}.
2004 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2007 @bt_pre_not_null{component_class}
2008 @bt_pre_hot{component_class}
2009 @bt_pre_not_null{method}
2011 extern bt_component_class_set_method_status
2012 bt_component_class_filter_set_input_port_connected_method(
2013 bt_component_class_filter
*component_class
,
2014 bt_component_class_filter_input_port_connected_method method
)
2019 Sets the optional "output port connected" method of the
2020 \bt_flt_comp_cls \bt_p{component_class} to \bt_p{method}.
2023 \ref api-comp-cls-dev-meth-oport-connected "output port connected"
2026 @param[in] component_class
2027 Filter component class of which to set the "output port connected"
2028 method to \bt_p{method}.
2030 New "output port connected" method of \bt_p{component_class}.
2032 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2035 @bt_pre_not_null{component_class}
2036 @bt_pre_hot{component_class}
2037 @bt_pre_not_null{method}
2039 extern bt_component_class_set_method_status
2040 bt_component_class_filter_set_output_port_connected_method(
2041 bt_component_class_filter
*component_class
,
2042 bt_component_class_filter_output_port_connected_method method
)
2047 Sets the optional "input port connected" method of the
2048 \bt_sink_comp_cls \bt_p{component_class} to \bt_p{method}.
2051 \ref api-comp-cls-dev-meth-iport-connected "input port connected"
2054 @param[in] component_class
2055 Sink component class of which to set the "input port connected"
2056 method to \bt_p{method}.
2058 New "input port connected" method of \bt_p{component_class}.
2060 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2063 @bt_pre_not_null{component_class}
2064 @bt_pre_hot{component_class}
2065 @bt_pre_not_null{method}
2068 bt_component_class_set_method_status
2069 bt_component_class_sink_set_input_port_connected_method(
2070 bt_component_class_sink
*component_class
,
2071 bt_component_class_sink_input_port_connected_method method
)
2076 Sets the optional query method of the \bt_src_comp_cls
2077 \bt_p{component_class} to \bt_p{method}.
2079 See the \ref api-comp-cls-dev-meth-query "query" method.
2081 @param[in] component_class
2082 Source component class of which to set the query method to
2085 New query method of \bt_p{component_class}.
2087 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2090 @bt_pre_not_null{component_class}
2091 @bt_pre_hot{component_class}
2092 @bt_pre_not_null{method}
2094 extern bt_component_class_set_method_status
2095 bt_component_class_source_set_query_method(
2096 bt_component_class_source
*component_class
,
2097 bt_component_class_source_query_method method
) __BT_NOEXCEPT
;
2101 Sets the optional query method of the \bt_flt_comp_cls
2102 \bt_p{component_class} to \bt_p{method}.
2104 See the \ref api-comp-cls-dev-meth-query "query" method.
2106 @param[in] component_class
2107 Filter component class of which to set the query method to
2110 New query method of \bt_p{component_class}.
2112 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2115 @bt_pre_not_null{component_class}
2116 @bt_pre_hot{component_class}
2117 @bt_pre_not_null{method}
2119 extern bt_component_class_set_method_status
2120 bt_component_class_filter_set_query_method(
2121 bt_component_class_filter
*component_class
,
2122 bt_component_class_filter_query_method method
) __BT_NOEXCEPT
;
2126 Sets the optional query method of the \bt_sink_comp_cls
2127 \bt_p{component_class} to \bt_p{method}.
2129 See the \ref api-comp-cls-dev-meth-query "query" method.
2131 @param[in] component_class
2132 Sink component class of which to set the query method to
2135 New query method of \bt_p{component_class}.
2137 @retval #BT_COMPONENT_CLASS_SET_METHOD_STATUS_OK
2140 @bt_pre_not_null{component_class}
2141 @bt_pre_hot{component_class}
2142 @bt_pre_not_null{method}
2145 bt_component_class_set_method_status
2146 bt_component_class_sink_set_query_method(
2147 bt_component_class_sink
*component_class
,
2148 bt_component_class_sink_query_method method
) __BT_NOEXCEPT
;
2159 \ref api-fund-c-typing "Upcasts" the \bt_src_comp_cls
2160 \bt_p{component_class} to the common #bt_component_class type.
2162 @param[in] component_class
2164 Source component class to upcast.
2170 \bt_p{component_class} as a common component class.
2173 bt_component_class
*bt_component_class_source_as_component_class(
2174 bt_component_class_source
*component_class
) __BT_NOEXCEPT
2176 return __BT_UPCAST(bt_component_class
, component_class
);
2181 \ref api-fund-c-typing "Upcasts" the \bt_flt_comp_cls
2182 \bt_p{component_class} to the common #bt_component_class type.
2184 @param[in] component_class
2186 Filter component class to upcast.
2192 \bt_p{component_class} as a common component class.
2195 bt_component_class
*bt_component_class_filter_as_component_class(
2196 bt_component_class_filter
*component_class
) __BT_NOEXCEPT
2198 return __BT_UPCAST(bt_component_class
, component_class
);
2203 \ref api-fund-c-typing "Upcasts" the \bt_sink_comp_cls
2204 \bt_p{component_class} to the common #bt_component_class type.
2206 @param[in] component_class
2208 Sink component class to upcast.
2214 \bt_p{component_class} as a common component class.
2217 bt_component_class
*bt_component_class_sink_as_component_class(
2218 bt_component_class_sink
*component_class
) __BT_NOEXCEPT
2220 return __BT_UPCAST(bt_component_class
, component_class
);
2231 #endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_DEV_H */