7 #ifndef BABELTRACE2_GRAPH_COMPONENT_H
8 #define BABELTRACE2_GRAPH_COMPONENT_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>
439 #define BT_COMPONENT_PUT_REF_AND_RESET(_component) \
441 bt_component_put_ref(_component); \
442 (_component) = NULL; \
470 #define BT_COMPONENT_MOVE_REF(_dst, _src) \
472 bt_component_put_ref(_dst); \
585 uint64_t index) __BT_NOEXCEPT;
616 const char *name) __BT_NOEXCEPT;
675 #define BT_COMPONENT_SOURCE_PUT_REF_AND_RESET(_component) \
677 bt_component_source_put_ref(_component); \
678 (_component) = NULL; \
706 #define BT_COMPONENT_SOURCE_MOVE_REF(_dst, _src) \
708 bt_component_source_put_ref(_dst); \
992 #define BT_COMPONENT_FILTER_PUT_REF_AND_RESET(_component) \
994 bt_component_filter_put_ref(_component); \
995 (_component) = NULL; \
1023 #define BT_COMPONENT_FILTER_MOVE_REF(_dst, _src) \
1025 bt_component_filter_put_ref(_dst); \
1228 #define BT_COMPONENT_SINK_PUT_REF_AND_RESET(_component) \
1230 bt_component_sink_put_ref(_component); \
1231 (_component) = NULL; \
1260 #define BT_COMPONENT_SINK_MOVE_REF(_dst, _src) \
1262 bt_component_sink_put_ref(_dst); \
const char * bt_component_get_name(const bt_component *component)
Returns the name of the component component.
struct bt_component_class_source bt_component_class_source
Source component class.
Definition: types.h:28
static const bt_component * bt_component_source_as_component_const(const bt_component_source *component)
Upcasts the source component component to the common bt_component type.
Definition: component.h:524
struct bt_component_sink bt_component_sink
Sink component.
Definition: types.h:31
uint64_t bt_component_filter_get_output_port_count(const bt_component_filter *component)
Returns the number of output ports that the filter component component has.
void bt_component_filter_get_ref(const bt_component_filter *component)
Increments the reference count of the filter component component.
struct bt_port_input bt_port_input
Input port.
Definition: types.h:66
struct bt_component_source bt_component_source
Source component.
Definition: types.h:32
struct bt_component_class_filter bt_component_class_filter
Filter component class.
Definition: types.h:26
struct bt_port_output bt_port_output
Output port.
Definition: types.h:67
uint64_t bt_component_filter_get_input_port_count(const bt_component_filter *component)
Returns the number of input ports that the filter component component has.
const bt_port_input * bt_component_filter_borrow_input_port_by_name_const(const bt_component_filter *component, const char *name)
Borrows the input port named name from the filter component component.
static bt_bool bt_component_is_filter(const bt_component *component)
Returns whether or not the component component is a filter component.
Definition: component.h:285
static const bt_component * bt_component_filter_as_component_const(const bt_component_filter *component)
Upcasts the filter component component to the common bt_component type.
Definition: component.h:760
struct bt_component_class bt_component_class
Component class.
Definition: types.h:25
const bt_port_input * bt_component_sink_borrow_input_port_by_name_const(const bt_component_sink *component, const char *name)
Borrows the output port named name from the sink component component.
uint64_t bt_component_source_get_output_port_count(const bt_component_source *component)
Returns the number of output ports that the source component component has.
struct bt_component_filter bt_component_filter
Filter component.
Definition: types.h:30
bt_component_class_type
Component class type enumerators.
Definition: component-class.h:202
static bt_bool bt_component_is_sink(const bt_component *component)
Returns whether or not the component component is a sink component.
Definition: component.h:308
const bt_port_output * bt_component_source_borrow_output_port_by_name_const(const bt_component_source *component, const char *name)
Borrows the output port named name from the source component component.
bt_logging_level bt_component_get_logging_level(const bt_component *component)
Returns the logging level of the component component and its message iterators, if any...
uint64_t bt_component_sink_get_input_port_count(const bt_component_sink *component)
Returns the number of input ports that the sink component component has.
static const bt_component * bt_component_sink_as_component_const(const bt_component_sink *component)
Upcasts the sink component component to the common bt_component type.
Definition: component.h:1077
const bt_port_output * bt_component_filter_borrow_output_port_by_index_const(const bt_component_filter *component, uint64_t index)
Borrows the output port at index index from the filter component component.
const bt_component_class_sink * bt_component_sink_borrow_class_const(const bt_component_sink *component)
Borrows the class of the sink component component.
const bt_component_class * bt_component_borrow_class_const(const bt_component *component)
Borrows the class of the component component.
struct bt_component bt_component
Component.
Definition: types.h:24
bt_logging_level
Logging level enumerators.
Definition: logging.h:97
struct bt_component_class_sink bt_component_class_sink
Sink component class.
Definition: types.h:27
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:126
Filter component class.
Definition: component-class.h:213
void bt_component_filter_put_ref(const bt_component_filter *component)
Decrements the reference count of the filter component component.
bt_component_class_type bt_component_get_class_type(const bt_component *component)
Returns the type enumerator of the class of the component component.
const bt_component_class_source * bt_component_source_borrow_class_const(const bt_component_source *component)
Borrows the class of the source component component.
Source component class.
Definition: component-class.h:207
void bt_component_source_put_ref(const bt_component_source *component)
Decrements the reference count of the source component component.
void bt_component_sink_get_ref(const bt_component_sink *component)
Increments the reference count of the sink component component.
const bt_port_input * bt_component_filter_borrow_input_port_by_index_const(const bt_component_filter *component, uint64_t index)
Borrows the input port at index index from the filter component component.
const bt_port_input * bt_component_sink_borrow_input_port_by_index_const(const bt_component_sink *component, uint64_t index)
Borrows the input port at index index from the sink component component.
const bt_component_class_filter * bt_component_filter_borrow_class_const(const bt_component_filter *component)
Borrows the class of the filter component component.
static bt_bool bt_component_is_source(const bt_component *component)
Returns whether or not the component component is a source component.
Definition: component.h:262
const bt_port_output * bt_component_source_borrow_output_port_by_index_const(const bt_component_source *component, uint64_t index)
Borrows the output port at index index from the source component component.
void bt_component_get_ref(const bt_component *component)
Increments the reference count of the component component.
void bt_component_sink_put_ref(const bt_component_sink *component)
Decrements the reference count of the sink component component.
Sink component class.
Definition: component-class.h:219
const bt_port_output * bt_component_filter_borrow_output_port_by_name_const(const bt_component_filter *component, const char *name)
Borrows the output port named name from the filter component component.
void bt_component_put_ref(const bt_component *component)
Decrements the reference count of the component component.
void bt_component_source_get_ref(const bt_component_source *component)
Increments the reference count of the source component component.