2 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
3 * Copyright 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
6 * of this software and associated documentation files (the "Software"), to deal
7 * in the Software without restriction, including without limitation the rights
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 * copies of the Software, and to permit persons to whom the Software is
10 * furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 #define BT_LOG_TAG "LIB/COMPONENT-CLASS"
25 #include "lib/logging.h"
27 #include "common/assert.h"
28 #include "lib/assert-pre.h"
29 #include "compat/compiler.h"
30 #include <babeltrace2/graph/component-class.h>
31 #include <babeltrace2/graph/component-class-const.h>
32 #include <babeltrace2/graph/component-class-source.h>
33 #include <babeltrace2/graph/component-class-source-const.h>
34 #include <babeltrace2/graph/component-class-filter.h>
35 #include <babeltrace2/graph/component-class-filter-const.h>
36 #include <babeltrace2/graph/component-class-sink.h>
37 #include <babeltrace2/graph/component-class-sink-const.h>
38 #include <babeltrace2/types.h>
41 #include "component-class.h"
42 #include "lib/func-status.h"
43 #include "lib/graph/message-iterator-class.h"
45 #define BT_ASSERT_PRE_DEV_COMP_CLS_HOT(_cc) \
46 BT_ASSERT_PRE_DEV_HOT(((const struct bt_component_class *) (_cc)), \
47 "Component class", ": %!+C", (_cc))
50 void destroy_component_class(struct bt_object
*obj
)
52 struct bt_component_class
*class;
56 class = container_of(obj
, struct bt_component_class
, base
);
58 BT_LIB_LOGI("Destroying component class: %!+C", class);
60 /* Call destroy listeners in reverse registration order */
61 for (i
= class->destroy_listeners
->len
- 1; i
>= 0; i
--) {
62 struct bt_component_class_destroy_listener
*listener
=
63 &g_array_index(class->destroy_listeners
,
64 struct bt_component_class_destroy_listener
,
67 BT_LOGD("Calling destroy listener: func-addr=%p, data-addr=%p",
68 listener
->func
, listener
->data
);
69 listener
->func(class, listener
->data
);
73 g_string_free(class->name
, TRUE
);
77 if (class->description
) {
78 g_string_free(class->description
, TRUE
);
79 class->description
= NULL
;
83 g_string_free(class->help
, TRUE
);
87 if (class->plugin_name
) {
88 g_string_free(class->plugin_name
, TRUE
);
89 class->plugin_name
= NULL
;
92 if (class->destroy_listeners
) {
93 g_array_free(class->destroy_listeners
, TRUE
);
94 class->destroy_listeners
= NULL
;
97 if (class->type
== BT_COMPONENT_CLASS_TYPE_SOURCE
) {
98 struct bt_component_class_source
*class_src
99 = container_of(class, struct bt_component_class_source
,
102 BT_ASSERT(class_src
->msg_iter_cls
);
103 bt_message_iterator_class_put_ref(class_src
->msg_iter_cls
);
104 class_src
->msg_iter_cls
= NULL
;
105 } else if (class->type
== BT_COMPONENT_CLASS_TYPE_FILTER
) {
106 struct bt_component_class_filter
*class_flt
107 = container_of(class, struct bt_component_class_filter
,
110 BT_ASSERT(class_flt
->msg_iter_cls
);
111 bt_message_iterator_class_put_ref(class_flt
->msg_iter_cls
);
112 class_flt
->msg_iter_cls
= NULL
;
119 int bt_component_class_init(struct bt_component_class
*class,
120 enum bt_component_class_type type
, const char *name
)
124 bt_object_init_shared(&class->base
, destroy_component_class
);
126 class->name
= g_string_new(name
);
128 BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
132 class->description
= g_string_new(NULL
);
133 if (!class->description
) {
134 BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
138 class->help
= g_string_new(NULL
);
140 BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
144 class->plugin_name
= g_string_new(NULL
);
145 if (!class->plugin_name
) {
146 BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GString.");
150 class->destroy_listeners
= g_array_new(FALSE
, TRUE
,
151 sizeof(struct bt_component_class_destroy_listener
));
152 if (!class->destroy_listeners
) {
153 BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate a GArray.");
160 BT_OBJECT_PUT_REF_AND_RESET(class);
167 struct bt_component_class_source
*bt_component_class_source_create(
169 struct bt_message_iterator_class
*message_iterator_class
)
171 struct bt_component_class_source
*source_class
= NULL
;
174 BT_ASSERT_PRE_NO_ERROR();
175 BT_ASSERT_PRE_NON_NULL(name
, "Name");
176 BT_ASSERT_PRE_NON_NULL(message_iterator_class
, "Message iterator class");
177 BT_LIB_LOGI("Creating source component class: "
178 "name=\"%s\", %![msg-iter-cls-]+I",
179 name
, message_iterator_class
);
180 source_class
= g_new0(struct bt_component_class_source
, 1);
182 BT_LIB_LOGE_APPEND_CAUSE(
183 "Failed to allocate one source component class.");
187 /* bt_component_class_init() logs errors */
188 ret
= bt_component_class_init(&source_class
->parent
,
189 BT_COMPONENT_CLASS_TYPE_SOURCE
, name
);
192 * If bt_component_class_init() fails, the component
193 * class is put, therefore its memory is already
200 source_class
->msg_iter_cls
= message_iterator_class
;
201 bt_message_iterator_class_get_ref(source_class
->msg_iter_cls
);
202 bt_message_iterator_class_freeze(source_class
->msg_iter_cls
);
204 BT_LIB_LOGI("Created source component class: %!+C", source_class
);
207 return (void *) source_class
;
210 struct bt_component_class_filter
*bt_component_class_filter_create(
212 struct bt_message_iterator_class
*message_iterator_class
)
214 struct bt_component_class_filter
*filter_class
= NULL
;
217 BT_ASSERT_PRE_NO_ERROR();
218 BT_ASSERT_PRE_NON_NULL(name
, "Name");
219 BT_ASSERT_PRE_NON_NULL(message_iterator_class
, "Message iterator class");
220 BT_LIB_LOGI("Creating filter component class: "
221 "name=\"%s\", %![msg-iter-cls-]+I",
222 name
, message_iterator_class
);
223 filter_class
= g_new0(struct bt_component_class_filter
, 1);
225 BT_LIB_LOGE_APPEND_CAUSE(
226 "Failed to allocate one filter component class.");
230 /* bt_component_class_init() logs errors */
231 ret
= bt_component_class_init(&filter_class
->parent
,
232 BT_COMPONENT_CLASS_TYPE_FILTER
, name
);
235 * If bt_component_class_init() fails, the component
236 * class is put, therefore its memory is already
243 filter_class
->msg_iter_cls
= message_iterator_class
;
244 bt_message_iterator_class_get_ref(filter_class
->msg_iter_cls
);
245 bt_message_iterator_class_freeze(filter_class
->msg_iter_cls
);
247 BT_LIB_LOGI("Created filter component class: %!+C", filter_class
);
250 return (void *) filter_class
;
253 struct bt_component_class_sink
*bt_component_class_sink_create(
254 const char *name
, bt_component_class_sink_consume_method method
)
256 struct bt_component_class_sink
*sink_class
= NULL
;
259 BT_ASSERT_PRE_NO_ERROR();
260 BT_ASSERT_PRE_NON_NULL(name
, "Name");
261 BT_ASSERT_PRE_NON_NULL(method
, "Consume next method");
262 BT_LOGI("Creating sink component class: "
263 "name=\"%s\", consume-method-addr=%p",
265 sink_class
= g_new0(struct bt_component_class_sink
, 1);
267 BT_LIB_LOGE_APPEND_CAUSE(
268 "Failed to allocate one sink component class.");
272 /* bt_component_class_init() logs errors */
273 ret
= bt_component_class_init(&sink_class
->parent
,
274 BT_COMPONENT_CLASS_TYPE_SINK
, name
);
277 * If bt_component_class_init() fails, the component
278 * class is put, therefore its memory is already
285 sink_class
->methods
.consume
= method
;
286 BT_LIB_LOGI("Created sink component class: %!+C", sink_class
);
289 return (void *) sink_class
;
292 enum bt_component_class_set_method_status
293 bt_component_class_source_set_get_supported_mip_versions_method(
294 struct bt_component_class_source
*comp_cls
,
295 bt_component_class_source_get_supported_mip_versions_method method
)
297 BT_ASSERT_PRE_NO_ERROR();
298 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
299 BT_ASSERT_PRE_NON_NULL(method
, "Method");
300 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
301 comp_cls
->methods
.get_supported_mip_versions
= method
;
302 BT_LIB_LOGD("Set source component class's \"get supported MIP versions\" method: "
304 return BT_FUNC_STATUS_OK
;
307 enum bt_component_class_set_method_status
308 bt_component_class_filter_set_get_supported_mip_versions_method(
309 struct bt_component_class_filter
*comp_cls
,
310 bt_component_class_filter_get_supported_mip_versions_method method
)
312 BT_ASSERT_PRE_NO_ERROR();
313 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
314 BT_ASSERT_PRE_NON_NULL(method
, "Method");
315 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
316 comp_cls
->methods
.get_supported_mip_versions
= method
;
317 BT_LIB_LOGD("Set filter component class's \"get supported MIP versions\" method: "
319 return BT_FUNC_STATUS_OK
;
322 enum bt_component_class_set_method_status
323 bt_component_class_sink_set_get_supported_mip_versions_method(
324 struct bt_component_class_sink
*comp_cls
,
325 bt_component_class_sink_get_supported_mip_versions_method method
)
327 BT_ASSERT_PRE_NO_ERROR();
328 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
329 BT_ASSERT_PRE_NON_NULL(method
, "Method");
330 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
331 comp_cls
->methods
.get_supported_mip_versions
= method
;
332 BT_LIB_LOGD("Set sink component class's \"get supported MIP versions\" method: "
334 return BT_FUNC_STATUS_OK
;
337 enum bt_component_class_set_method_status
338 bt_component_class_source_set_initialize_method(
339 struct bt_component_class_source
*comp_cls
,
340 bt_component_class_source_initialize_method method
)
342 BT_ASSERT_PRE_NO_ERROR();
343 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
344 BT_ASSERT_PRE_NON_NULL(method
, "Method");
345 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
346 comp_cls
->methods
.init
= method
;
347 BT_LIB_LOGD("Set source component class's initialization method: "
349 return BT_FUNC_STATUS_OK
;
352 enum bt_component_class_set_method_status
353 bt_component_class_filter_set_initialize_method(
354 struct bt_component_class_filter
*comp_cls
,
355 bt_component_class_filter_initialize_method method
)
357 BT_ASSERT_PRE_NO_ERROR();
358 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
359 BT_ASSERT_PRE_NON_NULL(method
, "Method");
360 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
361 comp_cls
->methods
.init
= method
;
362 BT_LIB_LOGD("Set filter component class's initialization method: "
364 return BT_FUNC_STATUS_OK
;
367 enum bt_component_class_set_method_status
368 bt_component_class_sink_set_initialize_method(
369 struct bt_component_class_sink
*comp_cls
,
370 bt_component_class_sink_initialize_method method
)
372 BT_ASSERT_PRE_NO_ERROR();
373 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
374 BT_ASSERT_PRE_NON_NULL(method
, "Method");
375 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
376 comp_cls
->methods
.init
= method
;
377 BT_LIB_LOGD("Set sink component class's initialization method: "
379 return BT_FUNC_STATUS_OK
;
382 enum bt_component_class_set_method_status
383 bt_component_class_source_set_finalize_method(
384 struct bt_component_class_source
*comp_cls
,
385 bt_component_class_source_finalize_method method
)
387 BT_ASSERT_PRE_NO_ERROR();
388 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
389 BT_ASSERT_PRE_NON_NULL(method
, "Method");
390 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
391 comp_cls
->methods
.finalize
= method
;
392 BT_LIB_LOGD("Set source component class's finalization method: "
394 return BT_FUNC_STATUS_OK
;
397 enum bt_component_class_set_method_status
398 bt_component_class_filter_set_finalize_method(
399 struct bt_component_class_filter
*comp_cls
,
400 bt_component_class_filter_finalize_method method
)
402 BT_ASSERT_PRE_NO_ERROR();
403 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
404 BT_ASSERT_PRE_NON_NULL(method
, "Method");
405 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
406 comp_cls
->methods
.finalize
= method
;
407 BT_LIB_LOGD("Set filter component class's finalization method: "
409 return BT_FUNC_STATUS_OK
;
412 enum bt_component_class_set_method_status
413 bt_component_class_sink_set_finalize_method(
414 struct bt_component_class_sink
*comp_cls
,
415 bt_component_class_sink_finalize_method method
)
417 BT_ASSERT_PRE_NO_ERROR();
418 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
419 BT_ASSERT_PRE_NON_NULL(method
, "Method");
420 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
421 comp_cls
->methods
.finalize
= method
;
422 BT_LIB_LOGD("Set sink component class's finalization method: "
424 return BT_FUNC_STATUS_OK
;
427 enum bt_component_class_set_method_status
428 bt_component_class_source_set_query_method(
429 struct bt_component_class_source
*comp_cls
,
430 bt_component_class_source_query_method method
)
432 BT_ASSERT_PRE_NO_ERROR();
433 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
434 BT_ASSERT_PRE_NON_NULL(method
, "Method");
435 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
436 comp_cls
->methods
.query
= method
;
437 BT_LIB_LOGD("Set source component class's query method: "
439 return BT_FUNC_STATUS_OK
;
442 enum bt_component_class_set_method_status
443 bt_component_class_filter_set_query_method(
444 struct bt_component_class_filter
*comp_cls
,
445 bt_component_class_filter_query_method method
)
447 BT_ASSERT_PRE_NO_ERROR();
448 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
449 BT_ASSERT_PRE_NON_NULL(method
, "Method");
450 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
451 comp_cls
->methods
.query
= method
;
452 BT_LIB_LOGD("Set filter component class's query method: "
454 return BT_FUNC_STATUS_OK
;
457 enum bt_component_class_set_method_status
458 bt_component_class_sink_set_query_method(
459 struct bt_component_class_sink
*comp_cls
,
460 bt_component_class_sink_query_method method
)
462 BT_ASSERT_PRE_NO_ERROR();
463 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
464 BT_ASSERT_PRE_NON_NULL(method
, "Method");
465 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
466 comp_cls
->methods
.query
= method
;
467 BT_LIB_LOGD("Set sink component class's query method: "
469 return BT_FUNC_STATUS_OK
;
472 enum bt_component_class_set_method_status
473 bt_component_class_filter_set_input_port_connected_method(
474 struct bt_component_class_filter
*comp_cls
,
475 bt_component_class_filter_input_port_connected_method method
)
477 BT_ASSERT_PRE_NO_ERROR();
478 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
479 BT_ASSERT_PRE_NON_NULL(method
, "Method");
480 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
481 comp_cls
->methods
.input_port_connected
= method
;
482 BT_LIB_LOGD("Set filter component class's \"input port connected\" method"
484 return BT_FUNC_STATUS_OK
;
487 enum bt_component_class_set_method_status
488 bt_component_class_sink_set_input_port_connected_method(
489 struct bt_component_class_sink
*comp_cls
,
490 bt_component_class_sink_input_port_connected_method method
)
492 BT_ASSERT_PRE_NO_ERROR();
493 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
494 BT_ASSERT_PRE_NON_NULL(method
, "Method");
495 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
496 comp_cls
->methods
.input_port_connected
= method
;
497 BT_LIB_LOGD("Set sink component class's \"input port connected\" method"
499 return BT_FUNC_STATUS_OK
;
502 enum bt_component_class_set_method_status
503 bt_component_class_source_set_output_port_connected_method(
504 struct bt_component_class_source
*comp_cls
,
505 bt_component_class_source_output_port_connected_method method
)
507 BT_ASSERT_PRE_NO_ERROR();
508 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
509 BT_ASSERT_PRE_NON_NULL(method
, "Method");
510 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
511 comp_cls
->methods
.output_port_connected
= method
;
512 BT_LIB_LOGD("Set source component class's \"output port connected\" method"
514 return BT_FUNC_STATUS_OK
;
517 enum bt_component_class_set_method_status
518 bt_component_class_filter_set_output_port_connected_method(
519 struct bt_component_class_filter
*comp_cls
,
520 bt_component_class_filter_output_port_connected_method method
)
522 BT_ASSERT_PRE_NO_ERROR();
523 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
524 BT_ASSERT_PRE_NON_NULL(method
, "Method");
525 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
526 comp_cls
->methods
.output_port_connected
= method
;
527 BT_LIB_LOGD("Set filter component class's \"output port connected\" method"
529 return BT_FUNC_STATUS_OK
;
532 enum bt_component_class_set_method_status
533 bt_component_class_sink_set_graph_is_configured_method(
534 struct bt_component_class_sink
*comp_cls
,
535 bt_component_class_sink_graph_is_configured_method method
)
537 BT_ASSERT_PRE_NO_ERROR();
538 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
539 BT_ASSERT_PRE_NON_NULL(method
, "Method");
540 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
541 comp_cls
->methods
.graph_is_configured
= method
;
542 BT_LIB_LOGD("Set sink component class's \"graph is configured\" method"
544 return BT_FUNC_STATUS_OK
;
547 enum bt_component_class_set_description_status
548 bt_component_class_set_description(
549 struct bt_component_class
*comp_cls
,
550 const char *description
)
552 BT_ASSERT_PRE_NO_ERROR();
553 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
554 BT_ASSERT_PRE_NON_NULL(description
, "Description");
555 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
556 g_string_assign(comp_cls
->description
, description
);
557 BT_LIB_LOGD("Set component class's description: "
558 "addr=%p, name=\"%s\", type=%s",
560 bt_component_class_get_name(comp_cls
),
561 bt_component_class_type_string(comp_cls
->type
));
562 return BT_FUNC_STATUS_OK
;
565 enum bt_component_class_set_help_status
bt_component_class_set_help(
566 struct bt_component_class
*comp_cls
,
569 BT_ASSERT_PRE_NO_ERROR();
570 BT_ASSERT_PRE_NON_NULL(comp_cls
, "Component class");
571 BT_ASSERT_PRE_NON_NULL(help
, "Help");
572 BT_ASSERT_PRE_DEV_COMP_CLS_HOT(comp_cls
);
573 g_string_assign(comp_cls
->help
, help
);
574 BT_LIB_LOGD("Set component class's help text: %!+C", comp_cls
);
575 return BT_FUNC_STATUS_OK
;
578 const char *bt_component_class_get_name(const struct bt_component_class
*comp_cls
)
580 BT_ASSERT_PRE_DEV_NON_NULL(comp_cls
, "Component class");
581 return comp_cls
->name
->str
;
584 enum bt_component_class_type
bt_component_class_get_type(
585 const struct bt_component_class
*comp_cls
)
587 BT_ASSERT_PRE_DEV_NON_NULL(comp_cls
, "Component class");
588 return comp_cls
->type
;
591 const char *bt_component_class_get_description(
592 const struct bt_component_class
*comp_cls
)
594 BT_ASSERT_PRE_DEV_NON_NULL(comp_cls
, "Component class");
595 return comp_cls
->description
&&
596 comp_cls
->description
->str
[0] != '\0' ?
597 comp_cls
->description
->str
: NULL
;
600 const char *bt_component_class_get_help(
601 const struct bt_component_class
*comp_cls
)
603 BT_ASSERT_PRE_DEV_NON_NULL(comp_cls
, "Component class");
604 return comp_cls
->help
&&
605 comp_cls
->help
->str
[0] != '\0' ? comp_cls
->help
->str
: NULL
;
609 void bt_component_class_add_destroy_listener(
610 struct bt_component_class
*comp_cls
,
611 bt_component_class_destroy_listener_func func
, void *data
)
613 struct bt_component_class_destroy_listener listener
;
617 listener
.func
= func
;
618 listener
.data
= data
;
619 g_array_append_val(comp_cls
->destroy_listeners
, listener
);
620 BT_LIB_LOGD("Added destroy listener to component class: "
621 "%![cc-]+C, listener-func-addr=%p", comp_cls
, func
);
625 void _bt_component_class_freeze(const struct bt_component_class
*comp_cls
)
628 BT_LIB_LOGD("Freezing component class: %!+C", comp_cls
);
629 ((struct bt_component_class
*) comp_cls
)->frozen
= true;
632 void bt_component_class_get_ref(
633 const struct bt_component_class
*component_class
)
635 bt_object_get_ref(component_class
);
638 void bt_component_class_put_ref(
639 const struct bt_component_class
*component_class
)
641 bt_object_put_ref(component_class
);
644 void bt_component_class_source_get_ref(
645 const struct bt_component_class_source
*component_class_source
)
647 bt_object_get_ref(component_class_source
);
650 void bt_component_class_source_put_ref(
651 const struct bt_component_class_source
*component_class_source
)
653 bt_object_put_ref(component_class_source
);
656 void bt_component_class_filter_get_ref(
657 const struct bt_component_class_filter
*component_class_filter
)
659 bt_object_get_ref(component_class_filter
);
662 void bt_component_class_filter_put_ref(
663 const struct bt_component_class_filter
*component_class_filter
)
665 bt_object_put_ref(component_class_filter
);
668 void bt_component_class_sink_get_ref(
669 const struct bt_component_class_sink
*component_class_sink
)
671 bt_object_get_ref(component_class_sink
);
674 void bt_component_class_sink_put_ref(
675 const struct bt_component_class_sink
*component_class_sink
)
677 bt_object_put_ref(component_class_sink
);