cpp-common/bt2c/fmt.hpp: use `wise_enum::string_type` in `EnableIfIsWiseEnum` definition
[babeltrace.git] / src / bindings / python / bt2 / bt2 / connection.py
1 # SPDX-License-Identifier: MIT
2 #
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
4
5 from bt2 import port as bt2_port
6 from bt2 import object as bt2_object
7 from bt2 import native_bt
8
9
10 class _ConnectionConst(bt2_object._SharedObject):
11 @staticmethod
12 def _get_ref(ptr):
13 native_bt.connection_get_ref(ptr)
14
15 @staticmethod
16 def _put_ref(ptr):
17 native_bt.connection_put_ref(ptr)
18
19 @property
20 def downstream_port(self):
21 port_ptr = native_bt.connection_borrow_downstream_port_const(self._ptr)
22 return bt2_port._create_from_const_ptr_and_get_ref(
23 port_ptr, native_bt.PORT_TYPE_INPUT
24 )
25
26 @property
27 def upstream_port(self):
28 port_ptr = native_bt.connection_borrow_upstream_port_const(self._ptr)
29 return bt2_port._create_from_const_ptr_and_get_ref(
30 port_ptr, native_bt.PORT_TYPE_OUTPUT
31 )
This page took 0.03127 seconds and 5 git commands to generate.