X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Fstream_class.py;h=2c33dae8ddfa8d8a11ded5eedaadce48bd646139;hb=5783664e46332216fd38a7b287258a7c9543af57;hp=c543523c49700a10beaa5d29a3de6ad0493c3f49;hpb=57081273d1191fc79edc101af619fab96b72460d;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/stream_class.py b/src/bindings/python/bt2/bt2/stream_class.py index c543523c..2c33dae8 100644 --- a/src/bindings/python/bt2/bt2/stream_class.py +++ b/src/bindings/python/bt2/bt2/stream_class.py @@ -25,6 +25,7 @@ from bt2 import field_class as bt2_field_class from bt2 import event_class as bt2_event_class from bt2 import trace_class as bt2_trace_class from bt2 import clock_class as bt2_clock_class +from bt2 import value as bt2_value import collections.abc @@ -62,6 +63,7 @@ class _StreamClass(object._SharedObject, collections.abc.Mapping): self, id=None, name=None, + user_attributes=None, log_level=None, emf_uri=None, specific_context_field_class=None, @@ -88,6 +90,9 @@ class _StreamClass(object._SharedObject, collections.abc.Mapping): if name is not None: event_class._name = name + if user_attributes is not None: + event_class._user_attributes = user_attributes + if log_level is not None: event_class._log_level = log_level @@ -109,6 +114,19 @@ class _StreamClass(object._SharedObject, collections.abc.Mapping): if tc_ptr is not None: return bt2_trace_class._TraceClass._create_from_ptr_and_get_ref(tc_ptr) + @property + def user_attributes(self): + ptr = native_bt.stream_class_borrow_user_attributes(self._ptr) + assert ptr is not None + return bt2_value._create_from_ptr_and_get_ref(ptr) + + def _user_attributes(self, user_attributes): + value = bt2_value.create_value(user_attributes) + utils._check_type(value, bt2_value.MapValue) + native_bt.stream_class_set_user_attributes(self._ptr, value._ptr) + + _user_attributes = property(fset=_user_attributes) + @property def name(self): return native_bt.stream_class_get_name(self._ptr) @@ -235,12 +253,6 @@ class _StreamClass(object._SharedObject, collections.abc.Mapping): return id - @id.setter - def id(self, id): - utils._check_int64(id) - status = native_bt.stream_class_set_id(self._ptr, id) - utils._handle_func_status(status, "cannot set stream class object's ID") - @property def packet_context_field_class(self): fc_ptr = native_bt.stream_class_borrow_packet_context_field_class_const(