Babeltrace 2 C API  2.0.0
Open-source trace manipulation framework
Connection

Detailed Description

Component port connection.

A connection is a link between an output port and an input port.

A connection is a shared object: get a new reference with bt_connection_get_ref() and put an existing reference with bt_connection_put_ref().

The type of a connection is bt_connection.

Borrow the upstream (output) port and downstream (input) port of a connection with bt_connection_borrow_upstream_port_const() and bt_connection_borrow_downstream_port_const().

Type

typedef struct bt_connection bt_connection
 Connection.
 

Port access

const bt_port_inputbt_connection_borrow_downstream_port_const (const bt_connection *connection)
 Borrows the upstream input port of the connection connection. More...
 
const bt_port_outputbt_connection_borrow_upstream_port_const (const bt_connection *connection)
 Borrows the downstream output port of the connection connection. More...
 

Reference count

void bt_connection_get_ref (const bt_connection *connection)
 Increments the reference count of the connection connection. More...
 
void bt_connection_put_ref (const bt_connection *connection)
 Decrements the reference count of the connection connection. More...
 
#define BT_CONNECTION_PUT_REF_AND_RESET(_connection)
 Decrements the reference count of the connection _connection, and then sets _connection to NULL. More...
 
#define BT_CONNECTION_MOVE_REF(_dst, _src)
 Decrements the reference count of the connection _dst, sets _dst to _src, and then sets _src to NULL. More...
 

Macro Definition Documentation

◆ BT_CONNECTION_PUT_REF_AND_RESET

#define BT_CONNECTION_PUT_REF_AND_RESET (   _connection)

Decrements the reference count of the connection _connection, and then sets _connection to NULL.

Parameters
_connection

Connection of which to decrement the reference count.

Can contain NULL.

Precondition
_connection is an assignable expression.

◆ BT_CONNECTION_MOVE_REF

#define BT_CONNECTION_MOVE_REF (   _dst,
  _src 
)

Decrements the reference count of the connection _dst, sets _dst to _src, and then sets _src to NULL.

This macro effectively moves a connection reference from the expression _src to the expression _dst, putting the existing _dst reference.

Parameters
_dst

Destination expression.

Can contain NULL.

_src

Source expression.

Can contain NULL.

Precondition
_dst is an assignable expression.
_src is an assignable expression.

Function Documentation

◆ bt_connection_borrow_downstream_port_const()

const bt_port_input* bt_connection_borrow_downstream_port_const ( const bt_connection connection)

Borrows the upstream input port of the connection connection.

Parameters
[in]connectionConnection of which to borrow the upstream port.
Returns
Borrowed reference of the upstream port of connection.
Precondition
connection is not NULL.

◆ bt_connection_borrow_upstream_port_const()

const bt_port_output* bt_connection_borrow_upstream_port_const ( const bt_connection connection)

Borrows the downstream output port of the connection connection.

Parameters
[in]connectionConnection of which to borrow the downstream port.
Returns
Borrowed reference of the downstream port of connection.
Precondition
connection is not NULL.

◆ bt_connection_get_ref()

void bt_connection_get_ref ( const bt_connection connection)

Increments the reference count of the connection connection.

Parameters
[in]connection

Connection of which to increment the reference count.

Can be NULL.

See also
bt_connection_put_ref() — Decrements the reference count of a connection.

◆ bt_connection_put_ref()

void bt_connection_put_ref ( const bt_connection connection)

Decrements the reference count of the connection connection.

Parameters
[in]connection

Connection of which to decrement the reference count.

Can be NULL.

See also
bt_connection_get_ref() — Increments the reference count of a connection.