X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=bindings%2Fpython%2Fbt2%2Fbt2%2Fconnection.py;h=a15c67927bc75e136ba76e1d64071b6577a5a719;hb=78288f581343ec033cc38898777fe43a02380719;hp=289667f5ba07d05ba3e315ca102fec93929baf63;hpb=dc43190b29953dd4aa2bbcdc86b34fb47d76a62c;p=babeltrace.git diff --git a/bindings/python/bt2/bt2/connection.py b/bindings/python/bt2/bt2/connection.py index 289667f5..a15c6792 100644 --- a/bindings/python/bt2/bt2/connection.py +++ b/bindings/python/bt2/bt2/connection.py @@ -21,7 +21,7 @@ # THE SOFTWARE. from bt2 import native_bt, object, utils -import bt2.notification_iterator +import bt2.message_iterator import collections.abc import bt2.port import copy @@ -39,12 +39,12 @@ def _handle_status(status, gen_error_msg): def _create_private_from_ptr(ptr): obj = _PrivateConnection._create_from_ptr(ptr) - obj._pub_ptr = native_bt.connection_from_private_connection(ptr) + obj._pub_ptr = native_bt.connection_from_private(ptr) assert(obj._pub_ptr) return obj -class _Connection(object._Object): +class _Connection(object._SharedObject): @staticmethod def _downstream_port(ptr): port_ptr = native_bt.connection_get_downstream_port(ptr) @@ -78,25 +78,3 @@ class _Connection(object._Object): return False return self.addr == other.addr - - -class _PrivateConnection(object._PrivateObject, _Connection): - def create_notification_iterator(self, notification_types=None): - notif_types = bt2.notification._notif_types_from_notif_classes(notification_types) - status, notif_iter_ptr = native_bt.py3_create_priv_conn_notif_iter(int(self._ptr), - notif_types) - _handle_status(status, 'cannot create notification iterator object') - assert(notif_iter_ptr) - return bt2.notification_iterator._PrivateConnectionNotificationIterator._create_from_ptr(notif_iter_ptr) - - @property - def is_ended(self): - return self._is_ended(self._pub_ptr) - - @property - def downstream_port(self): - return self._downstream_port(self._pub_ptr) - - @property - def upstream_port(self): - return self._upstream_port(self._pub_ptr)