X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbindings%2Fpython%2Fbt2%2Fbt2%2Ffield_class.py;h=99c179355705c11c28af2b85e3dca87cd54980d5;hb=8bc207afcf9695b096a0a8e8405f06b6328f069b;hp=121a73c5925bb9d5ccb3ad30ebf79e38fda3a393;hpb=0822832bfb0c1942f19a65fdeb49de08a3160666;p=babeltrace.git diff --git a/src/bindings/python/bt2/bt2/field_class.py b/src/bindings/python/bt2/bt2/field_class.py index 121a73c5..99c17935 100644 --- a/src/bindings/python/bt2/bt2/field_class.py +++ b/src/bindings/python/bt2/bt2/field_class.py @@ -92,7 +92,7 @@ class _FieldClass(_FieldClassConst): class _BoolFieldClassConst(_FieldClassConst): - _NAME = 'Const Boolean' + _NAME = 'Const boolean' class _BoolFieldClass(_BoolFieldClassConst, _FieldClass): @@ -100,7 +100,7 @@ class _BoolFieldClass(_BoolFieldClassConst, _FieldClass): class _BitArrayFieldClassConst(_FieldClassConst): - _NAME = 'Const Bit array' + _NAME = 'Const bit array' @property def length(self): @@ -498,7 +498,7 @@ class _StructureFieldClass(_StructureFieldClassConst, _FieldClass): class _OptionFieldClassConst(_FieldClassConst): - _NAME = 'Const Option' + _NAME = 'Const option' _create_field_class_from_ptr_and_get_ref = staticmethod( _create_field_class_from_const_ptr_and_get_ref ) @@ -513,11 +513,11 @@ class _OptionFieldClassConst(_FieldClassConst): class _OptionWithSelectorFieldClassConst(_OptionFieldClassConst): - _NAME = 'Const Option (with selector)' + _NAME = 'Const option (with selector)' @property def selector_field_path(self): - ptr = native_bt.field_class_option_with_selector_borrow_selector_field_path_const( + ptr = native_bt.field_class_option_with_selector_field_borrow_selector_field_path_const( self._ptr ) if ptr is None: @@ -527,19 +527,19 @@ class _OptionWithSelectorFieldClassConst(_OptionFieldClassConst): class _OptionWithBoolSelectorFieldClassConst(_OptionWithSelectorFieldClassConst): - _NAME = 'Const Option (with boolean selector)' + _NAME = 'Const option (with boolean selector)' @property def selector_is_reversed(self): return bool( - native_bt.field_class_option_with_selector_bool_selector_is_reversed( + native_bt.field_class_option_with_selector_field_bool_selector_is_reversed( self._ptr ) ) class _OptionWithIntegerSelectorFieldClassConst(_OptionWithSelectorFieldClassConst): - _NAME = 'Const Option (with integer selector)' + _NAME = 'Const option (with integer selector)' @property def ranges(self): @@ -551,20 +551,20 @@ class _OptionWithIntegerSelectorFieldClassConst(_OptionWithSelectorFieldClassCon class _OptionWithUnsignedIntegerSelectorFieldClassConst( _OptionWithIntegerSelectorFieldClassConst ): - _NAME = 'Const Option (with unsigned integer selector)' + _NAME = 'Const option (with unsigned integer selector)' _range_set_pycls = bt2_integer_range_set._UnsignedIntegerRangeSetConst _borrow_selector_ranges_ptr = staticmethod( - native_bt.field_class_option_with_selector_integer_unsigned_borrow_selector_ranges_const + native_bt.field_class_option_with_selector_field_integer_unsigned_borrow_selector_ranges_const ) class _OptionWithSignedIntegerSelectorFieldClassConst( _OptionWithIntegerSelectorFieldClassConst ): - _NAME = 'Const Option (with signed integer selector)' + _NAME = 'Const option (with signed integer selector)' _range_set_pycls = bt2_integer_range_set._SignedIntegerRangeSetConst _borrow_selector_ranges_ptr = staticmethod( - native_bt.field_class_option_with_selector_integer_signed_borrow_selector_ranges_const + native_bt.field_class_option_with_selector_field_integer_signed_borrow_selector_ranges_const ) @@ -591,7 +591,7 @@ class _OptionWithBoolSelectorFieldClass( def _selector_is_reversed(self, selector_is_reversed): utils._check_bool(selector_is_reversed) - native_bt.field_class_option_with_selector_bool_set_selector_is_reversed( + native_bt.field_class_option_with_selector_field_bool_set_selector_is_reversed( self._ptr, selector_is_reversed ) @@ -701,10 +701,10 @@ class _VariantFieldClassWithSignedIntegerSelectorOptionConst( _VariantFieldClassWithIntegerSelectorOptionConst ): _as_option_ptr = staticmethod( - native_bt.field_class_variant_with_selector_integer_signed_option_as_option_const + native_bt.field_class_variant_with_selector_field_integer_signed_option_as_option_const ) _borrow_ranges_ptr = staticmethod( - native_bt.field_class_variant_with_selector_integer_signed_option_borrow_ranges_const + native_bt.field_class_variant_with_selector_field_integer_signed_option_borrow_ranges_const ) _range_set_pycls = bt2_integer_range_set._SignedIntegerRangeSetConst @@ -720,10 +720,10 @@ class _VariantFieldClassWithUnsignedIntegerSelectorOptionConst( _VariantFieldClassWithIntegerSelectorOptionConst ): _as_option_ptr = staticmethod( - native_bt.field_class_variant_with_selector_integer_unsigned_option_as_option_const + native_bt.field_class_variant_with_selector_field_integer_unsigned_option_as_option_const ) _borrow_ranges_ptr = staticmethod( - native_bt.field_class_variant_with_selector_integer_unsigned_option_borrow_ranges_const + native_bt.field_class_variant_with_selector_field_integer_unsigned_option_borrow_ranges_const ) _range_set_pycls = bt2_integer_range_set._UnsignedIntegerRangeSetConst @@ -736,7 +736,7 @@ class _VariantFieldClassWithUnsignedIntegerSelectorOption( class _VariantFieldClassConst(_FieldClassConst, collections.abc.Mapping): - _NAME = 'Const Variant' + _NAME = 'Const variant' _borrow_option_ptr_by_name = staticmethod( native_bt.field_class_variant_borrow_option_by_name_const ) @@ -800,7 +800,7 @@ class _VariantFieldClass(_VariantFieldClassConst, _FieldClass, collections.abc.M class _VariantFieldClassWithoutSelectorConst(_VariantFieldClassConst): - _NAME = 'Const Variant (without selector)' + _NAME = 'Const variant (without selector)' class _VariantFieldClassWithoutSelector( @@ -839,11 +839,11 @@ class _VariantFieldClassWithoutSelector( class _VariantFieldClassWithIntegerSelectorConst(_VariantFieldClassConst): - _NAME = 'Const Variant (with selector)' + _NAME = 'Const variant (with selector)' @property def selector_field_path(self): - ptr = native_bt.field_class_variant_with_selector_borrow_selector_field_path_const( + ptr = native_bt.field_class_variant_with_selector_field_borrow_selector_field_path_const( self._ptr ) @@ -895,12 +895,12 @@ class _VariantFieldClassWithIntegerSelector( class _VariantFieldClassWithUnsignedIntegerSelectorConst( _VariantFieldClassWithIntegerSelectorConst ): - _NAME = 'Const Variant (with unsigned integer selector)' + _NAME = 'Const variant (with unsigned integer selector)' _borrow_option_ptr_by_name = staticmethod( - native_bt.field_class_variant_with_selector_integer_unsigned_borrow_option_by_name_const + native_bt.field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_name_const ) _borrow_option_ptr_by_index = staticmethod( - native_bt.field_class_variant_with_selector_integer_unsigned_borrow_option_by_index_const + native_bt.field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_index_const ) _variant_option_pycls = _VariantFieldClassWithUnsignedIntegerSelectorOptionConst _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) @@ -914,19 +914,19 @@ class _VariantFieldClassWithUnsignedIntegerSelector( _variant_option_pycls = _VariantFieldClassWithUnsignedIntegerSelectorOption _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) _append_option = staticmethod( - native_bt.field_class_variant_with_selector_integer_unsigned_append_option + native_bt.field_class_variant_with_selector_field_integer_unsigned_append_option ) class _VariantFieldClassWithSignedIntegerSelectorConst( _VariantFieldClassWithIntegerSelectorConst ): - _NAME = 'Const Variant (with signed integer selector)' + _NAME = 'Const variant (with signed integer selector)' _borrow_option_ptr_by_name = staticmethod( - native_bt.field_class_variant_with_selector_integer_signed_borrow_option_by_name_const + native_bt.field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_const ) _borrow_option_ptr_by_index = staticmethod( - native_bt.field_class_variant_with_selector_integer_signed_borrow_option_by_index_const + native_bt.field_class_variant_with_selector_field_integer_signed_borrow_option_by_index_const ) _variant_option_pycls = _VariantFieldClassWithSignedIntegerSelectorOptionConst _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) @@ -940,7 +940,7 @@ class _VariantFieldClassWithSignedIntegerSelector( _variant_option_pycls = _VariantFieldClassWithSignedIntegerSelectorOption _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr) _append_option = staticmethod( - native_bt.field_class_variant_with_selector_integer_signed_append_option + native_bt.field_class_variant_with_selector_field_integer_signed_append_option ) @@ -982,9 +982,13 @@ class _StaticArrayFieldClass(_StaticArrayFieldClassConst, _ArrayFieldClass): class _DynamicArrayFieldClassConst(_ArrayFieldClassConst): _NAME = 'Const dynamic array' + +class _DynamicArrayWithLengthFieldFieldClassConst(_DynamicArrayFieldClassConst): + _NAME = 'Const dynamic array (with length field)' + @property def length_field_path(self): - ptr = native_bt.field_class_array_dynamic_borrow_length_field_path_const( + ptr = native_bt.field_class_array_dynamic_with_length_field_borrow_length_field_path_const( self._ptr ) if ptr is None: @@ -994,7 +998,13 @@ class _DynamicArrayFieldClassConst(_ArrayFieldClassConst): class _DynamicArrayFieldClass(_DynamicArrayFieldClassConst, _ArrayFieldClass): - _NAME = 'Dynamic Array' + _NAME = 'Dynamic array' + + +class _DynamicArrayWithLengthFieldFieldClass( + _DynamicArrayWithLengthFieldFieldClassConst, _DynamicArrayFieldClass +): + _NAME = 'Dynamic array (with length field)' _FIELD_CLASS_TYPE_TO_CONST_OBJ = { @@ -1009,14 +1019,15 @@ _FIELD_CLASS_TYPE_TO_CONST_OBJ = { native_bt.FIELD_CLASS_TYPE_STRING: _StringFieldClassConst, native_bt.FIELD_CLASS_TYPE_STRUCTURE: _StructureFieldClassConst, native_bt.FIELD_CLASS_TYPE_STATIC_ARRAY: _StaticArrayFieldClassConst, - native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY: _DynamicArrayFieldClassConst, - native_bt.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR: _OptionFieldClassConst, - native_bt.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR: _OptionWithBoolSelectorFieldClassConst, - native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR: _OptionWithUnsignedIntegerSelectorFieldClassConst, - native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: _OptionWithSignedIntegerSelectorFieldClassConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: _VariantFieldClassWithoutSelectorConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: _VariantFieldClassWithUnsignedIntegerSelectorConst, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: _VariantFieldClassWithSignedIntegerSelectorConst, + native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD: _DynamicArrayFieldClassConst, + native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD: _DynamicArrayWithLengthFieldFieldClassConst, + native_bt.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD: _OptionFieldClassConst, + native_bt.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD: _OptionWithBoolSelectorFieldClassConst, + native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _OptionWithUnsignedIntegerSelectorFieldClassConst, + native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _OptionWithSignedIntegerSelectorFieldClassConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD: _VariantFieldClassWithoutSelectorConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithUnsignedIntegerSelectorConst, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithSignedIntegerSelectorConst, } _FIELD_CLASS_TYPE_TO_OBJ = { @@ -1031,12 +1042,13 @@ _FIELD_CLASS_TYPE_TO_OBJ = { native_bt.FIELD_CLASS_TYPE_STRING: _StringFieldClass, native_bt.FIELD_CLASS_TYPE_STRUCTURE: _StructureFieldClass, native_bt.FIELD_CLASS_TYPE_STATIC_ARRAY: _StaticArrayFieldClass, - native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY: _DynamicArrayFieldClass, - native_bt.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR: _OptionFieldClass, - native_bt.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR: _OptionWithBoolSelectorFieldClass, - native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR: _OptionWithUnsignedIntegerSelectorFieldClass, - native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR: _OptionWithSignedIntegerSelectorFieldClass, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR: _VariantFieldClassWithoutSelector, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR: _VariantFieldClassWithUnsignedIntegerSelector, - native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR: _VariantFieldClassWithSignedIntegerSelector, + native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD: _DynamicArrayFieldClass, + native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD: _DynamicArrayWithLengthFieldFieldClass, + native_bt.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD: _OptionFieldClass, + native_bt.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD: _OptionWithBoolSelectorFieldClass, + native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _OptionWithUnsignedIntegerSelectorFieldClass, + native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _OptionWithSignedIntegerSelectorFieldClass, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD: _VariantFieldClassWithoutSelector, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithUnsignedIntegerSelector, + native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithSignedIntegerSelector, }