projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Python bt2: add reset and is_set to fields
[babeltrace.git]
/
bindings
/
python
/
bt2
/
bt2
/
fields.py
diff --git
a/bindings/python/bt2/bt2/fields.py
b/bindings/python/bt2/bt2/fields.py
index 13c6a68335393c200f6f473b4189ef326f486b35..e40a86c67bb3969f7a13d20a28cd6dbc19c8d3dd 100644
(file)
--- a/
bindings/python/bt2/bt2/fields.py
+++ b/
bindings/python/bt2/bt2/fields.py
@@
-58,6
+58,15
@@
class _Field(object._Object, metaclass=abc.ABCMeta):
def field_type(self):
return self._field_type
def field_type(self):
return self._field_type
+ @property
+ def is_set(self):
+ is_set = native_bt.ctf_field_value_is_set(self._ptr)
+ return is_set > 0
+
+ def reset(self):
+ ret = native_bt.ctf_field_reset_value(self._ptr)
+ utils._handle_ret(ret, "cannot reset field object's value")
+
@functools.total_ordering
class _NumericField(_Field):
@functools.total_ordering
class _NumericField(_Field):
This page took
0.026171 seconds
and
4
git commands to generate.