bt2c::Logger: remove unused cLevel() method
[babeltrace.git] / src / lib / graph / port.h
CommitLineData
8b285017 1/*
0235b0db
MJ
2 * SPDX-License-Identifier: MIT
3 *
e2f7325d 4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
8b285017 5 * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
8b285017
JG
6 */
7
0235b0db
MJ
8#ifndef BABELTRACE_GRAPH_PORT_INTERNAL_H
9#define BABELTRACE_GRAPH_PORT_INTERNAL_H
10
43c59509 11#include <babeltrace2/graph/port.h>
8b285017 12
8b285017
JG
13struct bt_port {
14 struct bt_object base;
15 enum bt_port_type type;
16 GString *name;
72b913fb 17 struct bt_connection *connection;
a45a0b60 18 void *user_data;
8b285017
JG
19};
20
0d72b8c3
PP
21struct bt_component;
22
8b285017 23struct bt_port *bt_port_create(struct bt_component *parent_component,
3e9b0023 24 enum bt_port_type type, const char *name, void *user_data);
8b285017 25
72b913fb 26void bt_port_set_connection(struct bt_port *port,
8b285017
JG
27 struct bt_connection *connection);
28
0d72b8c3
PP
29static inline
30struct bt_component *bt_port_borrow_component_inline(const struct bt_port *port)
31{
98b15851 32 BT_ASSERT_DBG(port);
0d72b8c3
PP
33 return (void *) bt_object_borrow_parent(&port->base);
34}
35
ab0d387b
PP
36static inline
37const char *bt_port_type_string(enum bt_port_type port_type)
38{
39 switch (port_type) {
40 case BT_PORT_TYPE_INPUT:
8a432889 41 return "INPUT";
ab0d387b 42 case BT_PORT_TYPE_OUTPUT:
8a432889 43 return "OUTPUT";
ab0d387b
PP
44 default:
45 return "(unknown)";
46 }
8b285017 47}
8b285017 48
6ac74c0c 49#endif /* BABELTRACE_GRAPH_PORT_INTERNAL_H */
This page took 0.094547 seconds and 5 git commands to generate.