+ utils._check_type(length_fc, bt2_field_class._UnsignedIntegerFieldClass)
+ length_fc_ptr = length_fc._ptr
+
+ ptr = native_bt.field_class_array_dynamic_create(
+ self._ptr, elem_fc._ptr, length_fc_ptr
+ )
+ self._check_field_class_create_status(ptr, "dynamic array")
+ fc = bt2_field_class._obj_type_from_field_class_ptr(ptr)._create_from_ptr(ptr)
+ self._set_field_class_user_attrs(fc, user_attributes)
+ return fc
+
+ def create_option_without_selector_field_class(
+ self, content_fc, user_attributes=None
+ ):
+ utils._check_type(content_fc, bt2_field_class._FieldClass)
+ ptr = native_bt.field_class_option_without_selector_create(
+ self._ptr, content_fc._ptr
+ )
+ 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)
+ return fc
+
+ def create_option_with_bool_selector_field_class(
+ self, content_fc, selector_fc, selector_is_reversed=False, user_attributes=None
+ ):
+ utils._check_type(content_fc, bt2_field_class._FieldClass)
+ utils._check_bool(selector_is_reversed)
+ utils._check_type(selector_fc, bt2_field_class._BoolFieldClass)
+ ptr = native_bt.field_class_option_with_selector_field_bool_create(
+ self._ptr, content_fc._ptr, selector_fc._ptr
+ )
+ 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
+ return fc
+
+ def create_option_with_integer_selector_field_class(
+ self, content_fc, selector_fc, ranges, user_attributes=None
+ ):
+ utils._check_type(content_fc, bt2_field_class._FieldClass)
+ utils._check_type(selector_fc, bt2_field_class._IntegerFieldClass)
+
+ if len(ranges) == 0:
+ raise ValueError("integer range set is empty")
+
+ if isinstance(selector_fc, bt2_field_class._UnsignedIntegerFieldClass):
+ utils._check_type(ranges, bt2_integer_range_set.UnsignedIntegerRangeSet)
+ ptr = native_bt.field_class_option_with_selector_field_integer_unsigned_create(
+ self._ptr, content_fc._ptr, selector_fc._ptr, ranges._ptr
+ )
+ else:
+ utils._check_type(ranges, bt2_integer_range_set.SignedIntegerRangeSet)
+ ptr = (
+ native_bt.field_class_option_with_selector_field_integer_signed_create(
+ self._ptr, content_fc._ptr, selector_fc._ptr, ranges._ptr
+ )
+ )