2 * SPDX-License-Identifier: MIT
4 * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
7 #ifndef BABELTRACE2_GRAPH_COMPONENT_H
8 #define BABELTRACE2_GRAPH_COMPONENT_H
10 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
16 #include <babeltrace2/graph/component-class.h>
17 #include <babeltrace2/types.h>
18 #include <babeltrace2/logging.h>
25 @defgroup api-comp Components
29 Source, filter, and sink components: nodes in a trace processing
32 A <strong><em>component</em></strong> is a node within a trace
35 @image html component.png
37 A component is \bt_comp_cls instance. Borrow the class of a
38 component with bt_component_borrow_class_const(),
39 bt_component_source_borrow_class_const(),
40 bt_component_filter_borrow_class_const(), and
41 bt_component_sink_borrow_class_const().
43 A component is a \ref api-fund-shared-object "shared object": get a new
44 reference with bt_component_get_ref() and put an existing reference with
45 bt_component_put_ref().
47 The common C type of a port is #bt_component.
49 There are three types of components, which come from the three types
53 <dt>\anchor api-comp-src Source component</dt>
55 A source component's \bt_msg_iter emits fresh \bt_p_msg.
57 A source component's specific type is #bt_component_source and its
58 class's type enumerator is #BT_COMPONENT_CLASS_TYPE_SOURCE.
60 \ref api-fund-c-typing "Upcast" the #bt_component_source type to the
61 #bt_component type with bt_component_source_as_component_const().
63 Get a new source component reference with
64 bt_component_source_get_ref() and put an existing one with
65 bt_component_source_put_ref().
67 A source component has \bt_p_oport only.
69 Get the number of output ports a source component has with
70 bt_component_source_get_output_port_count().
72 Borrow a source component's output port by index with
73 bt_component_source_borrow_output_port_by_index_const() or by name
74 with bt_component_source_borrow_output_port_by_name_const().
77 <dt>\anchor api-comp-flt Filter component</dt>
79 A filter component's message iterator emits fresh and transformed
80 messages. It can also discard existing messages.
82 A filter component's specific type is #bt_component_filter and its
83 class's type enumerator is #BT_COMPONENT_CLASS_TYPE_FILTER.
85 \ref api-fund-c-typing "Upcast" the #bt_component_filter type to the
86 #bt_component type with bt_component_filter_as_component_const().
88 Get a new filter component reference with
89 bt_component_filter_get_ref() and put an existing one with
90 bt_component_filter_put_ref().
92 A filter component has \bt_p_iport and \bt_p_oport.
94 Get the number of output ports a filter component has with
95 bt_component_filter_get_output_port_count().
97 Borrow a filter component's output port by index with
98 bt_component_filter_borrow_output_port_by_index_const() or by name
99 with bt_component_filter_borrow_output_port_by_name_const().
101 Get the number of input ports a filter component has with
102 bt_component_filter_get_input_port_count().
104 Borrow a filter component's input port by index with
105 bt_component_filter_borrow_input_port_by_index_const() or by name
106 with bt_component_filter_borrow_input_port_by_name_const().
109 <dt>\anchor api-comp-sink Sink component</dt>
111 A sink component consumes messages from a source or filter message
114 A filter component's specific type is #bt_component_sink and its
115 class's type enumerator is #BT_COMPONENT_CLASS_TYPE_SINK.
117 \ref api-fund-c-typing "Upcast" the #bt_component_sink type to the
118 #bt_component type with bt_component_sink_as_component_const().
120 Get a new sink component reference with bt_component_sink_get_ref()
121 and put an existing one with bt_component_sink_put_ref().
123 A sink component has \bt_p_iport only.
125 Get the number of input ports a sink component has with
126 bt_component_sink_get_input_port_count().
128 Borrow a sink component's input port by index with
129 bt_component_sink_borrow_input_port_by_index_const() or by name
130 with bt_component_sink_borrow_input_port_by_name_const().
134 Get a component's class type enumerator with
135 bt_component_get_class_type(). You can also use the
136 bt_component_is_source(), bt_component_is_filter(), and
137 bt_component_is_sink() helper functions.
139 You cannot directly create a component: there are no
140 <code>bt_component_*_create()</code> functions. A trace processing
141 \bt_graph creates a component from a \bt_comp_cls when you call one of
142 the <code>bt_graph_add_*_component*()</code> functions. Those functions
143 also return a borrowed reference of the created component through their
144 \bt_p{component} parameter.
148 A component has the following common properties:
152 \anchor api-comp-prop-name
156 Name of the component.
158 Each component has a unique name within a given trace processing
161 A component's name is set when you
162 \ref api-graph-lc-add "add it to a graph" with one of the
163 <code>bt_graph_add_*_component*()</code> functions (\bt_p{name}
164 parameter); you cannot change it afterwards.
166 Get a component's name with bt_component_get_name().
170 \anchor api-comp-prop-log-lvl
174 Logging level of the component (and its message iterators, if any).
176 A component's logging level is set when you
177 \ref api-graph-lc-add "add it to a trace processing graph" with one
178 of the <code>bt_graph_add_*_component*()</code> functions
179 (\bt_p{logging_level} parameter); as of
180 \bt_name_version_min_maj, you cannot change it afterwards.
182 Get a component's logging level with
183 bt_component_get_logging_level().
194 @typedef struct bt_component bt_component;
199 @typedef struct bt_component_source bt_component_source;
204 @typedef struct bt_component_filter bt_component_filter;
209 @typedef struct bt_component_sink bt_component_sink;
218 @name Class type query
224 Returns the type enumerator of the \ref api-comp-cls "class" of
225 the component \bt_p{component}.
228 Component of which to get the class's type enumerator.
231 Type enumerator of the class of \bt_p{component}.
233 @bt_pre_not_null{component}
235 @sa bt_component_is_source() —
236 Returns whether or not a component is a \bt_src_comp.
237 @sa bt_component_is_filter() —
238 Returns whether or not a component is a \bt_flt_comp.
239 @sa bt_component_is_sink() —
240 Returns whether or not a component is a \bt_sink_comp.
242 extern bt_component_class_type
bt_component_get_class_type(
243 const bt_component
*component
) __BT_NOEXCEPT
;
247 Returns whether or not the component \bt_p{component} is a
254 #BT_TRUE if \bt_p{component} is a source component.
256 @bt_pre_not_null{component}
258 @sa bt_component_get_class_type() —
259 Returns the type enumerator of a component's class.
262 bt_bool
bt_component_is_source(const bt_component
*component
) __BT_NOEXCEPT
264 return bt_component_get_class_type(component
) ==
265 BT_COMPONENT_CLASS_TYPE_SOURCE
;
270 Returns whether or not the component \bt_p{component} is a
277 #BT_TRUE if \bt_p{component} is a filter component.
279 @bt_pre_not_null{component}
281 @sa bt_component_get_class_type() —
282 Returns the type enumerator of a component's class.
285 bt_bool
bt_component_is_filter(const bt_component
*component
) __BT_NOEXCEPT
287 return bt_component_get_class_type(component
) ==
288 BT_COMPONENT_CLASS_TYPE_FILTER
;
293 Returns whether or not the component \bt_p{component} is a
300 #BT_TRUE if \bt_p{component} is a sink component.
302 @bt_pre_not_null{component}
304 @sa bt_component_get_class_type() —
305 Returns the type enumerator of a component's class.
308 bt_bool
bt_component_is_sink(const bt_component
*component
) __BT_NOEXCEPT
310 return bt_component_get_class_type(component
) ==
311 BT_COMPONENT_CLASS_TYPE_SINK
;
317 @name Common class access
323 Borrows the \ref api-comp-cls "class" of the component
327 Component of which to borrow the class.
330 \em Borrowed reference of the class of \bt_p{component}.
332 @bt_pre_not_null{component}
334 extern const bt_component_class
*bt_component_borrow_class_const(
335 const bt_component
*component
) __BT_NOEXCEPT
;
340 @name Common properties
346 Returns the name of the component \bt_p{component}.
348 See the \ref api-comp-prop-name "name" property.
351 Component of which to get the name.
355 Name of \bt_p{component}.
357 The returned pointer remains valid as long as \bt_p{component}
361 @bt_pre_not_null{component}
363 extern const char *bt_component_get_name(const bt_component
*component
)
368 Returns the logging level of the component \bt_p{component} and its
369 \bt_p_msg_iter, if any.
371 See the \ref api-comp-prop-log-lvl "logging level" property.
374 Component of which to get the logging level.
377 Logging level of \bt_p{component}.
379 @bt_pre_not_null{component}
381 extern bt_logging_level
bt_component_get_logging_level(
382 const bt_component
*component
) __BT_NOEXCEPT
;
387 @name Common reference count
393 Increments the \ref api-fund-shared-object "reference count" of
394 the component \bt_p{component}.
398 Component of which to increment the reference count.
403 @sa bt_component_put_ref() —
404 Decrements the reference count of a component.
406 extern void bt_component_get_ref(const bt_component
*component
) __BT_NOEXCEPT
;
410 Decrements the \ref api-fund-shared-object "reference count" of
411 the component \bt_p{component}.
415 Component of which to decrement the reference count.
420 @sa bt_component_get_ref() —
421 Increments the reference count of a component.
423 extern void bt_component_put_ref(const bt_component
*component
) __BT_NOEXCEPT
;
427 Decrements the reference count of the component
428 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
432 Component of which to decrement the reference count.
437 @bt_pre_assign_expr{_component}
439 #define BT_COMPONENT_PUT_REF_AND_RESET(_component) \
441 bt_component_put_ref(_component); \
442 (_component) = NULL; \
447 Decrements the reference count of the component \bt_p{_dst}, sets
448 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
450 This macro effectively moves a component reference from the expression
451 \bt_p{_src} to the expression \bt_p{_dst}, putting the existing
452 \bt_p{_dst} reference.
456 Destination expression.
467 @bt_pre_assign_expr{_dst}
468 @bt_pre_assign_expr{_src}
470 #define BT_COMPONENT_MOVE_REF(_dst, _src) \
472 bt_component_put_ref(_dst); \
480 @name Source component class access
486 Borrows the \ref api-comp-cls "class" of the \bt_src_comp
490 Source component of which to borrow the class.
493 \em Borrowed reference of the class of \bt_p{component}.
495 @bt_pre_not_null{component}
497 extern const bt_component_class_source
*
498 bt_component_source_borrow_class_const(
499 const bt_component_source
*component
) __BT_NOEXCEPT
;
504 @name Source component upcast
510 \ref api-fund-c-typing "Upcasts" the \bt_src_comp \bt_p{component}
511 to the common #bt_component type.
515 Source component to upcast.
521 \bt_p{component} as a common component.
524 const bt_component
*bt_component_source_as_component_const(
525 const bt_component_source
*component
) __BT_NOEXCEPT
527 return __BT_UPCAST_CONST(bt_component
, component
);
533 @name Source component port access
539 Returns the number of \bt_p_oport that the \bt_src_comp
540 \bt_p{component} has.
543 Source component of which to get the number of output ports.
546 Number of output ports that \bt_p{component} has.
548 @bt_pre_not_null{component}
550 extern uint64_t bt_component_source_get_output_port_count(
551 const bt_component_source
*component
) __BT_NOEXCEPT
;
555 Borrows the \bt_oport at index \bt_p{index} from the
556 \bt_src_comp \bt_p{component}.
559 Source component from which to borrow the output port at index
562 Index of the output port to borrow from \bt_p{component}.
566 \em Borrowed reference of the output port of
567 \bt_p{component} at index \bt_p{index}.
569 The returned pointer remains valid as long as \bt_p{component}
573 @bt_pre_not_null{component}
575 \bt_p{index} is less than the number of output ports
576 \bt_p{component} has (as returned by
577 bt_component_source_get_output_port_count()).
579 @sa bt_component_source_get_output_port_count() —
580 Returns the number of output ports that a source component has.
582 extern const bt_port_output
*
583 bt_component_source_borrow_output_port_by_index_const(
584 const bt_component_source
*component
,
585 uint64_t index
) __BT_NOEXCEPT
;
589 Borrows the \bt_oport named \bt_p{name} from the \bt_src_comp
592 If \bt_p{component} has no output port named \bt_p{name}, this function
596 Source component from which to borrow the output port
599 Name of the output port to borrow from \bt_p{component}.
603 \em Borrowed reference of the output port of
604 \bt_p{component} named \bt_p{name}, or \c NULL if none.
606 The returned pointer remains valid as long as \bt_p{component}
610 @bt_pre_not_null{component}
611 @bt_pre_not_null{name}
613 extern const bt_port_output
*
614 bt_component_source_borrow_output_port_by_name_const(
615 const bt_component_source
*component
,
616 const char *name
) __BT_NOEXCEPT
;
621 @name Source component reference count
627 Increments the \ref api-fund-shared-object "reference count" of
628 the \bt_src_comp \bt_p{component}.
632 Source component of which to increment the reference count.
637 @sa bt_component_source_put_ref() —
638 Decrements the reference count of a source component.
640 extern void bt_component_source_get_ref(
641 const bt_component_source
*component
) __BT_NOEXCEPT
;
645 Decrements the \ref api-fund-shared-object "reference count" of
646 the \bt_src_comp \bt_p{component}.
650 Source component of which to decrement the reference count.
655 @sa bt_component_source_get_ref() —
656 Increments the reference count of a source component.
658 extern void bt_component_source_put_ref(
659 const bt_component_source
*component
) __BT_NOEXCEPT
;
663 Decrements the reference count of the \bt_src_comp
664 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
668 Source component of which to decrement the reference count.
673 @bt_pre_assign_expr{_component}
675 #define BT_COMPONENT_SOURCE_PUT_REF_AND_RESET(_component) \
677 bt_component_source_put_ref(_component); \
678 (_component) = NULL; \
683 Decrements the reference count of the \bt_src_comp \bt_p{_dst}, sets
684 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
686 This macro effectively moves a source component reference from the
687 expression \bt_p{_src} to the expression \bt_p{_dst}, putting the
688 existing \bt_p{_dst} reference.
692 Destination expression.
703 @bt_pre_assign_expr{_dst}
704 @bt_pre_assign_expr{_src}
706 #define BT_COMPONENT_SOURCE_MOVE_REF(_dst, _src) \
708 bt_component_source_put_ref(_dst); \
716 @name Filter component class access
722 Borrows the \ref api-comp-cls "class" of the \bt_flt_comp
726 Filter component of which to borrow the class.
729 \em Borrowed reference of the class of \bt_p{component}.
731 @bt_pre_not_null{component}
733 extern const bt_component_class_filter
*
734 bt_component_filter_borrow_class_const(
735 const bt_component_filter
*component
) __BT_NOEXCEPT
;
740 @name Filter component upcast
746 \ref api-fund-c-typing "Upcasts" the \bt_flt_comp \bt_p{component}
747 to the common #bt_component type.
751 Filter component to upcast.
757 \bt_p{component} as a common component.
760 const bt_component
*bt_component_filter_as_component_const(
761 const bt_component_filter
*component
) __BT_NOEXCEPT
763 return __BT_UPCAST_CONST(bt_component
, component
);
769 @name Filter component port access
775 Returns the number of \bt_p_iport that the \bt_flt_comp
776 \bt_p{component} has.
779 Filter component of which to get the number of input ports.
782 Number of input ports that \bt_p{component} has.
784 @bt_pre_not_null{component}
786 extern uint64_t bt_component_filter_get_input_port_count(
787 const bt_component_filter
*component
) __BT_NOEXCEPT
;
791 Borrows the \bt_iport at index \bt_p{index} from the
792 \bt_flt_comp \bt_p{component}.
795 Filter component from which to borrow the input port at index
798 Index of the input port to borrow from \bt_p{component}.
802 \em Borrowed reference of the input port of
803 \bt_p{component} at index \bt_p{index}.
805 The returned pointer remains valid as long as \bt_p{component}
809 @bt_pre_not_null{component}
811 \bt_p{index} is less than the number of input ports
812 \bt_p{component} has (as returned by
813 bt_component_filter_get_input_port_count()).
815 @sa bt_component_filter_get_input_port_count() —
816 Returns the number of input ports that a filter component has.
818 extern const bt_port_input
*
819 bt_component_filter_borrow_input_port_by_index_const(
820 const bt_component_filter
*component
, uint64_t index
)
825 Borrows the \bt_iport named \bt_p{name} from the \bt_flt_comp
828 If \bt_p{component} has no input port named \bt_p{name}, this function
832 Filter component from which to borrow the input port
835 Name of the input port to borrow from \bt_p{component}.
839 \em Borrowed reference of the input port of
840 \bt_p{component} named \bt_p{name}, or \c NULL if none.
842 The returned pointer remains valid as long as \bt_p{component}
846 @bt_pre_not_null{component}
847 @bt_pre_not_null{name}
849 extern const bt_port_input
*
850 bt_component_filter_borrow_input_port_by_name_const(
851 const bt_component_filter
*component
, const char *name
)
856 Returns the number of \bt_p_oport that the \bt_flt_comp
857 \bt_p{component} has.
860 Filter component of which to get the number of output ports.
863 Number of output ports that \bt_p{component} has.
865 @bt_pre_not_null{component}
867 extern uint64_t bt_component_filter_get_output_port_count(
868 const bt_component_filter
*component
) __BT_NOEXCEPT
;
872 Borrows the \bt_oport at index \bt_p{index} from the
873 \bt_flt_comp \bt_p{component}.
876 Filter component from which to borrow the output port at index
879 Index of the output port to borrow from \bt_p{component}.
883 \em Borrowed reference of the output port of
884 \bt_p{component} at index \bt_p{index}.
886 The returned pointer remains valid as long as \bt_p{component}
890 @bt_pre_not_null{component}
892 \bt_p{index} is less than the number of output ports
893 \bt_p{component} has (as returned by
894 bt_component_filter_get_output_port_count()).
896 @sa bt_component_filter_get_output_port_count() —
897 Returns the number of output ports that a filter component has.
899 extern const bt_port_output
*
900 bt_component_filter_borrow_output_port_by_index_const(
901 const bt_component_filter
*component
, uint64_t index
)
906 Borrows the \bt_oport named \bt_p{name} from the \bt_flt_comp
909 If \bt_p{component} has no output port named \bt_p{name}, this function
913 Filter component from which to borrow the output port
916 Name of the output port to borrow from \bt_p{component}.
920 \em Borrowed reference of the output port of
921 \bt_p{component} named \bt_p{name}, or \c NULL if none.
923 The returned pointer remains valid as long as \bt_p{component}
927 @bt_pre_not_null{component}
928 @bt_pre_not_null{name}
930 extern const bt_port_output
*
931 bt_component_filter_borrow_output_port_by_name_const(
932 const bt_component_filter
*component
, const char *name
)
938 @name Filter component reference count
944 Increments the \ref api-fund-shared-object "reference count" of
945 the \bt_flt_comp \bt_p{component}.
949 Filter component of which to increment the reference count.
954 @sa bt_component_filter_put_ref() —
955 Decrements the reference count of a filter component.
957 extern void bt_component_filter_get_ref(
958 const bt_component_filter
*component
) __BT_NOEXCEPT
;
962 Decrements the \ref api-fund-shared-object "reference count" of
963 the \bt_flt_comp \bt_p{component}.
967 Filter component of which to decrement the reference count.
972 @sa bt_component_filter_get_ref() —
973 Increments the reference count of a filter component.
975 extern void bt_component_filter_put_ref(
976 const bt_component_filter
*component
) __BT_NOEXCEPT
;
980 Decrements the reference count of the \bt_flt_comp
981 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
985 Filter component of which to decrement the reference count.
990 @bt_pre_assign_expr{_component}
992 #define BT_COMPONENT_FILTER_PUT_REF_AND_RESET(_component) \
994 bt_component_filter_put_ref(_component); \
995 (_component) = NULL; \
1000 Decrements the reference count of the \bt_flt_comp \bt_p{_dst}, sets
1001 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
1003 This macro effectively moves a filter component reference from the
1004 expression \bt_p{_src} to the expression \bt_p{_dst}, putting the
1005 existing \bt_p{_dst} reference.
1009 Destination expression.
1011 Can contain \c NULL.
1017 Can contain \c NULL.
1020 @bt_pre_assign_expr{_dst}
1021 @bt_pre_assign_expr{_src}
1023 #define BT_COMPONENT_FILTER_MOVE_REF(_dst, _src) \
1025 bt_component_filter_put_ref(_dst); \
1033 @name Sink component class access
1039 Borrows the \ref api-comp-cls "class" of the \bt_sink_comp
1042 @param[in] component
1043 Sink component of which to borrow the class.
1046 \em Borrowed reference of the class of \bt_p{component}.
1048 @bt_pre_not_null{component}
1050 extern const bt_component_class_sink
*
1051 bt_component_sink_borrow_class_const(
1052 const bt_component_sink
*component
) __BT_NOEXCEPT
;
1057 @name Sink component upcast
1063 \ref api-fund-c-typing "Upcasts" the \bt_sink_comp \bt_p{component}
1064 to the common #bt_component type.
1066 @param[in] component
1068 Sink component to upcast.
1074 \bt_p{component} as a common component.
1077 const bt_component
*bt_component_sink_as_component_const(
1078 const bt_component_sink
*component
) __BT_NOEXCEPT
1080 return __BT_UPCAST_CONST(bt_component
, component
);
1086 @name Sink component port access
1092 Returns the number of \bt_p_iport that the \bt_sink_comp
1093 \bt_p{component} has.
1095 @param[in] component
1096 Sink component of which to get the number of input ports.
1099 Number of input ports that \bt_p{component} has.
1101 @bt_pre_not_null{component}
1103 extern uint64_t bt_component_sink_get_input_port_count(
1104 const bt_component_sink
*component
) __BT_NOEXCEPT
;
1108 Borrows the \bt_iport at index \bt_p{index} from the
1109 \bt_sink_comp \bt_p{component}.
1111 @param[in] component
1112 Sink component from which to borrow the input port at index
1115 Index of the input port to borrow from \bt_p{component}.
1119 \em Borrowed reference of the input port of
1120 \bt_p{component} at index \bt_p{index}.
1122 The returned pointer remains valid as long as \bt_p{component}
1126 @bt_pre_not_null{component}
1128 \bt_p{index} is less than the number of input ports
1129 \bt_p{component} has (as returned by
1130 bt_component_sink_get_input_port_count()).
1132 @sa bt_component_sink_get_input_port_count() —
1133 Returns the number of input ports that a sink component has.
1135 extern const bt_port_input
*
1136 bt_component_sink_borrow_input_port_by_index_const(
1137 const bt_component_sink
*component
, uint64_t index
)
1142 Borrows the \bt_oport named \bt_p{name} from the \bt_sink_comp
1145 If \bt_p{component} has no output port named \bt_p{name}, this function
1148 @param[in] component
1149 Sink component from which to borrow the output port
1152 Name of the output port to borrow from \bt_p{component}.
1156 \em Borrowed reference of the output port of
1157 \bt_p{component} named \bt_p{name}, or \c NULL if none.
1159 The returned pointer remains valid as long as \bt_p{component}
1163 @bt_pre_not_null{component}
1164 @bt_pre_not_null{name}
1166 extern const bt_port_input
*
1167 bt_component_sink_borrow_input_port_by_name_const(
1168 const bt_component_sink
*component
, const char *name
)
1174 @name Sink component reference count
1180 Increments the \ref api-fund-shared-object "reference count" of
1181 the \bt_sink_comp \bt_p{component}.
1183 @param[in] component
1185 Sink component of which to increment the reference count.
1190 @sa bt_component_sink_put_ref() —
1191 Decrements the reference count of a sink component.
1193 extern void bt_component_sink_get_ref(
1194 const bt_component_sink
*component
) __BT_NOEXCEPT
;
1198 Decrements the \ref api-fund-shared-object "reference count" of
1199 the \bt_sink_comp \bt_p{component}.
1201 @param[in] component
1203 Sink component of which to decrement the reference count.
1208 @sa bt_component_sink_get_ref() —
1209 Increments the reference count of a sink component.
1211 extern void bt_component_sink_put_ref(
1212 const bt_component_sink
*component
) __BT_NOEXCEPT
;
1216 Decrements the reference count of the \bt_sink_comp
1217 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
1221 Sink component of which to decrement the reference count.
1223 Can contain \c NULL.
1226 @bt_pre_assign_expr{_component}
1228 #define BT_COMPONENT_SINK_PUT_REF_AND_RESET(_component) \
1230 bt_component_sink_put_ref(_component); \
1231 (_component) = NULL; \
1236 Decrements the reference count of the \bt_sink_comp \bt_p{_dst},
1237 sets \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to
1240 This macro effectively moves a sink component reference from the
1241 expression \bt_p{_src} to the expression \bt_p{_dst}, putting the
1242 existing \bt_p{_dst} reference.
1246 Destination expression.
1248 Can contain \c NULL.
1254 Can contain \c NULL.
1257 @bt_pre_assign_expr{_dst}
1258 @bt_pre_assign_expr{_src}
1260 #define BT_COMPONENT_SINK_MOVE_REF(_dst, _src) \
1262 bt_component_sink_put_ref(_dst); \
1275 #endif /* BABELTRACE2_GRAPH_COMPONENT_H */