bt2: update object model
[babeltrace.git] / bindings / python / bt2 / bt2 / connection.py
index 289667f5ba07d05ba3e315ca102fec93929baf63..a15c67927bc75e136ba76e1d64071b6577a5a719 100644 (file)
@@ -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)
This page took 0.024797 seconds and 4 git commands to generate.