projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: make can_seek_beginning and can_seek_ns_from_origin methods return a status
[babeltrace.git]
/
src
/
bindings
/
python
/
bt2
/
bt2
/
message_iterator.py
diff --git
a/src/bindings/python/bt2/bt2/message_iterator.py
b/src/bindings/python/bt2/bt2/message_iterator.py
index 51410189835ea5715e1b556a6b3efcbcf0b478b6..c392d420491918ac1c35fd910d9fc3783d732144 100644
(file)
--- a/
src/bindings/python/bt2/bt2/message_iterator.py
+++ b/
src/bindings/python/bt2/bt2/message_iterator.py
@@
-58,7
+58,11
@@
class _GenericMessageIterator(object._SharedObject, _MessageIterator):
@property
def can_seek_beginning(self):
@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):
return res != 0
def seek_beginning(self):
@@
-123,6
+127,14
@@
class _UserMessageIterator(_MessageIterator):
def _component(self):
return native_bt.bt2_get_user_component_from_user_msg_iter(self._bt_ptr)
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)
@property
def addr(self):
return int(self._bt_ptr)
@@
-146,7
+158,7
@@
class _UserMessageIterator(_MessageIterator):
except Exception:
raise
except Exception:
raise
- utils._check_type(msg, bt2_message._Message)
+ utils._check_type(msg, bt2_message._Message
Const
)
# The reference we return will be given to the message array.
# However, the `msg` Python object may stay alive, if the user has kept
# The reference we return will be given to the message array.
# However, the `msg` Python object may stay alive, if the user has kept
@@
-160,7
+172,7
@@
class _UserMessageIterator(_MessageIterator):
#
# - If the iterator has a _user_can_seek_beginning attribute,
# read it and use that result.
#
# - If the iterator has a _user_can_seek_beginning attribute,
# read it and use that result.
- # - Otherwise, the presence or absence of a `_seek_beginning`
+ # - 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
# method indicates whether the iterator can seek beginning.
if hasattr(self, '_user_can_seek_beginning'):
can_seek_beginning = self._user_can_seek_beginning
This page took
0.023595 seconds
and
4
git commands to generate.