1 #ifndef BABELTRACE2_GRAPH_COMPONENT_H
2 #define BABELTRACE2_GRAPH_COMPONENT_H
5 * Copyright (c) 2010-2019 EfficiOS Inc. and Linux Foundation
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #ifndef __BT_IN_BABELTRACE_H
27 # error "Please include <babeltrace2/babeltrace.h> instead."
30 #include <babeltrace2/graph/component-class.h>
31 #include <babeltrace2/types.h>
32 #include <babeltrace2/logging.h>
39 @defgroup api-comp Components
43 Source, filter, and sink components: nodes in a trace processing
46 A <strong><em>component</em></strong> is a node within a trace
49 @image html component.png
51 A component is \bt_comp_cls instance. Borrow the class of a
52 component with bt_component_borrow_class_const(),
53 bt_component_source_borrow_class_const(),
54 bt_component_filter_borrow_class_const(), and
55 bt_component_sink_borrow_class_const().
57 A component is a \ref api-fund-shared-object "shared object": get a new
58 reference with bt_component_get_ref() and put an existing reference with
59 bt_component_put_ref().
61 The common C type of a port is #bt_component.
63 There are three types of components, which come from the three types
67 <dt>\anchor api-comp-src Source component</dt>
69 A source component's \bt_msg_iter emits fresh \bt_p_msg.
71 A source component's specific type is #bt_component_source and its
72 class's type enumerator is #BT_COMPONENT_CLASS_TYPE_SOURCE.
74 \ref api-fund-c-typing "Upcast" the #bt_component_source type to the
75 #bt_component type with bt_component_source_as_component_const().
77 Get a new source component reference with
78 bt_component_source_get_ref() and put an existing one with
79 bt_component_source_put_ref().
81 A source component has \bt_p_oport only.
83 Get the number of output ports a source component has with
84 bt_component_source_get_output_port_count().
86 Borrow a source component's output port by index with
87 bt_component_source_borrow_output_port_by_index_const() or by name
88 with bt_component_source_borrow_output_port_by_name_const().
91 <dt>\anchor api-comp-flt Filter component</dt>
93 A filter component's message iterator emits fresh and transformed
94 messages. It can also discard existing messages.
96 A filter component's specific type is #bt_component_filter and its
97 class's type enumerator is #BT_COMPONENT_CLASS_TYPE_FILTER.
99 \ref api-fund-c-typing "Upcast" the #bt_component_filter type to the
100 #bt_component type with bt_component_filter_as_component_const().
102 Get a new filter component reference with
103 bt_component_filter_get_ref() and put an existing one with
104 bt_component_filter_put_ref().
106 A filter component has \bt_p_iport and \bt_p_oport.
108 Get the number of output ports a filter component has with
109 bt_component_filter_get_output_port_count().
111 Borrow a filter component's output port by index with
112 bt_component_filter_borrow_output_port_by_index_const() or by name
113 with bt_component_filter_borrow_output_port_by_name_const().
115 Get the number of input ports a filter component has with
116 bt_component_filter_get_input_port_count().
118 Borrow a filter component's input port by index with
119 bt_component_filter_borrow_input_port_by_index_const() or by name
120 with bt_component_filter_borrow_input_port_by_name_const().
123 <dt>\anchor api-comp-sink Sink component</dt>
125 A sink component consumes messages from a source or filter message
128 A filter component's specific type is #bt_component_sink and its
129 class's type enumerator is #BT_COMPONENT_CLASS_TYPE_SINK.
131 \ref api-fund-c-typing "Upcast" the #bt_component_sink type to the
132 #bt_component type with bt_component_sink_as_component_const().
134 Get a new sink component reference with bt_component_sink_get_ref()
135 and put an existing one with bt_component_sink_put_ref().
137 A sink component has \bt_p_iport only.
139 Get the number of input ports a sink component has with
140 bt_component_sink_get_input_port_count().
142 Borrow a sink component's input port by index with
143 bt_component_sink_borrow_input_port_by_index_const() or by name
144 with bt_component_sink_borrow_input_port_by_name_const().
148 Get a component's class type enumerator with
149 bt_component_get_class_type(). You can also use the
150 bt_component_is_source(), bt_component_is_filter(), and
151 bt_component_is_sink() helper functions.
153 You cannot directly create a component: there are no
154 <code>bt_component_*_create()</code> functions. A trace processing
155 \bt_graph creates a component from a \bt_comp_cls when you call one of
156 the <code>bt_graph_add_*_component*()</code> functions. Those functions
157 also return a borrowed reference of the created component through their
158 \bt_p{component} parameter.
162 A component has the following common properties:
166 \anchor api-comp-prop-name
170 Name of the component.
172 Each component has a unique name within a given trace processing
175 A component's name is set when you
176 \ref api-graph-lc-add "add it to a graph" with one of the
177 <code>bt_graph_add_*_component*()</code> functions (\bt_p{name}
178 parameter); you cannot change it afterwards.
180 Get a component's name with bt_component_get_name().
184 \anchor api-comp-prop-log-lvl
188 Logging level of the component (and its message iterators, if any).
190 A component's logging level is set when you
191 \ref api-graph-lc-add "add it to a trace processing graph" with one
192 of the <code>bt_graph_add_*_component*()</code> functions
193 (\bt_p{logging_level} parameter); as of
194 \bt_name_version_min_maj, you cannot change it afterwards.
196 Get a component's logging level with
197 bt_component_get_logging_level().
208 @typedef struct bt_component bt_component;
213 @typedef struct bt_component_source bt_component_source;
218 @typedef struct bt_component_filter bt_component_filter;
223 @typedef struct bt_component_sink bt_component_sink;
232 @name Class type query
238 Returns the type enumerator of the \ref api-comp-cls "class" of
239 the component \bt_p{component}.
242 Component of which to get the class's type enumerator.
245 Type enumerator of the class of \bt_p{component}.
247 @bt_pre_not_null{component}
249 @sa bt_component_is_source() —
250 Returns whether or not a component is a \bt_src_comp.
251 @sa bt_component_is_filter() —
252 Returns whether or not a component is a \bt_flt_comp.
253 @sa bt_component_is_sink() —
254 Returns whether or not a component is a \bt_sink_comp.
256 extern bt_component_class_type
bt_component_get_class_type(
257 const bt_component
*component
);
261 Returns whether or not the component \bt_p{component} is a
268 #BT_TRUE if \bt_p{component} is a source component.
270 @bt_pre_not_null{component}
272 @sa bt_component_get_class_type() —
273 Returns the type enumerator of a component's class.
276 bt_bool
bt_component_is_source(const bt_component
*component
)
278 return bt_component_get_class_type(component
) ==
279 BT_COMPONENT_CLASS_TYPE_SOURCE
;
284 Returns whether or not the component \bt_p{component} is a
291 #BT_TRUE if \bt_p{component} is a filter component.
293 @bt_pre_not_null{component}
295 @sa bt_component_get_class_type() —
296 Returns the type enumerator of a component's class.
299 bt_bool
bt_component_is_filter(const bt_component
*component
)
301 return bt_component_get_class_type(component
) ==
302 BT_COMPONENT_CLASS_TYPE_FILTER
;
307 Returns whether or not the component \bt_p{component} is a
314 #BT_TRUE if \bt_p{component} is a sink component.
316 @bt_pre_not_null{component}
318 @sa bt_component_get_class_type() —
319 Returns the type enumerator of a component's class.
322 bt_bool
bt_component_is_sink(const bt_component
*component
)
324 return bt_component_get_class_type(component
) ==
325 BT_COMPONENT_CLASS_TYPE_SINK
;
331 @name Common class access
337 Borrows the \ref api-comp-cls "class" of the component
341 Component of which to borrow the class.
344 \em Borrowed reference of the class of \bt_p{component}.
346 @bt_pre_not_null{component}
348 extern const bt_component_class
*bt_component_borrow_class_const(
349 const bt_component
*component
);
354 @name Common properties
360 Returns the name of the component \bt_p{component}.
362 See the \ref api-comp-prop-name "name" property.
365 Component of which to get the name.
369 Name of \bt_p{component}.
371 The returned pointer remains valid as long as \bt_p{component}
375 @bt_pre_not_null{component}
377 extern const char *bt_component_get_name(const bt_component
*component
);
381 Returns the logging level of the component \bt_p{component} and its
382 \bt_p_msg_iter, if any.
384 See the \ref api-comp-prop-log-lvl "logging level" property.
387 Component of which to get the logging level.
390 Logging level of \bt_p{component}.
392 @bt_pre_not_null{component}
394 extern bt_logging_level
bt_component_get_logging_level(
395 const bt_component
*component
);
400 @name Common reference count
406 Increments the \ref api-fund-shared-object "reference count" of
407 the component \bt_p{component}.
411 Component of which to increment the reference count.
416 @sa bt_component_put_ref() —
417 Decrements the reference count of a component.
419 extern void bt_component_get_ref(const bt_component
*component
);
423 Decrements the \ref api-fund-shared-object "reference count" of
424 the component \bt_p{component}.
428 Component of which to decrement the reference count.
433 @sa bt_component_get_ref() —
434 Increments the reference count of a component.
436 extern void bt_component_put_ref(const bt_component
*component
);
440 Decrements the reference count of the component
441 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
445 Component of which to decrement the reference count.
450 @bt_pre_assign_expr{_component}
452 #define BT_COMPONENT_PUT_REF_AND_RESET(_component) \
454 bt_component_put_ref(_component); \
455 (_component) = NULL; \
460 Decrements the reference count of the component \bt_p{_dst}, sets
461 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
463 This macro effectively moves a component reference from the expression
464 \bt_p{_src} to the expression \bt_p{_dst}, putting the existing
465 \bt_p{_dst} reference.
469 Destination expression.
480 @bt_pre_assign_expr{_dst}
481 @bt_pre_assign_expr{_src}
483 #define BT_COMPONENT_MOVE_REF(_dst, _src) \
485 bt_component_put_ref(_dst); \
493 @name Source component class access
499 Borrows the \ref api-comp-cls "class" of the \bt_src_comp
503 Source component of which to borrow the class.
506 \em Borrowed reference of the class of \bt_p{component}.
508 @bt_pre_not_null{component}
510 extern const bt_component_class_source
*
511 bt_component_source_borrow_class_const(
512 const bt_component_source
*component
);
517 @name Source component upcast
523 \ref api-fund-c-typing "Upcasts" the \bt_src_comp \bt_p{component}
524 to the common #bt_component type.
528 Source component to upcast.
534 \bt_p{component} as a common component.
537 const bt_component
*bt_component_source_as_component_const(
538 const bt_component_source
*component
)
540 return __BT_UPCAST_CONST(bt_component
, component
);
546 @name Source component port access
552 Returns the number of \bt_p_oport that the \bt_src_comp
553 \bt_p{component} has.
556 Source component of which to get the number of output ports.
559 Number of output ports that \bt_p{component} has.
561 @bt_pre_not_null{component}
563 extern uint64_t bt_component_source_get_output_port_count(
564 const bt_component_source
*component
);
568 Borrows the \bt_oport at index \bt_p{index} from the
569 \bt_src_comp \bt_p{component}.
572 Source component from which to borrow the output port at index
575 Index of the output port to borrow from \bt_p{component}.
579 \em Borrowed reference of the output port of
580 \bt_p{component} at index \bt_p{index}.
582 The returned pointer remains valid as long as \bt_p{component}
586 @bt_pre_not_null{component}
588 \bt_p{index} is less than the number of output ports
589 \bt_p{component} has (as returned by
590 bt_component_source_get_output_port_count()).
592 @sa bt_component_source_get_output_port_count() —
593 Returns the number of output ports that a source component has.
595 extern const bt_port_output
*
596 bt_component_source_borrow_output_port_by_index_const(
597 const bt_component_source
*component
, uint64_t index
);
601 Borrows the \bt_oport named \bt_p{name} from the \bt_src_comp
604 If \bt_p{component} has no output port named \bt_p{name}, this function
608 Source component from which to borrow the output port
611 Name of the output port to borrow from \bt_p{component}.
615 \em Borrowed reference of the output port of
616 \bt_p{component} named \bt_p{name}, or \c NULL if none.
618 The returned pointer remains valid as long as \bt_p{component}
622 @bt_pre_not_null{component}
623 @bt_pre_not_null{name}
625 extern const bt_port_output
*
626 bt_component_source_borrow_output_port_by_name_const(
627 const bt_component_source
*component
, const char *name
);
632 @name Source component reference count
638 Increments the \ref api-fund-shared-object "reference count" of
639 the \bt_src_comp \bt_p{component}.
643 Source component of which to increment the reference count.
648 @sa bt_component_source_put_ref() —
649 Decrements the reference count of a source component.
651 extern void bt_component_source_get_ref(
652 const bt_component_source
*component
);
656 Decrements the \ref api-fund-shared-object "reference count" of
657 the \bt_src_comp \bt_p{component}.
661 Source component of which to decrement the reference count.
666 @sa bt_component_source_get_ref() —
667 Increments the reference count of a source component.
669 extern void bt_component_source_put_ref(
670 const bt_component_source
*component
);
674 Decrements the reference count of the \bt_src_comp
675 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
679 Source component of which to decrement the reference count.
684 @bt_pre_assign_expr{_component}
686 #define BT_COMPONENT_SOURCE_PUT_REF_AND_RESET(_component) \
688 bt_component_source_put_ref(_component); \
689 (_component) = NULL; \
694 Decrements the reference count of the \bt_src_comp \bt_p{_dst}, sets
695 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
697 This macro effectively moves a source component reference from the
698 expression \bt_p{_src} to the expression \bt_p{_dst}, putting the
699 existing \bt_p{_dst} reference.
703 Destination expression.
714 @bt_pre_assign_expr{_dst}
715 @bt_pre_assign_expr{_src}
717 #define BT_COMPONENT_SOURCE_MOVE_REF(_dst, _src) \
719 bt_component_source_put_ref(_dst); \
727 @name Filter component class access
733 Borrows the \ref api-comp-cls "class" of the \bt_flt_comp
737 Filter component of which to borrow the class.
740 \em Borrowed reference of the class of \bt_p{component}.
742 @bt_pre_not_null{component}
744 extern const bt_component_class_filter
*
745 bt_component_filter_borrow_class_const(
746 const bt_component_filter
*component
);
751 @name Filter component upcast
757 \ref api-fund-c-typing "Upcasts" the \bt_flt_comp \bt_p{component}
758 to the common #bt_component type.
762 Filter component to upcast.
768 \bt_p{component} as a common component.
771 const bt_component
*bt_component_filter_as_component_const(
772 const bt_component_filter
*component
)
774 return __BT_UPCAST_CONST(bt_component
, component
);
780 @name Filter component port access
786 Returns the number of \bt_p_iport that the \bt_flt_comp
787 \bt_p{component} has.
790 Filter component of which to get the number of input ports.
793 Number of input ports that \bt_p{component} has.
795 @bt_pre_not_null{component}
797 extern uint64_t bt_component_filter_get_input_port_count(
798 const bt_component_filter
*component
);
802 Borrows the \bt_iport at index \bt_p{index} from the
803 \bt_flt_comp \bt_p{component}.
806 Filter component from which to borrow the input port at index
809 Index of the input port to borrow from \bt_p{component}.
813 \em Borrowed reference of the input port of
814 \bt_p{component} at index \bt_p{index}.
816 The returned pointer remains valid as long as \bt_p{component}
820 @bt_pre_not_null{component}
822 \bt_p{index} is less than the number of input ports
823 \bt_p{component} has (as returned by
824 bt_component_filter_get_input_port_count()).
826 @sa bt_component_filter_get_input_port_count() —
827 Returns the number of input ports that a filter component has.
829 extern const bt_port_input
*
830 bt_component_filter_borrow_input_port_by_index_const(
831 const bt_component_filter
*component
, uint64_t index
);
835 Borrows the \bt_iport named \bt_p{name} from the \bt_flt_comp
838 If \bt_p{component} has no input port named \bt_p{name}, this function
842 Filter component from which to borrow the input port
845 Name of the input port to borrow from \bt_p{component}.
849 \em Borrowed reference of the input port of
850 \bt_p{component} named \bt_p{name}, or \c NULL if none.
852 The returned pointer remains valid as long as \bt_p{component}
856 @bt_pre_not_null{component}
857 @bt_pre_not_null{name}
859 extern const bt_port_input
*
860 bt_component_filter_borrow_input_port_by_name_const(
861 const bt_component_filter
*component
, const char *name
);
865 Returns the number of \bt_p_oport that the \bt_flt_comp
866 \bt_p{component} has.
869 Filter component of which to get the number of output ports.
872 Number of output ports that \bt_p{component} has.
874 @bt_pre_not_null{component}
876 extern uint64_t bt_component_filter_get_output_port_count(
877 const bt_component_filter
*component
);
881 Borrows the \bt_oport at index \bt_p{index} from the
882 \bt_flt_comp \bt_p{component}.
885 Filter component from which to borrow the output port at index
888 Index of the output port to borrow from \bt_p{component}.
892 \em Borrowed reference of the output port of
893 \bt_p{component} at index \bt_p{index}.
895 The returned pointer remains valid as long as \bt_p{component}
899 @bt_pre_not_null{component}
901 \bt_p{index} is less than the number of output ports
902 \bt_p{component} has (as returned by
903 bt_component_filter_get_output_port_count()).
905 @sa bt_component_filter_get_output_port_count() —
906 Returns the number of output ports that a filter component has.
908 extern const bt_port_output
*
909 bt_component_filter_borrow_output_port_by_index_const(
910 const bt_component_filter
*component
, uint64_t index
);
914 Borrows the \bt_oport named \bt_p{name} from the \bt_flt_comp
917 If \bt_p{component} has no output port named \bt_p{name}, this function
921 Filter component from which to borrow the output port
924 Name of the output port to borrow from \bt_p{component}.
928 \em Borrowed reference of the output port of
929 \bt_p{component} named \bt_p{name}, or \c NULL if none.
931 The returned pointer remains valid as long as \bt_p{component}
935 @bt_pre_not_null{component}
936 @bt_pre_not_null{name}
938 extern const bt_port_output
*
939 bt_component_filter_borrow_output_port_by_name_const(
940 const bt_component_filter
*component
, const char *name
);
945 @name Filter component reference count
951 Increments the \ref api-fund-shared-object "reference count" of
952 the \bt_flt_comp \bt_p{component}.
956 Filter component of which to increment the reference count.
961 @sa bt_component_filter_put_ref() —
962 Decrements the reference count of a filter component.
964 extern void bt_component_filter_get_ref(
965 const bt_component_filter
*component
);
969 Decrements the \ref api-fund-shared-object "reference count" of
970 the \bt_flt_comp \bt_p{component}.
974 Filter component of which to decrement the reference count.
979 @sa bt_component_filter_get_ref() —
980 Increments the reference count of a filter component.
982 extern void bt_component_filter_put_ref(
983 const bt_component_filter
*component
);
987 Decrements the reference count of the \bt_flt_comp
988 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
992 Filter component of which to decrement the reference count.
997 @bt_pre_assign_expr{_component}
999 #define BT_COMPONENT_FILTER_PUT_REF_AND_RESET(_component) \
1001 bt_component_filter_put_ref(_component); \
1002 (_component) = NULL; \
1007 Decrements the reference count of the \bt_flt_comp \bt_p{_dst}, sets
1008 \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to \c NULL.
1010 This macro effectively moves a filter component reference from the
1011 expression \bt_p{_src} to the expression \bt_p{_dst}, putting the
1012 existing \bt_p{_dst} reference.
1016 Destination expression.
1018 Can contain \c NULL.
1024 Can contain \c NULL.
1027 @bt_pre_assign_expr{_dst}
1028 @bt_pre_assign_expr{_src}
1030 #define BT_COMPONENT_FILTER_MOVE_REF(_dst, _src) \
1032 bt_component_filter_put_ref(_dst); \
1040 @name Sink component class access
1046 Borrows the \ref api-comp-cls "class" of the \bt_sink_comp
1049 @param[in] component
1050 Sink component of which to borrow the class.
1053 \em Borrowed reference of the class of \bt_p{component}.
1055 @bt_pre_not_null{component}
1057 extern const bt_component_class_sink
*
1058 bt_component_sink_borrow_class_const(
1059 const bt_component_sink
*component
);
1064 @name Sink component upcast
1070 \ref api-fund-c-typing "Upcasts" the \bt_sink_comp \bt_p{component}
1071 to the common #bt_component type.
1073 @param[in] component
1075 Sink component to upcast.
1081 \bt_p{component} as a common component.
1084 const bt_component
*bt_component_sink_as_component_const(
1085 const bt_component_sink
*component
)
1087 return __BT_UPCAST_CONST(bt_component
, component
);
1093 @name Sink component port access
1099 Returns the number of \bt_p_iport that the \bt_sink_comp
1100 \bt_p{component} has.
1102 @param[in] component
1103 Sink component of which to get the number of input ports.
1106 Number of input ports that \bt_p{component} has.
1108 @bt_pre_not_null{component}
1110 extern uint64_t bt_component_sink_get_input_port_count(
1111 const bt_component_sink
*component
);
1115 Borrows the \bt_iport at index \bt_p{index} from the
1116 \bt_sink_comp \bt_p{component}.
1118 @param[in] component
1119 Sink component from which to borrow the input port at index
1122 Index of the input port to borrow from \bt_p{component}.
1126 \em Borrowed reference of the input port of
1127 \bt_p{component} at index \bt_p{index}.
1129 The returned pointer remains valid as long as \bt_p{component}
1133 @bt_pre_not_null{component}
1135 \bt_p{index} is less than the number of input ports
1136 \bt_p{component} has (as returned by
1137 bt_component_sink_get_input_port_count()).
1139 @sa bt_component_sink_get_input_port_count() —
1140 Returns the number of input ports that a sink component has.
1142 extern const bt_port_input
*
1143 bt_component_sink_borrow_input_port_by_index_const(
1144 const bt_component_sink
*component
, uint64_t index
);
1148 Borrows the \bt_oport named \bt_p{name} from the \bt_sink_comp
1151 If \bt_p{component} has no output port named \bt_p{name}, this function
1154 @param[in] component
1155 Sink component from which to borrow the output port
1158 Name of the output port to borrow from \bt_p{component}.
1162 \em Borrowed reference of the output port of
1163 \bt_p{component} named \bt_p{name}, or \c NULL if none.
1165 The returned pointer remains valid as long as \bt_p{component}
1169 @bt_pre_not_null{component}
1170 @bt_pre_not_null{name}
1172 extern const bt_port_input
*
1173 bt_component_sink_borrow_input_port_by_name_const(
1174 const bt_component_sink
*component
, const char *name
);
1179 @name Sink component reference count
1185 Increments the \ref api-fund-shared-object "reference count" of
1186 the \bt_sink_comp \bt_p{component}.
1188 @param[in] component
1190 Sink component of which to increment the reference count.
1195 @sa bt_component_sink_put_ref() —
1196 Decrements the reference count of a sink component.
1198 extern void bt_component_sink_get_ref(
1199 const bt_component_sink
*component
);
1203 Decrements the \ref api-fund-shared-object "reference count" of
1204 the \bt_sink_comp \bt_p{component}.
1206 @param[in] component
1208 Sink component of which to decrement the reference count.
1213 @sa bt_component_sink_get_ref() —
1214 Increments the reference count of a sink component.
1216 extern void bt_component_sink_put_ref(
1217 const bt_component_sink
*component
);
1221 Decrements the reference count of the \bt_sink_comp
1222 \bt_p{_component}, and then sets \bt_p{_component} to \c NULL.
1226 Sink component of which to decrement the reference count.
1228 Can contain \c NULL.
1231 @bt_pre_assign_expr{_component}
1233 #define BT_COMPONENT_SINK_PUT_REF_AND_RESET(_component) \
1235 bt_component_sink_put_ref(_component); \
1236 (_component) = NULL; \
1241 Decrements the reference count of the \bt_sink_comp \bt_p{_dst},
1242 sets \bt_p{_dst} to \bt_p{_src}, and then sets \bt_p{_src} to
1245 This macro effectively moves a sink component reference from the
1246 expression \bt_p{_src} to the expression \bt_p{_dst}, putting the
1247 existing \bt_p{_dst} reference.
1251 Destination expression.
1253 Can contain \c NULL.
1259 Can contain \c NULL.
1262 @bt_pre_assign_expr{_dst}
1263 @bt_pre_assign_expr{_src}
1265 #define BT_COMPONENT_SINK_MOVE_REF(_dst, _src) \
1267 bt_component_sink_put_ref(_dst); \
1280 #endif /* BABELTRACE2_GRAPH_COMPONENT_H */