1 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
5 from bt2
import native_bt
, object, utils
6 from bt2
import field_class
as bt2_field_class
13 def _create_field_from_ptr_template(
14 object_map
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
17 field_class_ptr
= native_bt
.field_borrow_class_const(ptr
)
18 typeid
= native_bt
.field_class_get_type(field_class_ptr
)
19 field
= object_map
[typeid
]._create
_from
_ptr
_and
_get
_ref
(
20 ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
25 def _create_field_from_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
26 return _create_field_from_ptr_template(
27 _TYPE_ID_TO_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
31 def _create_field_from_const_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
32 return _create_field_from_ptr_template(
33 _TYPE_ID_TO_CONST_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
37 # Get the "effective" field of `field`. If `field` is a variant, return
38 # the currently selected field. If `field` is an option, return the
39 # content field. If `field` is of any other type, return `field`
43 def _get_leaf_field(field
):
44 if isinstance(field
, _VariantFieldConst
):
45 return _get_leaf_field(field
.selected_option
)
47 if isinstance(field
, _OptionFieldConst
):
48 return _get_leaf_field(field
.field
)
53 class _FieldConst(object._UniqueObject
):
54 _create_field_from_ptr
= staticmethod(_create_field_from_const_ptr
)
55 _create_field_class_from_ptr_and_get_ref
= staticmethod(
56 bt2_field_class
._create
_field
_class
_from
_const
_ptr
_and
_get
_ref
58 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class_const
)
60 def __eq__(self
, other
):
61 other
= _get_leaf_field(other
)
62 return self
._spec
_eq
(other
)
66 field_class_ptr
= self
._borrow
_class
_ptr
(self
._ptr
)
67 assert field_class_ptr
is not None
68 return self
._create
_field
_class
_from
_ptr
_and
_get
_ref
(field_class_ptr
)
71 raise NotImplementedError
77 class _Field(_FieldConst
):
78 _create_field_from_ptr
= staticmethod(_create_field_from_ptr
)
79 _create_field_class_from_ptr_and_get_ref
= staticmethod(
80 bt2_field_class
._create
_field
_class
_from
_ptr
_and
_get
_ref
82 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class
)
85 class _BitArrayFieldConst(_FieldConst
):
86 _NAME
= 'Const bit array'
89 def value_as_integer(self
):
90 return native_bt
.field_bit_array_get_value_as_integer(self
._ptr
)
92 def _spec_eq(self
, other
):
93 if type(other
) is not type(self
):
96 return self
.value_as_integer
== other
.value_as_integer
99 return repr(self
.value_as_integer
)
102 return str(self
.value_as_integer
)
105 return self
.cls
.length
108 class _BitArrayField(_BitArrayFieldConst
, _Field
):
111 def _value_as_integer(self
, value
):
112 utils
._check
_uint
64(value
)
113 native_bt
.field_bit_array_set_value_as_integer(self
._ptr
, value
)
115 value_as_integer
= property(
116 fget
=_BitArrayFieldConst
.value_as_integer
.fget
, fset
=_value_as_integer
120 @functools.total_ordering
121 class _NumericFieldConst(_FieldConst
):
123 def _extract_value(other
):
124 if isinstance(other
, _BoolFieldConst
) or isinstance(other
, bool):
127 if isinstance(other
, numbers
.Integral
):
130 if isinstance(other
, numbers
.Real
):
133 if isinstance(other
, numbers
.Complex
):
134 return complex(other
)
137 "'{}' object is not a number object".format(other
.__class
__.__name
__)
141 return int(self
._value
)
144 return float(self
._value
)
147 return repr(self
._value
)
149 def __lt__(self
, other
):
150 if not isinstance(other
, numbers
.Number
):
152 'unorderable types: {}() < {}()'.format(
153 self
.__class
__.__name
__, other
.__class
__.__name
__
157 return self
._value
< self
._extract
_value
(other
)
159 def _spec_eq(self
, other
):
161 return self
._value
== self
._extract
_value
(other
)
166 return hash(self
._value
)
168 def __rmod__(self
, other
):
169 return self
._extract
_value
(other
) % self
._value
171 def __mod__(self
, other
):
172 return self
._value
% self
._extract
_value
(other
)
174 def __rfloordiv__(self
, other
):
175 return self
._extract
_value
(other
) // self
._value
177 def __floordiv__(self
, other
):
178 return self
._value
// self
._extract
_value
(other
)
180 def __round__(self
, ndigits
=None):
182 return round(self
._value
)
184 return round(self
._value
, ndigits
)
187 return math
.ceil(self
._value
)
190 return math
.floor(self
._value
)
193 return int(self
._value
)
196 return abs(self
._value
)
198 def __add__(self
, other
):
199 return self
._value
+ self
._extract
_value
(other
)
201 def __radd__(self
, other
):
202 return self
.__add
__(other
)
210 def __mul__(self
, other
):
211 return self
._value
* self
._extract
_value
(other
)
213 def __rmul__(self
, other
):
214 return self
.__mul
__(other
)
216 def __truediv__(self
, other
):
217 return self
._value
/ self
._extract
_value
(other
)
219 def __rtruediv__(self
, other
):
220 return self
._extract
_value
(other
) / self
._value
222 def __pow__(self
, exponent
):
223 return self
._value
** self
._extract
_value
(exponent
)
225 def __rpow__(self
, base
):
226 return self
._extract
_value
(base
) ** self
._value
229 class _NumericField(_NumericFieldConst
, _Field
):
231 # Non const field are not hashable as their value may be modified
232 # without changing the underlying Python object.
233 raise TypeError('unhashable type: \'{}\''.format(self
._NAME
))
236 class _IntegralFieldConst(_NumericFieldConst
, numbers
.Integral
):
237 def __lshift__(self
, other
):
238 return self
._value
<< self
._extract
_value
(other
)
240 def __rlshift__(self
, other
):
241 return self
._extract
_value
(other
) << self
._value
243 def __rshift__(self
, other
):
244 return self
._value
>> self
._extract
_value
(other
)
246 def __rrshift__(self
, other
):
247 return self
._extract
_value
(other
) >> self
._value
249 def __and__(self
, other
):
250 return self
._value
& self
._extract
_value
(other
)
252 def __rand__(self
, other
):
253 return self
._extract
_value
(other
) & self
._value
255 def __xor__(self
, other
):
256 return self
._value ^ self
._extract
_value
(other
)
258 def __rxor__(self
, other
):
259 return self
._extract
_value
(other
) ^ self
._value
261 def __or__(self
, other
):
262 return self
._value | self
._extract
_value
(other
)
264 def __ror__(self
, other
):
265 return self
._extract
_value
(other
) | self
._value
267 def __invert__(self
):
271 class _IntegralField(_IntegralFieldConst
, _NumericField
):
275 class _BoolFieldConst(_IntegralFieldConst
, _FieldConst
):
276 _NAME
= 'Const boolean'
282 def _value_to_bool(cls
, value
):
283 if isinstance(value
, _BoolFieldConst
):
286 if not isinstance(value
, bool):
288 "'{}' object is not a 'bool', '_BoolFieldConst', or '_BoolField' object".format(
297 return bool(native_bt
.field_bool_get_value(self
._ptr
))
300 class _BoolField(_BoolFieldConst
, _IntegralField
, _Field
):
303 def _set_value(self
, value
):
304 value
= self
._value
_to
_bool
(value
)
305 native_bt
.field_bool_set_value(self
._ptr
, value
)
307 value
= property(fset
=_set_value
)
310 class _IntegerFieldConst(_IntegralFieldConst
, _FieldConst
):
314 class _IntegerField(_IntegerFieldConst
, _IntegralField
, _Field
):
315 def _check_range(self
, value
):
316 if not (value
>= self
._lower
_bound
and value
<= self
._upper
_bound
):
318 "Value {} is outside valid range [{}, {}]".format(
319 value
, self
._lower
_bound
, self
._upper
_bound
324 class _UnsignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
325 _NAME
= 'Const unsigned integer'
328 def _value_to_int(cls
, value
):
329 if not isinstance(value
, numbers
.Integral
):
330 raise TypeError('expecting an integral number object')
336 return native_bt
.field_integer_unsigned_get_value(self
._ptr
)
339 class _UnsignedIntegerField(_UnsignedIntegerFieldConst
, _IntegerField
, _Field
):
340 _NAME
= 'Unsigned integer'
342 def _set_value(self
, value
):
343 value
= self
._value
_to
_int
(value
)
345 self
._check
_range
(value
)
347 native_bt
.field_integer_unsigned_set_value(self
._ptr
, value
)
349 value
= property(fset
=_set_value
)
352 def _lower_bound(self
):
356 def _upper_bound(self
):
357 return (2 ** self
.cls
.field_value_range
) - 1
360 class _SignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
361 _NAME
= 'Const signed integer'
364 def _value_to_int(cls
, value
):
365 if not isinstance(value
, numbers
.Integral
):
366 raise TypeError('expecting an integral number object')
372 return native_bt
.field_integer_signed_get_value(self
._ptr
)
375 class _SignedIntegerField(_SignedIntegerFieldConst
, _IntegerField
, _Field
):
376 _NAME
= 'Signed integer'
378 def _set_value(self
, value
):
379 value
= self
._value
_to
_int
(value
)
381 self
._check
_range
(value
)
383 native_bt
.field_integer_signed_set_value(self
._ptr
, value
)
385 value
= property(fset
=_set_value
)
388 def _lower_bound(self
):
389 return -1 * (2 ** (self
.cls
.field_value_range
- 1))
392 def _upper_bound(self
):
393 return (2 ** (self
.cls
.field_value_range
- 1)) - 1
396 class _RealFieldConst(_NumericFieldConst
, numbers
.Real
):
400 def _value_to_float(cls
, value
):
401 if not isinstance(value
, numbers
.Real
):
402 raise TypeError("expecting a real number object")
407 class _SinglePrecisionRealFieldConst(_RealFieldConst
):
408 _NAME
= 'Const single-precision real'
412 return native_bt
.field_real_single_precision_get_value(self
._ptr
)
415 class _DoublePrecisionRealFieldConst(_RealFieldConst
):
416 _NAME
= 'Const double-precision real'
420 return native_bt
.field_real_double_precision_get_value(self
._ptr
)
423 class _RealField(_RealFieldConst
, _NumericField
):
427 class _SinglePrecisionRealField(_SinglePrecisionRealFieldConst
, _RealField
):
428 _NAME
= 'Single-precision real'
430 def _set_value(self
, value
):
431 value
= self
._value
_to
_float
(value
)
432 native_bt
.field_real_single_precision_set_value(self
._ptr
, value
)
434 value
= property(fset
=_set_value
)
437 class _DoublePrecisionRealField(_DoublePrecisionRealFieldConst
, _RealField
):
438 _NAME
= 'Double-precision real'
440 def _set_value(self
, value
):
441 value
= self
._value
_to
_float
(value
)
442 native_bt
.field_real_double_precision_set_value(self
._ptr
, value
)
444 value
= property(fset
=_set_value
)
447 class _EnumerationFieldConst(_IntegerFieldConst
):
449 return '{} ({})'.format(self
._value
, ', '.join(self
.labels
))
453 status
, labels
= self
._get
_mapping
_labels
(self
._ptr
)
454 utils
._handle
_func
_status
(status
, "cannot get label for enumeration field")
456 assert labels
is not None
460 class _EnumerationField(_EnumerationFieldConst
, _IntegerField
):
464 class _UnsignedEnumerationFieldConst(
465 _EnumerationFieldConst
, _UnsignedIntegerFieldConst
467 _NAME
= 'Const unsigned Enumeration'
468 _get_mapping_labels
= staticmethod(
469 native_bt
.field_enumeration_unsigned_get_mapping_labels
473 class _UnsignedEnumerationField(
474 _UnsignedEnumerationFieldConst
, _EnumerationField
, _UnsignedIntegerField
476 _NAME
= 'Unsigned enumeration'
479 class _SignedEnumerationFieldConst(_EnumerationFieldConst
, _SignedIntegerFieldConst
):
480 _NAME
= 'Const signed Enumeration'
481 _get_mapping_labels
= staticmethod(
482 native_bt
.field_enumeration_signed_get_mapping_labels
486 class _SignedEnumerationField(
487 _SignedEnumerationFieldConst
, _EnumerationField
, _SignedIntegerField
489 _NAME
= 'Signed enumeration'
492 @functools.total_ordering
493 class _StringFieldConst(_FieldConst
):
494 _NAME
= 'Const string'
497 def _value_to_str(cls
, value
):
498 if isinstance(value
, _StringFieldConst
):
501 if not isinstance(value
, str):
502 raise TypeError("expecting a 'str' object")
508 return native_bt
.field_string_get_value(self
._ptr
)
510 def _spec_eq(self
, other
):
512 return self
._value
== self
._value
_to
_str
(other
)
516 def __lt__(self
, other
):
517 return self
._value
< self
._value
_to
_str
(other
)
520 return bool(self
._value
)
523 return hash(self
._value
)
526 return repr(self
._value
)
529 return str(self
._value
)
531 def __getitem__(self
, index
):
532 return self
._value
[index
]
535 return native_bt
.field_string_get_length(self
._ptr
)
538 class _StringField(_StringFieldConst
, _Field
):
541 def _set_value(self
, value
):
542 value
= self
._value
_to
_str
(value
)
543 native_bt
.field_string_set_value(self
._ptr
, value
)
545 value
= property(fset
=_set_value
)
547 def __iadd__(self
, value
):
548 value
= self
._value
_to
_str
(value
)
549 status
= native_bt
.field_string_append(self
._ptr
, value
)
550 utils
._handle
_func
_status
(
551 status
, "cannot append to string field object's value"
556 # Non const field are not hashable as their value may be modified
557 # without changing the underlying Python object.
558 raise TypeError('unhashable type: \'{}\''.format(self
._NAME
))
561 class _ContainerFieldConst(_FieldConst
):
563 return len(self
) != 0
569 count
= self
._count
()
573 def __delitem__(self
, index
):
574 raise NotImplementedError
576 def __setitem__(self
, index
, value
):
578 '\'{}\' object does not support item assignment'.format(self
.__class
__)
582 class _ContainerField(_ContainerFieldConst
, _Field
):
586 class _StructureFieldConst(_ContainerFieldConst
, collections
.abc
.Mapping
):
587 _NAME
= 'Const structure'
588 _borrow_member_field_ptr_by_index
= staticmethod(
589 native_bt
.field_structure_borrow_member_field_by_index_const
591 _borrow_member_field_ptr_by_name
= staticmethod(
592 native_bt
.field_structure_borrow_member_field_by_name_const
600 return iter(self
.cls
)
602 def _spec_eq(self
, other
):
603 if not isinstance(other
, collections
.abc
.Mapping
):
606 if len(self
) != len(other
):
610 for self_key
in self
:
611 if self_key
not in other
:
614 if self
[self_key
] != other
[self_key
]:
620 items
= ['{}: {}'.format(repr(k
), repr(v
)) for k
, v
in self
.items()]
621 return '{{{}}}'.format(', '.join(items
))
623 def __getitem__(self
, key
):
624 utils
._check
_str
(key
)
625 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_name
(self
._ptr
, key
)
627 if field_ptr
is None:
630 return self
._create
_field
_from
_ptr
(
631 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
634 def member_at_index(self
, index
):
635 utils
._check
_uint
64(index
)
637 if index
>= len(self
):
639 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_index
(self
._ptr
, index
)
640 assert field_ptr
is not None
641 return self
._create
_field
_from
_ptr
(
642 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
646 class _StructureField(
647 _StructureFieldConst
, _ContainerField
, collections
.abc
.MutableMapping
650 _borrow_member_field_ptr_by_index
= staticmethod(
651 native_bt
.field_structure_borrow_member_field_by_index
653 _borrow_member_field_ptr_by_name
= staticmethod(
654 native_bt
.field_structure_borrow_member_field_by_name
657 def __setitem__(self
, key
, value
):
658 # raises if key is somehow invalid
661 # the field's property does the appropriate conversion or raises
662 # the appropriate exception
665 def _set_value(self
, values
):
667 for key
, value
in values
.items():
668 self
[key
].value
= value
672 value
= property(fset
=_set_value
)
675 class _OptionFieldConst(_FieldConst
):
676 _NAME
= 'Const option'
677 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field_const
)
681 field_ptr
= self
._borrow
_field
_ptr
(self
._ptr
)
683 if field_ptr
is None:
686 return self
._create
_field
_from
_ptr
(
687 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
692 return self
.field
is not None
694 def _spec_eq(self
, other
):
695 return _get_leaf_field(self
) == other
698 return self
.has_field
701 return str(self
.field
)
704 return repr(self
.field
)
707 class _OptionField(_OptionFieldConst
, _Field
):
709 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field
)
711 def _has_field(self
, value
):
712 utils
._check
_bool
(value
)
713 native_bt
.field_option_set_has_field(self
._ptr
, value
)
715 has_field
= property(fget
=_OptionFieldConst
.has_field
.fget
, fset
=_has_field
)
717 def _set_value(self
, value
):
718 self
.has_field
= True
720 assert field
is not None
723 value
= property(fset
=_set_value
)
726 class _VariantFieldConst(_ContainerFieldConst
, _FieldConst
):
727 _NAME
= 'Const variant'
728 _borrow_selected_option_field_ptr
= staticmethod(
729 native_bt
.field_variant_borrow_selected_option_field_const
736 def selected_option_index(self
):
737 return native_bt
.field_variant_get_selected_option_index(self
._ptr
)
740 def selected_option(self
):
741 # TODO: Is there a way to check if the variant field has a selected_option,
742 # so we can raise an exception instead of hitting a pre-condition check?
743 # If there is something, that check should be added to selected_option_index too.
744 field_ptr
= self
._borrow
_selected
_option
_field
_ptr
(self
._ptr
)
746 return self
._create
_field
_from
_ptr
(
747 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
750 def _spec_eq(self
, other
):
751 return _get_leaf_field(self
) == other
754 raise NotImplementedError
757 return str(self
.selected_option
)
760 return repr(self
.selected_option
)
763 class _VariantField(_VariantFieldConst
, _ContainerField
, _Field
):
765 _borrow_selected_option_field_ptr
= staticmethod(
766 native_bt
.field_variant_borrow_selected_option_field
769 def _selected_option_index(self
, index
):
770 if index
< 0 or index
>= len(self
):
771 raise IndexError('{} field object index is out of range'.format(self
._NAME
))
773 native_bt
.field_variant_select_option_by_index(self
._ptr
, index
)
775 selected_option_index
= property(
776 fget
=_VariantFieldConst
.selected_option_index
.fget
, fset
=_selected_option_index
779 def _set_value(self
, value
):
780 self
.selected_option
.value
= value
782 value
= property(fset
=_set_value
)
785 class _ArrayFieldConst(_ContainerFieldConst
, _FieldConst
, collections
.abc
.Sequence
):
786 _borrow_element_field_ptr_by_index
= staticmethod(
787 native_bt
.field_array_borrow_element_field_by_index_const
790 def _get_length(self
):
791 return native_bt
.field_array_get_length(self
._ptr
)
793 length
= property(fget
=_get_length
)
795 def __getitem__(self
, index
):
796 if not isinstance(index
, numbers
.Integral
):
798 "'{}' is not an integral number object: invalid index".format(
799 index
.__class
__.__name
__
805 if index
< 0 or index
>= len(self
):
806 raise IndexError('{} field object index is out of range'.format(self
._NAME
))
808 field_ptr
= self
._borrow
_element
_field
_ptr
_by
_index
(self
._ptr
, index
)
810 return self
._create
_field
_from
_ptr
(
811 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
814 def insert(self
, index
, value
):
815 raise NotImplementedError
817 def _spec_eq(self
, other
):
818 if not isinstance(other
, collections
.abc
.Sequence
):
821 if len(self
) != len(other
):
825 for self_elem
, other_elem
in zip(self
, other
):
826 if self_elem
!= other_elem
:
832 return '[{}]'.format(', '.join([repr(v
) for v
in self
]))
836 _ArrayFieldConst
, _ContainerField
, _Field
, collections
.abc
.MutableSequence
838 _borrow_element_field_ptr_by_index
= staticmethod(
839 native_bt
.field_array_borrow_element_field_by_index
842 def __setitem__(self
, index
, value
):
843 # raises if index is somehow invalid
846 if not isinstance(field
, (_NumericField
, _StringField
)):
847 raise TypeError('can only set the value of a number or string field')
849 # the field's property does the appropriate conversion or raises
850 # the appropriate exception
854 class _StaticArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
855 _NAME
= 'Const static array'
858 return native_bt
.field_array_get_length(self
._ptr
)
861 class _StaticArrayField(_StaticArrayFieldConst
, _ArrayField
, _Field
):
862 _NAME
= 'Static array'
864 def _set_value(self
, values
):
865 if len(self
) != len(values
):
867 'expected length of value ({}) and array field ({}) to match'.format(
868 len(values
), len(self
)
872 for index
, value
in enumerate(values
):
873 if value
is not None:
874 self
[index
].value
= value
876 value
= property(fset
=_set_value
)
879 class _DynamicArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
880 _NAME
= 'Const dynamic array'
886 class _DynamicArrayField(_DynamicArrayFieldConst
, _ArrayField
, _Field
):
887 _NAME
= 'Dynamic array'
889 def _set_length(self
, length
):
890 utils
._check
_uint
64(length
)
891 status
= native_bt
.field_array_dynamic_set_length(self
._ptr
, length
)
892 utils
._handle
_func
_status
(status
, "cannot set dynamic array length")
894 length
= property(fget
=_ArrayField
._get
_length
, fset
=_set_length
)
896 def _set_value(self
, values
):
897 if len(values
) != self
.length
:
898 self
.length
= len(values
)
900 for index
, value
in enumerate(values
):
901 if value
is not None:
902 self
[index
].value
= value
904 value
= property(fset
=_set_value
)
907 _TYPE_ID_TO_CONST_OBJ
= {
908 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolFieldConst
,
909 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayFieldConst
,
910 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerFieldConst
,
911 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerFieldConst
,
912 native_bt
.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL
: _SinglePrecisionRealFieldConst
,
913 native_bt
.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL
: _DoublePrecisionRealFieldConst
,
914 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationFieldConst
,
915 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationFieldConst
,
916 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringFieldConst
,
917 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureFieldConst
,
918 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayFieldConst
,
919 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD
: _DynamicArrayFieldConst
,
920 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD
: _DynamicArrayFieldConst
,
921 native_bt
.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD
: _OptionFieldConst
,
922 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD
: _OptionFieldConst
,
923 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _OptionFieldConst
,
924 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _OptionFieldConst
,
925 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD
: _VariantFieldConst
,
926 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _VariantFieldConst
,
927 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _VariantFieldConst
,
931 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolField
,
932 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayField
,
933 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerField
,
934 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerField
,
935 native_bt
.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL
: _SinglePrecisionRealField
,
936 native_bt
.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL
: _DoublePrecisionRealField
,
937 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationField
,
938 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationField
,
939 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringField
,
940 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureField
,
941 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayField
,
942 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD
: _DynamicArrayField
,
943 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD
: _DynamicArrayField
,
944 native_bt
.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD
: _OptionField
,
945 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD
: _OptionField
,
946 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _OptionField
,
947 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _OptionField
,
948 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD
: _VariantField
,
949 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _VariantField
,
950 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _VariantField
,