Babeltrace 2 C API  2.0.0
Open-source trace manipulation framework

Detailed Description

Private views of ports for component class instance methods.

The bt_self_component_port, bt_self_component_port_input, and bt_self_component_port_output types are private views of a port from within a component class instance method.

Borrow the self component of a port with bt_self_component_port_borrow_component().

Get the user data attached to a port with bt_self_component_port_get_data().

Upcast the "self" (private) types to the public and common self component port types with the bt_self_component_port*_as_port*() and bt_self_component_port_*_as_self_component_port() functions.

Types

typedef struct bt_self_component_port bt_self_component_port
 Self component component.
 
typedef struct bt_self_component_port_input bt_self_component_port_input
 Self component input port.
 
typedef struct bt_self_component_port_output bt_self_component_port_output
 Self component output port.
 

Component access

bt_self_componentbt_self_component_port_borrow_component (bt_self_component_port *self_component_port)
 Borrows the component of the port self_component_port. More...
 

User data access

void * bt_self_component_port_get_data (const bt_self_component_port *self_component_port)
 Returns the user data of the port self_component_port. More...
 

Self to public upcast

static const bt_portbt_self_component_port_as_port (bt_self_component_port *self_component_port)
 Upcasts the self component port self_component_port to the public bt_port type. More...
 
static const bt_port_inputbt_self_component_port_input_as_port_input (const bt_self_component_port_input *self_component_port)
 Upcasts the self component input port self_component_port to the public bt_port_input type. More...
 
static const bt_port_outputbt_self_component_port_output_as_port_output (bt_self_component_port_output *self_component_port)
 Upcasts the self component output port self_component_port to the public bt_port_output type. More...
 

Self to common self upcast

static bt_self_component_portbt_self_component_port_input_as_self_component_port (bt_self_component_port_input *self_component_port)
 Upcasts the self input port self_component_port to the common bt_self_component_port type. More...
 
static bt_self_component_portbt_self_component_port_output_as_self_component_port (bt_self_component_port_output *self_component_port)
 Upcasts the self output port self_component_port to the common bt_self_component_port type. More...
 

Function Documentation

◆ bt_self_component_port_borrow_component()

bt_self_component* bt_self_component_port_borrow_component ( bt_self_component_port self_component_port)

Borrows the component of the port self_component_port.

Parameters
[in]self_component_portPort from which to borrow the component which owns it.
Returns
Component which owns self_component_port.
Precondition
self_component_port is not NULL.

◆ bt_self_component_port_get_data()

void* bt_self_component_port_get_data ( const bt_self_component_port self_component_port)

Returns the user data of the port self_component_port.

You can attach user data to a port when you add it to a component with bt_self_component_source_add_output_port(), bt_self_component_filter_add_input_port(), bt_self_component_filter_add_output_port(), and bt_self_component_sink_add_input_port().

Parameters
[in]self_component_portPort of which to get the user data.
Returns
User data of self_component_port.
Precondition
self_component_port is not NULL.

◆ bt_self_component_port_as_port()

static const bt_port* bt_self_component_port_as_port ( bt_self_component_port self_component_port)
inlinestatic

Upcasts the self component port self_component_port to the public bt_port type.

Parameters
[in]self_component_port

Port to upcast.

Can be NULL.

Returns
self_component_port as a public port.

◆ bt_self_component_port_input_as_port_input()

static const bt_port_input* bt_self_component_port_input_as_port_input ( const bt_self_component_port_input self_component_port)
inlinestatic

Upcasts the self component input port self_component_port to the public bt_port_input type.

Parameters
[in]self_component_port

Input port to upcast.

Can be NULL.

Returns
self_component_port as a public input port.

◆ bt_self_component_port_output_as_port_output()

static const bt_port_output* bt_self_component_port_output_as_port_output ( bt_self_component_port_output self_component_port)
inlinestatic

Upcasts the self component output port self_component_port to the public bt_port_output type.

Parameters
[in]self_component_port

Output port to upcast.

Can be NULL.

Returns
self_component_port as a public output port.

◆ bt_self_component_port_input_as_self_component_port()

static bt_self_component_port* bt_self_component_port_input_as_self_component_port ( bt_self_component_port_input self_component_port)
inlinestatic

Upcasts the self input port self_component_port to the common bt_self_component_port type.

Parameters
[in]self_component_port

Input port to upcast.

Can be NULL.

Returns
self_component_port as a common self component port.

◆ bt_self_component_port_output_as_self_component_port()

static bt_self_component_port* bt_self_component_port_output_as_self_component_port ( bt_self_component_port_output self_component_port)
inlinestatic

Upcasts the self output port self_component_port to the common bt_self_component_port type.

Parameters
[in]self_component_port

Output port to upcast.

Can be NULL.

Returns
self_component_port as a common self component port.