return bt2_message._create_from_ptr(msg_ptr)
- @property
def can_seek_beginning(self):
- res = self._can_seek_beginning(self._ptr)
+ status, res = self._can_seek_beginning(self._ptr)
+ utils._handle_func_status(
+ status,
+ 'cannot check whether or not message iterator can seek its beginning',
+ )
return res != 0
def seek_beginning(self):
def _component(self):
return native_bt.bt2_get_user_component_from_user_msg_iter(self._bt_ptr)
+ @property
+ def _port(self):
+ port_ptr = native_bt.self_message_iterator_borrow_port(self._bt_ptr)
+ assert port_ptr is not None
+ return bt2_port._create_self_from_ptr_and_get_ref(
+ port_ptr, native_bt.PORT_TYPE_OUTPUT
+ )
+
@property
def addr(self):
return int(self._bt_ptr)
msg._get_ref(msg._ptr)
return int(msg._ptr)
- @property
def _bt_can_seek_beginning_from_native(self):
# Here, we mimic the behavior of the C API:
#
- # - If the iterator has a _user_can_seek_beginning attribute,
+ # - If the iterator has a _user_can_seek_beginning method,
# read it and use that result.
# - Otherwise, the presence or absence of a `_user_seek_beginning`
# method indicates whether the iterator can seek beginning.
if hasattr(self, '_user_can_seek_beginning'):
- can_seek_beginning = self._user_can_seek_beginning
+ can_seek_beginning = self._user_can_seek_beginning()
utils._check_bool(can_seek_beginning)
return can_seek_beginning
else: