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