1 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
10 from bt2
import utils
as bt2_utils
11 from bt2
import object as bt2_object
12 from bt2
import native_bt
13 from bt2
import field_class
as bt2_field_class
16 def _create_field_from_ptr_template(
17 object_map
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
19 field_class_ptr
= native_bt
.field_borrow_class_const(ptr
)
20 typeid
= native_bt
.field_class_get_type(field_class_ptr
)
21 field
= object_map
[typeid
]._create
_from
_ptr
_and
_get
_ref
(
22 ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
27 def _create_field_from_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
28 return _create_field_from_ptr_template(
29 _TYPE_ID_TO_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
33 def _create_field_from_const_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
34 return _create_field_from_ptr_template(
35 _TYPE_ID_TO_CONST_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
39 # Get the "effective" field of `field`. If `field` is a variant, return
40 # the currently selected field. If `field` is an option, return the
41 # content field. If `field` is of any other type, return `field`
45 def _get_leaf_field(field
):
46 if isinstance(field
, _VariantFieldConst
):
47 return _get_leaf_field(field
.selected_option
)
49 if isinstance(field
, _OptionFieldConst
):
50 return _get_leaf_field(field
.field
)
55 class _FieldConst(bt2_object
._UniqueObject
):
56 _create_field_from_ptr
= staticmethod(_create_field_from_const_ptr
)
57 _create_field_class_from_ptr_and_get_ref
= staticmethod(
58 bt2_field_class
._create
_field
_class
_from
_const
_ptr
_and
_get
_ref
60 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class_const
)
62 def __eq__(self
, other
):
63 other
= _get_leaf_field(other
)
64 return self
._spec
_eq
(other
)
68 field_class_ptr
= self
._borrow
_class
_ptr
(self
._ptr
)
69 assert field_class_ptr
is not None
70 return self
._create
_field
_class
_from
_ptr
_and
_get
_ref
(field_class_ptr
)
73 raise NotImplementedError
79 class _Field(_FieldConst
):
80 _create_field_from_ptr
= staticmethod(_create_field_from_ptr
)
81 _create_field_class_from_ptr_and_get_ref
= staticmethod(
82 bt2_field_class
._create
_field
_class
_from
_ptr
_and
_get
_ref
84 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class
)
87 class _BitArrayFieldConst(_FieldConst
):
88 _NAME
= "Const bit array"
91 def value_as_integer(self
):
92 return native_bt
.field_bit_array_get_value_as_integer(self
._ptr
)
94 def _spec_eq(self
, other
):
95 if type(other
) is not type(self
):
98 return self
.value_as_integer
== other
.value_as_integer
101 return repr(self
.value_as_integer
)
104 return str(self
.value_as_integer
)
107 return self
.cls
.length
110 class _BitArrayField(_BitArrayFieldConst
, _Field
):
113 def _value_as_integer(self
, value
):
114 bt2_utils
._check
_uint
64(value
)
115 native_bt
.field_bit_array_set_value_as_integer(self
._ptr
, value
)
117 value_as_integer
= property(
118 fget
=_BitArrayFieldConst
.value_as_integer
.fget
, fset
=_value_as_integer
122 @functools.total_ordering
123 class _NumericFieldConst(_FieldConst
):
125 def _extract_value(other
):
126 if isinstance(other
, _BoolFieldConst
) or isinstance(other
, bool):
129 if isinstance(other
, numbers
.Integral
):
132 if isinstance(other
, numbers
.Real
):
135 if isinstance(other
, numbers
.Complex
):
136 return complex(other
)
139 "'{}' object is not a number object".format(other
.__class
__.__name
__)
143 return int(self
._value
)
146 return float(self
._value
)
149 return repr(self
._value
)
151 def __lt__(self
, other
):
152 if not isinstance(other
, numbers
.Number
):
154 "unorderable types: {}() < {}()".format(
155 self
.__class
__.__name
__, other
.__class
__.__name
__
159 return self
._value
< self
._extract
_value
(other
)
161 def _spec_eq(self
, other
):
163 return self
._value
== self
._extract
_value
(other
)
168 return hash(self
._value
)
170 def __rmod__(self
, other
):
171 return self
._extract
_value
(other
) % self
._value
173 def __mod__(self
, other
):
174 return self
._value
% self
._extract
_value
(other
)
176 def __rfloordiv__(self
, other
):
177 return self
._extract
_value
(other
) // self
._value
179 def __floordiv__(self
, other
):
180 return self
._value
// self
._extract
_value
(other
)
182 def __round__(self
, ndigits
=None):
184 return round(self
._value
)
186 return round(self
._value
, ndigits
)
189 return math
.ceil(self
._value
)
192 return math
.floor(self
._value
)
195 return int(self
._value
)
198 return abs(self
._value
)
200 def __add__(self
, other
):
201 return self
._value
+ self
._extract
_value
(other
)
203 def __radd__(self
, other
):
204 return self
.__add
__(other
)
212 def __mul__(self
, other
):
213 return self
._value
* self
._extract
_value
(other
)
215 def __rmul__(self
, other
):
216 return self
.__mul
__(other
)
218 def __truediv__(self
, other
):
219 return self
._value
/ self
._extract
_value
(other
)
221 def __rtruediv__(self
, other
):
222 return self
._extract
_value
(other
) / self
._value
224 def __pow__(self
, exponent
):
225 return self
._value
** self
._extract
_value
(exponent
)
227 def __rpow__(self
, base
):
228 return self
._extract
_value
(base
) ** self
._value
231 class _NumericField(_NumericFieldConst
, _Field
):
233 # Non const field are not hashable as their value may be modified
234 # without changing the underlying Python object.
235 raise TypeError("unhashable type: '{}'".format(self
._NAME
))
238 class _IntegralFieldConst(_NumericFieldConst
, numbers
.Integral
):
239 def __lshift__(self
, other
):
240 return self
._value
<< self
._extract
_value
(other
)
242 def __rlshift__(self
, other
):
243 return self
._extract
_value
(other
) << self
._value
245 def __rshift__(self
, other
):
246 return self
._value
>> self
._extract
_value
(other
)
248 def __rrshift__(self
, other
):
249 return self
._extract
_value
(other
) >> self
._value
251 def __and__(self
, other
):
252 return self
._value
& self
._extract
_value
(other
)
254 def __rand__(self
, other
):
255 return self
._extract
_value
(other
) & self
._value
257 def __xor__(self
, other
):
258 return self
._value ^ self
._extract
_value
(other
)
260 def __rxor__(self
, other
):
261 return self
._extract
_value
(other
) ^ self
._value
263 def __or__(self
, other
):
264 return self
._value | self
._extract
_value
(other
)
266 def __ror__(self
, other
):
267 return self
._extract
_value
(other
) | self
._value
269 def __invert__(self
):
273 class _IntegralField(_IntegralFieldConst
, _NumericField
):
277 class _BoolFieldConst(_IntegralFieldConst
, _FieldConst
):
278 _NAME
= "Const boolean"
284 def _value_to_bool(cls
, value
):
285 if isinstance(value
, _BoolFieldConst
):
288 if not isinstance(value
, bool):
290 "'{}' object is not a 'bool', '_BoolFieldConst', or '_BoolField' object".format(
299 return bool(native_bt
.field_bool_get_value(self
._ptr
))
302 class _BoolField(_BoolFieldConst
, _IntegralField
, _Field
):
305 def _set_value(self
, value
):
306 value
= self
._value
_to
_bool
(value
)
307 native_bt
.field_bool_set_value(self
._ptr
, value
)
309 value
= property(fset
=_set_value
)
312 class _IntegerFieldConst(_IntegralFieldConst
, _FieldConst
):
316 class _IntegerField(_IntegerFieldConst
, _IntegralField
, _Field
):
317 def _check_range(self
, value
):
318 if not (value
>= self
._lower
_bound
and value
<= self
._upper
_bound
):
320 "Value {} is outside valid range [{}, {}]".format(
321 value
, self
._lower
_bound
, self
._upper
_bound
326 class _UnsignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
327 _NAME
= "Const unsigned integer"
330 def _value_to_int(cls
, value
):
331 if not isinstance(value
, numbers
.Integral
):
332 raise TypeError("expecting an integral number object")
338 return native_bt
.field_integer_unsigned_get_value(self
._ptr
)
341 class _UnsignedIntegerField(_UnsignedIntegerFieldConst
, _IntegerField
, _Field
):
342 _NAME
= "Unsigned integer"
344 def _set_value(self
, value
):
345 value
= self
._value
_to
_int
(value
)
347 self
._check
_range
(value
)
349 native_bt
.field_integer_unsigned_set_value(self
._ptr
, value
)
351 value
= property(fset
=_set_value
)
354 def _lower_bound(self
):
358 def _upper_bound(self
):
359 return (2**self
.cls
.field_value_range
) - 1
362 class _SignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
363 _NAME
= "Const signed integer"
366 def _value_to_int(cls
, value
):
367 if not isinstance(value
, numbers
.Integral
):
368 raise TypeError("expecting an integral number object")
374 return native_bt
.field_integer_signed_get_value(self
._ptr
)
377 class _SignedIntegerField(_SignedIntegerFieldConst
, _IntegerField
, _Field
):
378 _NAME
= "Signed integer"
380 def _set_value(self
, value
):
381 value
= self
._value
_to
_int
(value
)
383 self
._check
_range
(value
)
385 native_bt
.field_integer_signed_set_value(self
._ptr
, value
)
387 value
= property(fset
=_set_value
)
390 def _lower_bound(self
):
391 return -1 * (2 ** (self
.cls
.field_value_range
- 1))
394 def _upper_bound(self
):
395 return (2 ** (self
.cls
.field_value_range
- 1)) - 1
398 class _RealFieldConst(_NumericFieldConst
, numbers
.Real
):
402 def _value_to_float(cls
, value
):
403 if not isinstance(value
, numbers
.Real
):
404 raise TypeError("expecting a real number object")
409 class _SinglePrecisionRealFieldConst(_RealFieldConst
):
410 _NAME
= "Const single-precision real"
414 return native_bt
.field_real_single_precision_get_value(self
._ptr
)
417 class _DoublePrecisionRealFieldConst(_RealFieldConst
):
418 _NAME
= "Const double-precision real"
422 return native_bt
.field_real_double_precision_get_value(self
._ptr
)
425 class _RealField(_RealFieldConst
, _NumericField
):
429 class _SinglePrecisionRealField(_SinglePrecisionRealFieldConst
, _RealField
):
430 _NAME
= "Single-precision real"
432 def _set_value(self
, value
):
433 value
= self
._value
_to
_float
(value
)
434 native_bt
.field_real_single_precision_set_value(self
._ptr
, value
)
436 value
= property(fset
=_set_value
)
439 class _DoublePrecisionRealField(_DoublePrecisionRealFieldConst
, _RealField
):
440 _NAME
= "Double-precision real"
442 def _set_value(self
, value
):
443 value
= self
._value
_to
_float
(value
)
444 native_bt
.field_real_double_precision_set_value(self
._ptr
, value
)
446 value
= property(fset
=_set_value
)
449 class _EnumerationFieldConst(_IntegerFieldConst
):
451 return "{} ({})".format(self
._value
, ", ".join(self
.labels
))
455 status
, labels
= self
._get
_mapping
_labels
(self
._ptr
)
456 bt2_utils
._handle
_func
_status
(status
, "cannot get label for enumeration field")
458 assert labels
is not None
462 class _EnumerationField(_EnumerationFieldConst
, _IntegerField
):
466 class _UnsignedEnumerationFieldConst(
467 _EnumerationFieldConst
, _UnsignedIntegerFieldConst
469 _NAME
= "Const unsigned Enumeration"
470 _get_mapping_labels
= staticmethod(
471 native_bt
.field_enumeration_unsigned_get_mapping_labels
475 class _UnsignedEnumerationField(
476 _UnsignedEnumerationFieldConst
, _EnumerationField
, _UnsignedIntegerField
478 _NAME
= "Unsigned enumeration"
481 class _SignedEnumerationFieldConst(_EnumerationFieldConst
, _SignedIntegerFieldConst
):
482 _NAME
= "Const signed Enumeration"
483 _get_mapping_labels
= staticmethod(
484 native_bt
.field_enumeration_signed_get_mapping_labels
488 class _SignedEnumerationField(
489 _SignedEnumerationFieldConst
, _EnumerationField
, _SignedIntegerField
491 _NAME
= "Signed enumeration"
494 @functools.total_ordering
495 class _StringFieldConst(_FieldConst
):
496 _NAME
= "Const string"
499 def _value_to_str(cls
, value
):
500 if isinstance(value
, _StringFieldConst
):
503 if not isinstance(value
, str):
504 raise TypeError("expecting a 'str' object")
510 return native_bt
.field_string_get_value(self
._ptr
)
512 def _spec_eq(self
, other
):
514 return self
._value
== self
._value
_to
_str
(other
)
518 def __lt__(self
, other
):
519 return self
._value
< self
._value
_to
_str
(other
)
522 return bool(self
._value
)
525 return hash(self
._value
)
528 return repr(self
._value
)
531 return str(self
._value
)
533 def __getitem__(self
, index
):
534 return self
._value
[index
]
537 return native_bt
.field_string_get_length(self
._ptr
)
540 class _StringField(_StringFieldConst
, _Field
):
543 def _set_value(self
, value
):
544 value
= self
._value
_to
_str
(value
)
545 native_bt
.field_string_set_value(self
._ptr
, value
)
547 value
= property(fset
=_set_value
)
549 def __iadd__(self
, value
):
550 value
= self
._value
_to
_str
(value
)
551 status
= native_bt
.field_string_append(self
._ptr
, value
)
552 bt2_utils
._handle
_func
_status
(
553 status
, "cannot append to string field object's value"
558 # Non const field are not hashable as their value may be modified
559 # without changing the underlying Python object.
560 raise TypeError("unhashable type: '{}'".format(self
._NAME
))
563 class _ContainerFieldConst(_FieldConst
):
565 return len(self
) != 0
571 count
= self
._count
()
575 def __delitem__(self
, index
):
576 raise NotImplementedError
578 def __setitem__(self
, index
, value
):
580 "'{}' object does not support item assignment".format(self
.__class
__)
584 class _ContainerField(_ContainerFieldConst
, _Field
):
588 class _StructureFieldConst(_ContainerFieldConst
, collections
.abc
.Mapping
):
589 _NAME
= "Const structure"
590 _borrow_member_field_ptr_by_index
= staticmethod(
591 native_bt
.field_structure_borrow_member_field_by_index_const
593 _borrow_member_field_ptr_by_name
= staticmethod(
594 native_bt
.field_structure_borrow_member_field_by_name_const
602 return iter(self
.cls
)
604 def _spec_eq(self
, other
):
605 if not isinstance(other
, collections
.abc
.Mapping
):
608 if len(self
) != len(other
):
612 for self_key
in self
:
613 if self_key
not in other
:
616 if self
[self_key
] != other
[self_key
]:
622 items
= ["{}: {}".format(repr(k
), repr(v
)) for k
, v
in self
.items()]
623 return "{{{}}}".format(", ".join(items
))
625 def __getitem__(self
, key
):
626 bt2_utils
._check
_str
(key
)
627 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_name
(self
._ptr
, key
)
629 if field_ptr
is None:
632 return self
._create
_field
_from
_ptr
(
633 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
636 def member_at_index(self
, index
):
637 bt2_utils
._check
_uint
64(index
)
639 if index
>= len(self
):
641 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_index
(self
._ptr
, index
)
642 assert field_ptr
is not None
643 return self
._create
_field
_from
_ptr
(
644 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
648 class _StructureField(
649 _StructureFieldConst
, _ContainerField
, collections
.abc
.MutableMapping
652 _borrow_member_field_ptr_by_index
= staticmethod(
653 native_bt
.field_structure_borrow_member_field_by_index
655 _borrow_member_field_ptr_by_name
= staticmethod(
656 native_bt
.field_structure_borrow_member_field_by_name
659 def __setitem__(self
, key
, value
):
660 # raises if key is somehow invalid
663 # the field's property does the appropriate conversion or raises
664 # the appropriate exception
667 def _set_value(self
, values
):
669 for key
, value
in values
.items():
670 self
[key
].value
= value
674 value
= property(fset
=_set_value
)
677 class _OptionFieldConst(_FieldConst
):
678 _NAME
= "Const option"
679 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field_const
)
683 field_ptr
= self
._borrow
_field
_ptr
(self
._ptr
)
685 if field_ptr
is None:
688 return self
._create
_field
_from
_ptr
(
689 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
694 return self
.field
is not None
696 def _spec_eq(self
, other
):
697 return _get_leaf_field(self
) == other
700 return self
.has_field
703 return str(self
.field
)
706 return repr(self
.field
)
709 class _OptionField(_OptionFieldConst
, _Field
):
711 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field
)
713 def _has_field(self
, value
):
714 bt2_utils
._check
_bool
(value
)
715 native_bt
.field_option_set_has_field(self
._ptr
, value
)
717 has_field
= property(fget
=_OptionFieldConst
.has_field
.fget
, fset
=_has_field
)
719 def _set_value(self
, value
):
720 self
.has_field
= True
722 assert field
is not None
725 value
= property(fset
=_set_value
)
728 class _VariantFieldConst(_ContainerFieldConst
, _FieldConst
):
729 _NAME
= "Const variant"
730 _borrow_selected_option_field_ptr
= staticmethod(
731 native_bt
.field_variant_borrow_selected_option_field_const
738 def selected_option_index(self
):
739 return native_bt
.field_variant_get_selected_option_index(self
._ptr
)
742 def selected_option(self
):
743 # TODO: Is there a way to check if the variant field has a selected_option,
744 # so we can raise an exception instead of hitting a pre-condition check?
745 # If there is something, that check should be added to selected_option_index too.
746 field_ptr
= self
._borrow
_selected
_option
_field
_ptr
(self
._ptr
)
748 return self
._create
_field
_from
_ptr
(
749 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
752 def _spec_eq(self
, other
):
753 return _get_leaf_field(self
) == other
756 raise NotImplementedError
759 return str(self
.selected_option
)
762 return repr(self
.selected_option
)
765 class _VariantField(_VariantFieldConst
, _ContainerField
, _Field
):
767 _borrow_selected_option_field_ptr
= staticmethod(
768 native_bt
.field_variant_borrow_selected_option_field
771 def _selected_option_index(self
, index
):
772 if index
< 0 or index
>= len(self
):
773 raise IndexError("{} field object index is out of range".format(self
._NAME
))
775 native_bt
.field_variant_select_option_by_index(self
._ptr
, index
)
777 selected_option_index
= property(
778 fget
=_VariantFieldConst
.selected_option_index
.fget
, fset
=_selected_option_index
781 def _set_value(self
, value
):
782 self
.selected_option
.value
= value
784 value
= property(fset
=_set_value
)
787 class _ArrayFieldConst(_ContainerFieldConst
, _FieldConst
, collections
.abc
.Sequence
):
788 _borrow_element_field_ptr_by_index
= staticmethod(
789 native_bt
.field_array_borrow_element_field_by_index_const
792 def _get_length(self
):
793 return native_bt
.field_array_get_length(self
._ptr
)
795 length
= property(fget
=_get_length
)
797 def __getitem__(self
, index
):
798 if not isinstance(index
, numbers
.Integral
):
800 "'{}' is not an integral number object: invalid index".format(
801 index
.__class
__.__name
__
807 if index
< 0 or index
>= len(self
):
808 raise IndexError("{} field object index is out of range".format(self
._NAME
))
810 field_ptr
= self
._borrow
_element
_field
_ptr
_by
_index
(self
._ptr
, index
)
812 return self
._create
_field
_from
_ptr
(
813 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
816 def insert(self
, index
, value
):
817 raise NotImplementedError
819 def _spec_eq(self
, other
):
820 if not isinstance(other
, collections
.abc
.Sequence
):
823 if len(self
) != len(other
):
827 for self_elem
, other_elem
in zip(self
, other
):
828 if self_elem
!= other_elem
:
834 return "[{}]".format(", ".join([repr(v
) for v
in self
]))
838 _ArrayFieldConst
, _ContainerField
, _Field
, collections
.abc
.MutableSequence
840 _borrow_element_field_ptr_by_index
= staticmethod(
841 native_bt
.field_array_borrow_element_field_by_index
844 def __setitem__(self
, index
, value
):
845 # raises if index is somehow invalid
848 if not isinstance(field
, (_NumericField
, _StringField
)):
849 raise TypeError("can only set the value of a number or string field")
851 # the field's property does the appropriate conversion or raises
852 # the appropriate exception
856 class _StaticArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
857 _NAME
= "Const static array"
860 return native_bt
.field_array_get_length(self
._ptr
)
863 class _StaticArrayField(_StaticArrayFieldConst
, _ArrayField
, _Field
):
864 _NAME
= "Static array"
866 def _set_value(self
, values
):
867 if len(self
) != len(values
):
869 "expected length of value ({}) and array field ({}) to match".format(
870 len(values
), len(self
)
874 for index
, value
in enumerate(values
):
875 if value
is not None:
876 self
[index
].value
= value
878 value
= property(fset
=_set_value
)
881 class _DynamicArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
882 _NAME
= "Const dynamic array"
888 class _DynamicArrayField(_DynamicArrayFieldConst
, _ArrayField
, _Field
):
889 _NAME
= "Dynamic array"
891 def _set_length(self
, length
):
892 bt2_utils
._check
_uint
64(length
)
893 status
= native_bt
.field_array_dynamic_set_length(self
._ptr
, length
)
894 bt2_utils
._handle
_func
_status
(status
, "cannot set dynamic array length")
896 length
= property(fget
=_ArrayField
._get
_length
, fset
=_set_length
)
898 def _set_value(self
, values
):
899 if len(values
) != self
.length
:
900 self
.length
= len(values
)
902 for index
, value
in enumerate(values
):
903 if value
is not None:
904 self
[index
].value
= value
906 value
= property(fset
=_set_value
)
909 _TYPE_ID_TO_CONST_OBJ
= {
910 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolFieldConst
,
911 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayFieldConst
,
912 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerFieldConst
,
913 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerFieldConst
,
914 native_bt
.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL
: _SinglePrecisionRealFieldConst
,
915 native_bt
.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL
: _DoublePrecisionRealFieldConst
,
916 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationFieldConst
,
917 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationFieldConst
,
918 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringFieldConst
,
919 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureFieldConst
,
920 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayFieldConst
,
921 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD
: _DynamicArrayFieldConst
,
922 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD
: _DynamicArrayFieldConst
,
923 native_bt
.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD
: _OptionFieldConst
,
924 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD
: _OptionFieldConst
,
925 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _OptionFieldConst
,
926 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _OptionFieldConst
,
927 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD
: _VariantFieldConst
,
928 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _VariantFieldConst
,
929 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _VariantFieldConst
,
933 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolField
,
934 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayField
,
935 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerField
,
936 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerField
,
937 native_bt
.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL
: _SinglePrecisionRealField
,
938 native_bt
.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL
: _DoublePrecisionRealField
,
939 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationField
,
940 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationField
,
941 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringField
,
942 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureField
,
943 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayField
,
944 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD
: _DynamicArrayField
,
945 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD
: _DynamicArrayField
,
946 native_bt
.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD
: _OptionField
,
947 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD
: _OptionField
,
948 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _OptionField
,
949 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _OptionField
,
950 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD
: _VariantField
,
951 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _VariantField
,
952 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _VariantField
,