bt2c::Logger: remove unused cLevel() method
[babeltrace.git] / src / lib / graph / connection.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright 2017-2018 Philippe Proulx <pproulx@efficios.com>
5 * Copyright 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com>
6 */
7
8 #ifndef BABELTRACE_GRAPH_CONNECTION_INTERNAL_H
9 #define BABELTRACE_GRAPH_CONNECTION_INTERNAL_H
10
11 #include <babeltrace2/graph/connection.h>
12 #include "lib/object.h"
13 #include "common/assert.h"
14 #include <stdbool.h>
15
16 #include "iterator.h"
17
18 struct bt_graph;
19
20 struct bt_connection {
21 /*
22 * The graph is a connection's parent and the connection is the parent
23 * of all iterators it has created.
24 */
25 struct bt_object base;
26 /*
27 * Weak references are held to both ports. Their existence is guaranteed
28 * by the existence of the graph and thus, of their respective
29 * components.
30 */
31 /* Downstream port. */
32 struct bt_port *downstream_port;
33 /* Upstream port. */
34 struct bt_port *upstream_port;
35
36 /*
37 * Weak references to all the message iterators that were
38 * created on this connection.
39 */
40 GPtrArray *iterators;
41
42 bool notified_upstream_port_connected;
43 bool notified_downstream_port_connected;
44 bool notified_graph_ports_connected;
45 };
46
47 struct bt_connection *bt_connection_create(struct bt_graph *graph,
48 struct bt_port *upstream_port,
49 struct bt_port *downstream_port);
50
51 void bt_connection_end(struct bt_connection *conn, bool try_remove_from_graph);
52
53 void bt_connection_remove_iterator(struct bt_connection *conn,
54 struct bt_message_iterator *iterator);
55
56 static inline
57 struct bt_graph *bt_connection_borrow_graph(struct bt_connection *conn)
58 {
59 BT_ASSERT_DBG(conn);
60 return (void *) conn->base.parent;
61 }
62
63 #endif /* BABELTRACE_GRAPH_CONNECTION_INTERNAL_H */
This page took 0.030542 seconds and 5 git commands to generate.