Babeltrace 2 C API 2.1.0
Open-source trace manipulation framework
Loading...
Searching...
No Matches
component-class.h
1/*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5 */
6
7#ifndef BABELTRACE2_GRAPH_COMPONENT_CLASS_H
8#define BABELTRACE2_GRAPH_COMPONENT_CLASS_H
9
10/* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11
12#ifndef __BT_IN_BABELTRACE_H
13# error "Please include <babeltrace2/babeltrace.h> instead."
14#endif
15
16#include <babeltrace2/types.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
221
243 const bt_component_class *component_class) __BT_NOEXCEPT;
244
261static inline
263 const bt_component_class *component_class) __BT_NOEXCEPT
264{
265 return bt_component_class_get_type(component_class) ==
267}
268
285static inline
287 const bt_component_class *component_class) __BT_NOEXCEPT
288{
289 return bt_component_class_get_type(component_class) ==
291}
292
309static inline
311 const bt_component_class *component_class) __BT_NOEXCEPT
312{
313 return bt_component_class_get_type(component_class) ==
315}
316
344 const bt_component_class *component_class) __BT_NOEXCEPT;
345
367 const bt_component_class *component_class) __BT_NOEXCEPT;
368
389 const bt_component_class *component_class) __BT_NOEXCEPT;
390
414 const bt_component_class *component_class) __BT_NOEXCEPT;
415
432 const bt_component_class *component_class) __BT_NOEXCEPT;
433
449#define BT_COMPONENT_CLASS_PUT_REF_AND_RESET(_component_class) \
450 do { \
451 bt_component_class_put_ref(_component_class); \
452 (_component_class) = NULL; \
453 } while (0)
454
482#define BT_COMPONENT_CLASS_MOVE_REF(_dst, _src) \
483 do { \
484 bt_component_class_put_ref(_dst); \
485 (_dst) = (_src); \
486 (_src) = NULL; \
487 } while (0)
488
511static inline
512const bt_component_class *
514 const bt_component_class_source *component_class) __BT_NOEXCEPT
515{
516 return __BT_UPCAST_CONST(bt_component_class, component_class);
517}
518
542 const bt_component_class_source *component_class) __BT_NOEXCEPT;
543
560 const bt_component_class_source *component_class) __BT_NOEXCEPT;
561
577#define BT_COMPONENT_CLASS_SOURCE_PUT_REF_AND_RESET(_component_class) \
578 do { \
579 bt_component_class_source_put_ref(_component_class); \
580 (_component_class) = NULL; \
581 } while (0)
582
609#define BT_COMPONENT_CLASS_SOURCE_MOVE_REF(_dst, _src) \
610 do { \
611 bt_component_class_source_put_ref(_dst); \
612 (_dst) = (_src); \
613 (_src) = NULL; \
614 } while (0)
615
638static inline
639const bt_component_class *
641 const bt_component_class_filter *component_class) __BT_NOEXCEPT
642{
643 return __BT_UPCAST_CONST(bt_component_class, component_class);
644}
645
669 const bt_component_class_filter *component_class) __BT_NOEXCEPT;
670
687 const bt_component_class_filter *component_class) __BT_NOEXCEPT;
688
704#define BT_COMPONENT_CLASS_FILTER_PUT_REF_AND_RESET(_component_class) \
705 do { \
706 bt_component_class_filter_put_ref(_component_class); \
707 (_component_class) = NULL; \
708 } while (0)
709
736#define BT_COMPONENT_CLASS_FILTER_MOVE_REF(_dst, _src) \
737 do { \
738 bt_component_class_filter_put_ref(_dst); \
739 (_dst) = (_src); \
740 (_src) = NULL; \
741 } while (0)
742
765static inline
766const bt_component_class *
768 const bt_component_class_sink *component_class) __BT_NOEXCEPT
769{
770 return __BT_UPCAST_CONST(bt_component_class, component_class);
771}
772
796 const bt_component_class_sink *component_class) __BT_NOEXCEPT;
797
814 const bt_component_class_sink *component_class) __BT_NOEXCEPT;
815
831#define BT_COMPONENT_CLASS_SINK_PUT_REF_AND_RESET(_component_class) \
832 do { \
833 bt_component_class_sink_put_ref(_component_class); \
834 (_component_class) = NULL; \
835 } while (0)
836
863#define BT_COMPONENT_CLASS_SINK_MOVE_REF(_dst, _src) \
864 do { \
865 bt_component_class_sink_put_ref(_dst); \
866 (_dst) = (_src); \
867 (_src) = NULL; \
868 } while (0)
869
874#ifdef __cplusplus
875}
876#endif
877
878#endif /* BABELTRACE2_GRAPH_COMPONENT_CLASS_H */
int bt_bool
Babeltrace&#160;2 boolean type.
Definition types.h:126
const char * bt_component_class_get_description(const bt_component_class *component_class)
Returns the description of the component class component_class.
const char * bt_component_class_get_name(const bt_component_class *component_class)
Returns the name of the component class component_class.
bt_component_class_type
Component class type enumerators.
Definition component-class.h:202
void bt_component_class_sink_get_ref(const bt_component_class_sink *component_class)
Increments the reference count of the sink component class component_class.
struct bt_component_class_sink bt_component_class_sink
Sink component class.
Definition types.h:27
static bt_bool bt_component_class_is_sink(const bt_component_class *component_class)
Returns whether or not the component class component_class is a sink component class.
Definition component-class.h:310
void bt_component_class_source_get_ref(const bt_component_class_source *component_class)
Increments the reference count of the source component class component_class.
bt_component_class_type bt_component_class_get_type(const bt_component_class *component_class)
Returns the type enumerator of the component class component_class.
void bt_component_class_filter_put_ref(const bt_component_class_filter *component_class)
Decrements the reference count of the filter component class component_class.
static const bt_component_class * bt_component_class_source_as_component_class_const(const bt_component_class_source *component_class)
Upcasts the source component class component_class to the common bt_component_class type.
Definition component-class.h:513
void bt_component_class_sink_put_ref(const bt_component_class_sink *component_class)
Decrements the reference count of the sink component class component_class.
void bt_component_class_filter_get_ref(const bt_component_class_filter *component_class)
Increments the reference count of the filter component class component_class.
void bt_component_class_get_ref(const bt_component_class *component_class)
Increments the reference count of the component class component_class.
void bt_component_class_source_put_ref(const bt_component_class_source *component_class)
Decrements the reference count of the source component class component_class.
static const bt_component_class * bt_component_class_sink_as_component_class_const(const bt_component_class_sink *component_class)
Upcasts the sink component class component_class to the common bt_component_class type.
Definition component-class.h:767
struct bt_component_class_source bt_component_class_source
Source component class.
Definition types.h:28
const char * bt_component_class_get_help(const bt_component_class *component_class)
Returns the help text of the component class component_class.
void bt_component_class_put_ref(const bt_component_class *component_class)
Decrements the reference count of the component class component_class.
static bt_bool bt_component_class_is_filter(const bt_component_class *component_class)
Returns whether or not the component class component_class is a filter component class.
Definition component-class.h:286
struct bt_component_class_filter bt_component_class_filter
Filter component class.
Definition types.h:26
static bt_bool bt_component_class_is_source(const bt_component_class *component_class)
Returns whether or not the component class component_class is a source component class.
Definition component-class.h:262
struct bt_component_class bt_component_class
Component class.
Definition types.h:25
static const bt_component_class * bt_component_class_filter_as_component_class_const(const bt_component_class_filter *component_class)
Upcasts the filter component class component_class to the common bt_component_class type.
Definition component-class.h:640
@ BT_COMPONENT_CLASS_TYPE_FILTER
Filter component class.
Definition component-class.h:213
@ BT_COMPONENT_CLASS_TYPE_SOURCE
Source component class.
Definition component-class.h:207
@ BT_COMPONENT_CLASS_TYPE_SINK
Sink component class.
Definition component-class.h:219