def _set_user_attributes_ptr(obj_ptr, value_ptr):
native_bt.clock_class_set_user_attributes(obj_ptr, value_ptr)
- def _name(self, name):
+ def _set_name(self, name):
bt2_utils._check_str(name)
status = native_bt.clock_class_set_name(self._ptr, name)
bt2_utils._handle_func_status(status, "cannot set clock class object's name")
- _name = property(fset=_name)
-
- def _description(self, description):
+ def _set_description(self, description):
bt2_utils._check_str(description)
status = native_bt.clock_class_set_description(self._ptr, description)
bt2_utils._handle_func_status(
status, "cannot set clock class object's description"
)
- _description = property(fset=_description)
-
- def _frequency(self, frequency):
+ def _set_frequency(self, frequency):
bt2_utils._check_uint64(frequency)
native_bt.clock_class_set_frequency(self._ptr, frequency)
- _frequency = property(fset=_frequency)
-
- def _precision(self, precision):
+ def _set_precision(self, precision):
bt2_utils._check_uint64(precision)
native_bt.clock_class_set_precision(self._ptr, precision)
- _precision = property(fset=_precision)
-
- def _offset(self, offset):
+ def _set_offset(self, offset):
bt2_utils._check_type(offset, ClockClassOffset)
native_bt.clock_class_set_offset(self._ptr, offset.seconds, offset.cycles)
- _offset = property(fset=_offset)
-
- def _origin_is_unix_epoch(self, origin_is_unix_epoch):
+ def _set_origin_is_unix_epoch(self, origin_is_unix_epoch):
bt2_utils._check_bool(origin_is_unix_epoch)
native_bt.clock_class_set_origin_is_unix_epoch(
self._ptr, int(origin_is_unix_epoch)
)
- _origin_is_unix_epoch = property(fset=_origin_is_unix_epoch)
-
- def _uuid(self, uuid):
+ def _set_uuid(self, uuid):
bt2_utils._check_type(uuid, uuidp.UUID)
native_bt.clock_class_set_uuid(self._ptr, uuid.bytes)
-
- _uuid = property(fset=_uuid)
raise bt2_error._MemoryError("could not create trace class")
tc = bt2_trace_class._TraceClass._create_from_ptr(tc_ptr)
- tc._assigns_automatic_stream_class_id = assigns_automatic_stream_class_id
+ tc._set_assigns_automatic_stream_class_id(assigns_automatic_stream_class_id)
if user_attributes is not None:
- tc._user_attributes = user_attributes
+ tc._set_user_attributes(user_attributes)
return tc
cc = bt2_clock_class._ClockClass._create_from_ptr(cc_ptr)
if frequency is not None:
- cc._frequency = frequency
+ cc._set_frequency(frequency)
if name is not None:
- cc._name = name
+ cc._set_name(name)
if user_attributes is not None:
- cc._user_attributes = user_attributes
+ cc._set_user_attributes(user_attributes)
if description is not None:
- cc._description = description
+ cc._set_description(description)
if precision is not None:
- cc._precision = precision
+ cc._set_precision(precision)
if offset is not None:
- cc._offset = offset
+ cc._set_offset(offset)
- cc._origin_is_unix_epoch = origin_is_unix_epoch
+ cc._set_origin_is_unix_epoch(origin_is_unix_epoch)
if uuid is not None:
- cc._uuid = uuid
+ cc._set_uuid(uuid)
return cc
def _set_user_attributes_ptr(obj_ptr, value_ptr):
native_bt.event_class_set_user_attributes(obj_ptr, value_ptr)
- def _name(self, name):
+ def _set_name(self, name):
return native_bt.event_class_set_name(self._ptr, name)
- _name = property(fset=_name)
-
- def _log_level(self, log_level):
+ def _set_log_level(self, log_level):
native_bt.event_class_set_log_level(self._ptr, log_level)
- _log_level = property(fset=_log_level)
-
- def _emf_uri(self, emf_uri):
+ def _set_emf_uri(self, emf_uri):
status = native_bt.event_class_set_emf_uri(self._ptr, emf_uri)
bt2_utils._handle_func_status(status, "cannot set event class object's EMF URI")
- _emf_uri = property(fset=_emf_uri)
-
- def _specific_context_field_class(self, context_field_class):
+ def _set_specific_context_field_class(self, context_field_class):
status = native_bt.event_class_set_specific_context_field_class(
self._ptr, context_field_class._ptr
)
status, "cannot set event class object's context field class"
)
- _specific_context_field_class = property(fset=_specific_context_field_class)
-
- def _payload_field_class(self, payload_field_class):
+ def _set_payload_field_class(self, payload_field_class):
status = native_bt.event_class_set_payload_field_class(
self._ptr, payload_field_class._ptr
)
status, "cannot set event class object's payload field class"
)
- _payload_field_class = property(fset=_payload_field_class)
-
@staticmethod
def _validate_create_params(
name,
class _IntegerFieldClass(_FieldClass, _IntegerFieldClassConst):
- def _field_value_range(self, size):
+ def _set_field_value_range(self, size):
if size < 1 or size > 64:
raise ValueError("Value is outside valid range [1, 64] ({})".format(size))
native_bt.field_class_integer_set_field_value_range(self._ptr, size)
- _field_value_range = property(fset=_field_value_range)
-
- def _preferred_display_base(self, base):
+ def _set_preferred_display_base(self, base):
bt2_utils._check_uint64(base)
if base not in (
native_bt.field_class_integer_set_preferred_display_base(self._ptr, base)
- _preferred_display_base = property(fset=_preferred_display_base)
-
class _UnsignedIntegerFieldClassConst(_IntegerFieldClassConst, _FieldClassConst):
_NAME = "Const unsigned integer"
)
if user_attributes is not None:
- self[name]._user_attributes = user_attributes_value
+ self[name]._set_user_attributes(user_attributes_value)
def __iadd__(self, members):
for name, field_class in members:
):
_NAME = "Option (with boolean selector)"
- def _selector_is_reversed(self, selector_is_reversed):
+ def _set_selector_is_reversed(self, selector_is_reversed):
bt2_utils._check_bool(selector_is_reversed)
native_bt.field_class_option_with_selector_field_bool_set_selector_is_reversed(
self._ptr, selector_is_reversed
)
- _selector_is_reversed = property(fset=_selector_is_reversed)
-
class _OptionWithIntegerSelectorFieldClass(
_OptionWithIntegerSelectorFieldClassConst, _OptionWithSelectorFieldClass
)
if user_attributes is not None:
- self[name]._user_attributes = user_attributes_value
+ self[name]._set_user_attributes(user_attributes_value)
def __iadd__(self, options):
for name, field_class in options:
)
if user_attributes is not None:
- self[name]._user_attributes = user_attributes_value
+ self[name]._set_user_attributes(user_attributes_value)
def __iadd__(self, options):
for name, field_class, ranges in options:
def _set_user_attributes_ptr(obj_ptr, value_ptr):
native_bt.stream_set_user_attributes(obj_ptr, value_ptr)
- def _name(self, name):
+ def _set_name(self, name):
bt2_utils._check_str(name)
native_bt.stream_set_name(self._ptr, name)
-
- _name = property(fget=_StreamConst.name.fget, fset=_name)
event_class = bt2_event_class._EventClass._create_from_ptr(ec_ptr)
if name is not None:
- event_class._name = name
+ event_class._set_name(name)
if user_attributes is not None:
- event_class._user_attributes = user_attributes
+ event_class._set_user_attributes(user_attributes)
if log_level is not None:
- event_class._log_level = log_level
+ event_class._set_log_level(log_level)
if emf_uri is not None:
- event_class._emf_uri = emf_uri
+ event_class._set_emf_uri(emf_uri)
if specific_context_field_class is not None:
- event_class._specific_context_field_class = specific_context_field_class
+ event_class._set_specific_context_field_class(specific_context_field_class)
if payload_field_class is not None:
- event_class._payload_field_class = payload_field_class
+ event_class._set_payload_field_class(payload_field_class)
return event_class
def _set_user_attributes_ptr(obj_ptr, value_ptr):
native_bt.stream_class_set_user_attributes(obj_ptr, value_ptr)
- def _name(self, name):
+ def _set_name(self, name):
status = native_bt.stream_class_set_name(self._ptr, name)
bt2_utils._handle_func_status(status, "cannot set stream class object's name")
- _name = property(fset=_name)
-
- def _assigns_automatic_event_class_id(self, auto_id):
+ def _set_assigns_automatic_event_class_id(self, auto_id):
native_bt.stream_class_set_assigns_automatic_event_class_id(self._ptr, auto_id)
- _assigns_automatic_event_class_id = property(fset=_assigns_automatic_event_class_id)
-
- def _assigns_automatic_stream_id(self, auto_id):
+ def _set_assigns_automatic_stream_id(self, auto_id):
native_bt.stream_class_set_assigns_automatic_stream_id(self._ptr, auto_id)
- _assigns_automatic_stream_id = property(fset=_assigns_automatic_stream_id)
-
def _set_supports_packets(self, supports, with_begin_cs=False, with_end_cs=False):
native_bt.stream_class_set_supports_packets(
self._ptr, supports, with_begin_cs, with_end_cs
self._ptr, supports, with_cs
)
- _supports_discarded_events = property(fset=_set_supports_discarded_events)
-
def _set_supports_discarded_packets(self, supports, with_cs):
native_bt.stream_class_set_supports_discarded_packets(
self._ptr, supports, with_cs
)
- _supports_discarded_packets = property(fset=_set_supports_discarded_packets)
-
- def _packet_context_field_class(self, packet_context_field_class):
+ def _set_packet_context_field_class(self, packet_context_field_class):
status = native_bt.stream_class_set_packet_context_field_class(
self._ptr, packet_context_field_class._ptr
)
status, "cannot set stream class' packet context field class"
)
- _packet_context_field_class = property(fset=_packet_context_field_class)
-
- def _event_common_context_field_class(self, event_common_context_field_class):
+ def _set_event_common_context_field_class(self, event_common_context_field_class):
set_context_fn = native_bt.stream_class_set_event_common_context_field_class
status = set_context_fn(self._ptr, event_common_context_field_class._ptr)
bt2_utils._handle_func_status(
status, "cannot set stream class' event context field type"
)
- _event_common_context_field_class = property(fset=_event_common_context_field_class)
-
- def _default_clock_class(self, clock_class):
+ def _set_default_clock_class(self, clock_class):
native_bt.stream_class_set_default_clock_class(self._ptr, clock_class._ptr)
- _default_clock_class = property(fset=_default_clock_class)
-
@classmethod
def _validate_create_params(
cls,
_trace_class_pycls = property(lambda _: _bt2_trace_class()._TraceClass)
_trace_env_pycls = property(lambda _: _TraceEnvironment)
- def _name(self, name):
+ def _set_name(self, name):
bt2_utils._check_str(name)
status = native_bt.trace_set_name(self._ptr, name)
bt2_utils._handle_func_status(status, "cannot set trace object's name")
- _name = property(fset=_name)
-
@staticmethod
def _set_user_attributes_ptr(obj_ptr, value_ptr):
native_bt.trace_set_user_attributes(obj_ptr, value_ptr)
- def _uuid(self, uuid):
+ def _set_uuid(self, uuid):
bt2_utils._check_type(uuid, uuidp.UUID)
native_bt.trace_set_uuid(self._ptr, uuid.bytes)
- _uuid = property(fset=_uuid)
-
def create_stream(self, stream_class, id=None, name=None, user_attributes=None):
bt2_utils._check_type(stream_class, bt2_stream_class._StreamClass)
stream = bt2_stream._Stream._create_from_ptr(stream_ptr)
if name is not None:
- stream._name = name
+ stream._set_name(name)
if user_attributes is not None:
- stream._user_attributes = user_attributes
+ stream._set_user_attributes(user_attributes)
return stream
trace = bt2_trace._Trace._create_from_ptr(trace_ptr)
if name is not None:
- trace._name = name
+ trace._set_name(name)
if user_attributes is not None:
- trace._user_attributes = user_attributes
+ trace._set_user_attributes(user_attributes)
if uuid is not None:
- trace._uuid = uuid
+ trace._set_uuid(uuid)
if environment is not None:
for key, value in environment.items():
sc = bt2_stream_class._StreamClass._create_from_ptr(sc_ptr)
if name is not None:
- sc._name = name
+ sc._set_name(name)
if user_attributes is not None:
- sc._user_attributes = user_attributes
+ sc._set_user_attributes(user_attributes)
if event_common_context_field_class is not None:
- sc._event_common_context_field_class = event_common_context_field_class
+ sc._set_event_common_context_field_class(event_common_context_field_class)
if default_clock_class is not None:
- sc._default_clock_class = default_clock_class
+ sc._set_default_clock_class(default_clock_class)
# call after `sc._default_clock_class` because, if
# `packets_have_beginning_default_clock_snapshot` or
# `packet_context_field_class` is not `None`, then this stream
# class needs to support packets already.
if packet_context_field_class is not None:
- sc._packet_context_field_class = packet_context_field_class
+ sc._set_packet_context_field_class(packet_context_field_class)
- sc._assigns_automatic_event_class_id = assigns_automatic_event_class_id
- sc._assigns_automatic_stream_id = assigns_automatic_stream_id
+ sc._set_assigns_automatic_event_class_id(assigns_automatic_event_class_id)
+ sc._set_assigns_automatic_stream_id(assigns_automatic_stream_id)
sc._set_supports_discarded_events(
supports_discarded_events, discarded_events_have_default_clock_snapshots
)
def _set_user_attributes_ptr(obj_ptr, value_ptr):
native_bt.trace_class_set_user_attributes(obj_ptr, value_ptr)
- def _assigns_automatic_stream_class_id(self, auto_id):
+ def _set_assigns_automatic_stream_class_id(self, auto_id):
bt2_utils._check_bool(auto_id)
return native_bt.trace_class_set_assigns_automatic_stream_class_id(
self._ptr, auto_id
)
- _assigns_automatic_stream_class_id = property(
- fset=_assigns_automatic_stream_class_id
- )
-
# Field class creation methods.
def _check_field_class_create_status(self, ptr, type_name):
@staticmethod
def _set_field_class_user_attrs(fc, user_attributes):
if user_attributes is not None:
- fc._user_attributes = user_attributes
+ fc._set_user_attributes(user_attributes)
def create_bool_field_class(self, user_attributes=None):
field_class_ptr = native_bt.field_class_bool_create(self._ptr)
field_class = py_cls._create_from_ptr(field_class_ptr)
if field_value_range is not None:
- field_class._field_value_range = field_value_range
+ field_class._set_field_value_range(field_value_range)
if preferred_display_base is not None:
- field_class._preferred_display_base = preferred_display_base
+ field_class._set_preferred_display_base(preferred_display_base)
self._set_field_class_user_attrs(field_class, user_attributes)
return field_class
self._check_field_class_create_status(ptr, "option")
fc = bt2_field_class._obj_type_from_field_class_ptr(ptr)._create_from_ptr(ptr)
self._set_field_class_user_attrs(fc, user_attributes)
- fc._selector_is_reversed = selector_is_reversed
+ fc._set_selector_is_reversed(selector_is_reversed)
return fc
def create_option_with_integer_selector_field_class(
def _set_user_attributes_ptr(obj_ptr, value_ptr):
raise NotImplementedError
- def _user_attributes(self, user_attributes):
+ def _set_user_attributes(self, user_attributes):
value = bt2_value.create_value(user_attributes)
bt2_utils._check_type(value, bt2_value.MapValue)
self._set_user_attributes_ptr(self._ptr, value._ptr)
-
- _user_attributes = property(fset=_user_attributes)