class _RealFieldClassConst(_FieldClassConst):
- _NAME = 'Const real'
+ pass
- @property
- def is_single_precision(self):
- return native_bt.field_class_real_is_single_precision(self._ptr)
+
+class _SinglePrecisionRealFieldClassConst(_RealFieldClassConst):
+ _NAME = 'Const single-precision real'
+
+
+class _DoublePrecisionRealFieldClassConst(_RealFieldClassConst):
+ _NAME = 'Const double-precision real'
class _RealFieldClass(_FieldClass, _RealFieldClassConst):
- _NAME = 'Real'
+ pass
+
+
+class _SinglePrecisionRealFieldClass(_RealFieldClass):
+ _NAME = 'Single-precision real'
- def _is_single_precision(self, is_single_precision):
- utils._check_bool(is_single_precision)
- native_bt.field_class_real_set_is_single_precision(
- self._ptr, is_single_precision
- )
- _is_single_precision = property(fset=_is_single_precision)
+class _DoublePrecisionRealFieldClass(_RealFieldClass):
+ _NAME = 'Double-precision real'
# an enumeration field class mapping does not have a reference count, so
class _UnsignedEnumerationFieldClassConst(
_EnumerationFieldClassConst, _UnsignedIntegerFieldClassConst
):
- _NAME = 'Const nsigned enumeration'
+ _NAME = 'Const unsigned enumeration'
_range_set_pycls = bt2_integer_range_set.UnsignedIntegerRangeSet
_borrow_mapping_ptr_by_label = staticmethod(
native_bt.field_class_enumeration_unsigned_borrow_mapping_by_label_const
if ptr is None:
return
- return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr)
+ return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
class _OptionFieldClass(_OptionFieldClassConst, _FieldClass):
if ptr is None:
return
- return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr)
+ return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
class _VariantFieldClassWithSelector(
_borrow_option_ptr_by_index = staticmethod(
native_bt.field_class_variant_with_selector_unsigned_borrow_option_by_index_const
)
- _append_option = staticmethod(
- native_bt.field_class_variant_with_selector_unsigned_append_option
- )
_variant_option_pycls = _VariantFieldClassWithUnsignedSelectorOptionConst
_as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
_NAME = 'Variant (with unsigned selector)'
_variant_option_pycls = _VariantFieldClassWithUnsignedSelectorOption
_as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
+ _append_option = staticmethod(
+ native_bt.field_class_variant_with_selector_unsigned_append_option
+ )
class _VariantFieldClassWithSignedSelectorConst(_VariantFieldClassWithSelectorConst):
_borrow_option_ptr_by_index = staticmethod(
native_bt.field_class_variant_with_selector_signed_borrow_option_by_index_const
)
- _append_option = staticmethod(
- native_bt.field_class_variant_with_selector_signed_append_option
- )
_variant_option_pycls = _VariantFieldClassWithSignedSelectorOptionConst
_as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
_NAME = 'Variant (with signed selector)'
_variant_option_pycls = _VariantFieldClassWithSignedSelectorOption
_as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
+ _append_option = staticmethod(
+ native_bt.field_class_variant_with_selector_signed_append_option
+ )
class _ArrayFieldClassConst(_FieldClassConst):
if ptr is None:
return
- return bt2_field_path._FieldPath._create_from_ptr_and_get_ref(ptr)
+ return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
class _DynamicArrayFieldClass(_DynamicArrayFieldClassConst, _ArrayFieldClass):
native_bt.FIELD_CLASS_TYPE_BIT_ARRAY: _BitArrayFieldClassConst,
native_bt.FIELD_CLASS_TYPE_UNSIGNED_INTEGER: _UnsignedIntegerFieldClassConst,
native_bt.FIELD_CLASS_TYPE_SIGNED_INTEGER: _SignedIntegerFieldClassConst,
- native_bt.FIELD_CLASS_TYPE_REAL: _RealFieldClassConst,
+ native_bt.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL: _SinglePrecisionRealFieldClassConst,
+ native_bt.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL: _DoublePrecisionRealFieldClassConst,
native_bt.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: _UnsignedEnumerationFieldClassConst,
native_bt.FIELD_CLASS_TYPE_SIGNED_ENUMERATION: _SignedEnumerationFieldClassConst,
native_bt.FIELD_CLASS_TYPE_STRING: _StringFieldClassConst,
native_bt.FIELD_CLASS_TYPE_BIT_ARRAY: _BitArrayFieldClass,
native_bt.FIELD_CLASS_TYPE_UNSIGNED_INTEGER: _UnsignedIntegerFieldClass,
native_bt.FIELD_CLASS_TYPE_SIGNED_INTEGER: _SignedIntegerFieldClass,
- native_bt.FIELD_CLASS_TYPE_REAL: _RealFieldClass,
+ native_bt.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL: _SinglePrecisionRealFieldClass,
+ native_bt.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL: _DoublePrecisionRealFieldClass,
native_bt.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: _UnsignedEnumerationFieldClass,
native_bt.FIELD_CLASS_TYPE_SIGNED_ENUMERATION: _SignedEnumerationFieldClass,
native_bt.FIELD_CLASS_TYPE_STRING: _StringFieldClass,