+
+
+class _ClockClass(_ClockClassConst):
+ _create_value_from_ptr_and_get_ref = staticmethod(
+ bt2_value._create_from_ptr_and_get_ref
+ )
+ _borrow_user_attributes_ptr = staticmethod(
+ native_bt.clock_class_borrow_user_attributes
+ )
+
+ def _user_attributes(self, user_attributes):
+ value = bt2_value.create_value(user_attributes)
+ bt2_utils._check_type(value, bt2_value.MapValue)
+ native_bt.clock_class_set_user_attributes(self._ptr, value._ptr)
+
+ _user_attributes = property(fset=_user_attributes)
+
+ def _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):
+ 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):
+ bt2_utils._check_uint64(frequency)
+ native_bt.clock_class_set_frequency(self._ptr, frequency)
+
+ _frequency = property(fset=_frequency)
+
+ def _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):
+ 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):
+ 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):
+ bt2_utils._check_type(uuid, uuidp.UUID)
+ native_bt.clock_class_set_uuid(self._ptr, uuid.bytes)
+
+ _uuid = property(fset=_uuid)