1 # SPDX-License-Identifier: MIT
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
5 from bt2
import native_bt
6 from bt2
import object as bt2_object
7 from bt2
import utils
as bt2_utils
8 from bt2
import field_class
as bt2_field_class
15 def _create_field_from_ptr_template(
16 object_map
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
18 field_class_ptr
= native_bt
.field_borrow_class_const(ptr
)
19 typeid
= native_bt
.field_class_get_type(field_class_ptr
)
20 field
= object_map
[typeid
]._create
_from
_ptr
_and
_get
_ref
(
21 ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
26 def _create_field_from_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
27 return _create_field_from_ptr_template(
28 _TYPE_ID_TO_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
32 def _create_field_from_const_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
33 return _create_field_from_ptr_template(
34 _TYPE_ID_TO_CONST_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
38 # Get the "effective" field of `field`. If `field` is a variant, return
39 # the currently selected field. If `field` is an option, return the
40 # content field. If `field` is of any other type, return `field`
44 def _get_leaf_field(field
):
45 if isinstance(field
, _VariantFieldConst
):
46 return _get_leaf_field(field
.selected_option
)
48 if isinstance(field
, _OptionFieldConst
):
49 return _get_leaf_field(field
.field
)
54 class _FieldConst(bt2_object
._UniqueObject
):
55 _create_field_from_ptr
= staticmethod(_create_field_from_const_ptr
)
56 _create_field_class_from_ptr_and_get_ref
= staticmethod(
57 bt2_field_class
._create
_field
_class
_from
_const
_ptr
_and
_get
_ref
59 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class_const
)
61 def __eq__(self
, other
):
62 other
= _get_leaf_field(other
)
63 return self
._spec
_eq
(other
)
67 field_class_ptr
= self
._borrow
_class
_ptr
(self
._ptr
)
68 assert field_class_ptr
is not None
69 return self
._create
_field
_class
_from
_ptr
_and
_get
_ref
(field_class_ptr
)
72 raise NotImplementedError
78 class _Field(_FieldConst
):
79 _create_field_from_ptr
= staticmethod(_create_field_from_ptr
)
80 _create_field_class_from_ptr_and_get_ref
= staticmethod(
81 bt2_field_class
._create
_field
_class
_from
_ptr
_and
_get
_ref
83 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class
)
86 class _BitArrayFieldConst(_FieldConst
):
87 _NAME
= "Const bit array"
90 def value_as_integer(self
):
91 return native_bt
.field_bit_array_get_value_as_integer(self
._ptr
)
93 def _spec_eq(self
, other
):
94 if type(other
) is not type(self
):
97 return self
.value_as_integer
== other
.value_as_integer
100 return repr(self
.value_as_integer
)
103 return str(self
.value_as_integer
)
106 return self
.cls
.length
109 class _BitArrayField(_BitArrayFieldConst
, _Field
):
112 def _value_as_integer(self
, value
):
113 bt2_utils
._check
_uint
64(value
)
114 native_bt
.field_bit_array_set_value_as_integer(self
._ptr
, value
)
116 value_as_integer
= property(
117 fget
=_BitArrayFieldConst
.value_as_integer
.fget
, fset
=_value_as_integer
121 @functools.total_ordering
122 class _NumericFieldConst(_FieldConst
):
124 def _extract_value(other
):
125 if isinstance(other
, _BoolFieldConst
) or isinstance(other
, bool):
128 if isinstance(other
, numbers
.Integral
):
131 if isinstance(other
, numbers
.Real
):
134 if isinstance(other
, numbers
.Complex
):
135 return complex(other
)
138 "'{}' object is not a number object".format(other
.__class
__.__name
__)
142 return int(self
._value
)
145 return float(self
._value
)
148 return repr(self
._value
)
150 def __lt__(self
, other
):
151 if not isinstance(other
, numbers
.Number
):
153 "unorderable types: {}() < {}()".format(
154 self
.__class
__.__name
__, other
.__class
__.__name
__
158 return self
._value
< self
._extract
_value
(other
)
160 def _spec_eq(self
, other
):
162 return self
._value
== self
._extract
_value
(other
)
167 return hash(self
._value
)
169 def __rmod__(self
, other
):
170 return self
._extract
_value
(other
) % self
._value
172 def __mod__(self
, other
):
173 return self
._value
% self
._extract
_value
(other
)
175 def __rfloordiv__(self
, other
):
176 return self
._extract
_value
(other
) // self
._value
178 def __floordiv__(self
, other
):
179 return self
._value
// self
._extract
_value
(other
)
181 def __round__(self
, ndigits
=None):
183 return round(self
._value
)
185 return round(self
._value
, ndigits
)
188 return math
.ceil(self
._value
)
191 return math
.floor(self
._value
)
194 return int(self
._value
)
197 return abs(self
._value
)
199 def __add__(self
, other
):
200 return self
._value
+ self
._extract
_value
(other
)
202 def __radd__(self
, other
):
203 return self
.__add
__(other
)
211 def __mul__(self
, other
):
212 return self
._value
* self
._extract
_value
(other
)
214 def __rmul__(self
, other
):
215 return self
.__mul
__(other
)
217 def __truediv__(self
, other
):
218 return self
._value
/ self
._extract
_value
(other
)
220 def __rtruediv__(self
, other
):
221 return self
._extract
_value
(other
) / self
._value
223 def __pow__(self
, exponent
):
224 return self
._value
** self
._extract
_value
(exponent
)
226 def __rpow__(self
, base
):
227 return self
._extract
_value
(base
) ** self
._value
230 class _NumericField(_NumericFieldConst
, _Field
):
232 # Non const field are not hashable as their value may be modified
233 # without changing the underlying Python object.
234 raise TypeError("unhashable type: '{}'".format(self
._NAME
))
237 class _IntegralFieldConst(_NumericFieldConst
, numbers
.Integral
):
238 def __lshift__(self
, other
):
239 return self
._value
<< self
._extract
_value
(other
)
241 def __rlshift__(self
, other
):
242 return self
._extract
_value
(other
) << self
._value
244 def __rshift__(self
, other
):
245 return self
._value
>> self
._extract
_value
(other
)
247 def __rrshift__(self
, other
):
248 return self
._extract
_value
(other
) >> self
._value
250 def __and__(self
, other
):
251 return self
._value
& self
._extract
_value
(other
)
253 def __rand__(self
, other
):
254 return self
._extract
_value
(other
) & self
._value
256 def __xor__(self
, other
):
257 return self
._value ^ self
._extract
_value
(other
)
259 def __rxor__(self
, other
):
260 return self
._extract
_value
(other
) ^ self
._value
262 def __or__(self
, other
):
263 return self
._value | self
._extract
_value
(other
)
265 def __ror__(self
, other
):
266 return self
._extract
_value
(other
) | self
._value
268 def __invert__(self
):
272 class _IntegralField(_IntegralFieldConst
, _NumericField
):
276 class _BoolFieldConst(_IntegralFieldConst
, _FieldConst
):
277 _NAME
= "Const boolean"
283 def _value_to_bool(cls
, value
):
284 if isinstance(value
, _BoolFieldConst
):
287 if not isinstance(value
, bool):
289 "'{}' object is not a 'bool', '_BoolFieldConst', or '_BoolField' object".format(
298 return bool(native_bt
.field_bool_get_value(self
._ptr
))
301 class _BoolField(_BoolFieldConst
, _IntegralField
, _Field
):
304 def _set_value(self
, value
):
305 value
= self
._value
_to
_bool
(value
)
306 native_bt
.field_bool_set_value(self
._ptr
, value
)
308 value
= property(fset
=_set_value
)
311 class _IntegerFieldConst(_IntegralFieldConst
, _FieldConst
):
315 class _IntegerField(_IntegerFieldConst
, _IntegralField
, _Field
):
316 def _check_range(self
, value
):
317 if not (value
>= self
._lower
_bound
and value
<= self
._upper
_bound
):
319 "Value {} is outside valid range [{}, {}]".format(
320 value
, self
._lower
_bound
, self
._upper
_bound
325 class _UnsignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
326 _NAME
= "Const unsigned integer"
329 def _value_to_int(cls
, value
):
330 if not isinstance(value
, numbers
.Integral
):
331 raise TypeError("expecting an integral number object")
337 return native_bt
.field_integer_unsigned_get_value(self
._ptr
)
340 class _UnsignedIntegerField(_UnsignedIntegerFieldConst
, _IntegerField
, _Field
):
341 _NAME
= "Unsigned integer"
343 def _set_value(self
, value
):
344 value
= self
._value
_to
_int
(value
)
346 self
._check
_range
(value
)
348 native_bt
.field_integer_unsigned_set_value(self
._ptr
, value
)
350 value
= property(fset
=_set_value
)
353 def _lower_bound(self
):
357 def _upper_bound(self
):
358 return (2**self
.cls
.field_value_range
) - 1
361 class _SignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
362 _NAME
= "Const signed integer"
365 def _value_to_int(cls
, value
):
366 if not isinstance(value
, numbers
.Integral
):
367 raise TypeError("expecting an integral number object")
373 return native_bt
.field_integer_signed_get_value(self
._ptr
)
376 class _SignedIntegerField(_SignedIntegerFieldConst
, _IntegerField
, _Field
):
377 _NAME
= "Signed integer"
379 def _set_value(self
, value
):
380 value
= self
._value
_to
_int
(value
)
382 self
._check
_range
(value
)
384 native_bt
.field_integer_signed_set_value(self
._ptr
, value
)
386 value
= property(fset
=_set_value
)
389 def _lower_bound(self
):
390 return -1 * (2 ** (self
.cls
.field_value_range
- 1))
393 def _upper_bound(self
):
394 return (2 ** (self
.cls
.field_value_range
- 1)) - 1
397 class _RealFieldConst(_NumericFieldConst
, numbers
.Real
):
401 def _value_to_float(cls
, value
):
402 if not isinstance(value
, numbers
.Real
):
403 raise TypeError("expecting a real number object")
408 class _SinglePrecisionRealFieldConst(_RealFieldConst
):
409 _NAME
= "Const single-precision real"
413 return native_bt
.field_real_single_precision_get_value(self
._ptr
)
416 class _DoublePrecisionRealFieldConst(_RealFieldConst
):
417 _NAME
= "Const double-precision real"
421 return native_bt
.field_real_double_precision_get_value(self
._ptr
)
424 class _RealField(_RealFieldConst
, _NumericField
):
428 class _SinglePrecisionRealField(_SinglePrecisionRealFieldConst
, _RealField
):
429 _NAME
= "Single-precision real"
431 def _set_value(self
, value
):
432 value
= self
._value
_to
_float
(value
)
433 native_bt
.field_real_single_precision_set_value(self
._ptr
, value
)
435 value
= property(fset
=_set_value
)
438 class _DoublePrecisionRealField(_DoublePrecisionRealFieldConst
, _RealField
):
439 _NAME
= "Double-precision real"
441 def _set_value(self
, value
):
442 value
= self
._value
_to
_float
(value
)
443 native_bt
.field_real_double_precision_set_value(self
._ptr
, value
)
445 value
= property(fset
=_set_value
)
448 class _EnumerationFieldConst(_IntegerFieldConst
):
450 return "{} ({})".format(self
._value
, ", ".join(self
.labels
))
454 status
, labels
= self
._get
_mapping
_labels
(self
._ptr
)
455 bt2_utils
._handle
_func
_status
(status
, "cannot get label for enumeration field")
457 assert labels
is not None
461 class _EnumerationField(_EnumerationFieldConst
, _IntegerField
):
465 class _UnsignedEnumerationFieldConst(
466 _EnumerationFieldConst
, _UnsignedIntegerFieldConst
468 _NAME
= "Const unsigned Enumeration"
469 _get_mapping_labels
= staticmethod(
470 native_bt
.field_enumeration_unsigned_get_mapping_labels
474 class _UnsignedEnumerationField(
475 _UnsignedEnumerationFieldConst
, _EnumerationField
, _UnsignedIntegerField
477 _NAME
= "Unsigned enumeration"
480 class _SignedEnumerationFieldConst(_EnumerationFieldConst
, _SignedIntegerFieldConst
):
481 _NAME
= "Const signed Enumeration"
482 _get_mapping_labels
= staticmethod(
483 native_bt
.field_enumeration_signed_get_mapping_labels
487 class _SignedEnumerationField(
488 _SignedEnumerationFieldConst
, _EnumerationField
, _SignedIntegerField
490 _NAME
= "Signed enumeration"
493 @functools.total_ordering
494 class _StringFieldConst(_FieldConst
):
495 _NAME
= "Const string"
498 def _value_to_str(cls
, value
):
499 if isinstance(value
, _StringFieldConst
):
502 if not isinstance(value
, str):
503 raise TypeError("expecting a 'str' object")
509 return native_bt
.field_string_get_value(self
._ptr
)
511 def _spec_eq(self
, other
):
513 return self
._value
== self
._value
_to
_str
(other
)
517 def __lt__(self
, other
):
518 return self
._value
< self
._value
_to
_str
(other
)
521 return bool(self
._value
)
524 return hash(self
._value
)
527 return repr(self
._value
)
530 return str(self
._value
)
532 def __getitem__(self
, index
):
533 return self
._value
[index
]
536 return native_bt
.field_string_get_length(self
._ptr
)
539 class _StringField(_StringFieldConst
, _Field
):
542 def _set_value(self
, value
):
543 value
= self
._value
_to
_str
(value
)
544 native_bt
.field_string_set_value(self
._ptr
, value
)
546 value
= property(fset
=_set_value
)
548 def __iadd__(self
, value
):
549 value
= self
._value
_to
_str
(value
)
550 status
= native_bt
.field_string_append(self
._ptr
, value
)
551 bt2_utils
._handle
_func
_status
(
552 status
, "cannot append to string field object's value"
557 # Non const field are not hashable as their value may be modified
558 # without changing the underlying Python object.
559 raise TypeError("unhashable type: '{}'".format(self
._NAME
))
562 class _ContainerFieldConst(_FieldConst
):
564 return len(self
) != 0
570 count
= self
._count
()
574 def __delitem__(self
, index
):
575 raise NotImplementedError
577 def __setitem__(self
, index
, value
):
579 "'{}' object does not support item assignment".format(self
.__class
__)
583 class _ContainerField(_ContainerFieldConst
, _Field
):
587 class _StructureFieldConst(_ContainerFieldConst
, collections
.abc
.Mapping
):
588 _NAME
= "Const structure"
589 _borrow_member_field_ptr_by_index
= staticmethod(
590 native_bt
.field_structure_borrow_member_field_by_index_const
592 _borrow_member_field_ptr_by_name
= staticmethod(
593 native_bt
.field_structure_borrow_member_field_by_name_const
601 return iter(self
.cls
)
603 def _spec_eq(self
, other
):
604 if not isinstance(other
, collections
.abc
.Mapping
):
607 if len(self
) != len(other
):
611 for self_key
in self
:
612 if self_key
not in other
:
615 if self
[self_key
] != other
[self_key
]:
621 items
= ["{}: {}".format(repr(k
), repr(v
)) for k
, v
in self
.items()]
622 return "{{{}}}".format(", ".join(items
))
624 def __getitem__(self
, key
):
625 bt2_utils
._check
_str
(key
)
626 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_name
(self
._ptr
, key
)
628 if field_ptr
is None:
631 return self
._create
_field
_from
_ptr
(
632 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
635 def member_at_index(self
, index
):
636 bt2_utils
._check
_uint
64(index
)
638 if index
>= len(self
):
640 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_index
(self
._ptr
, index
)
641 assert field_ptr
is not None
642 return self
._create
_field
_from
_ptr
(
643 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
647 class _StructureField(
648 _StructureFieldConst
, _ContainerField
, collections
.abc
.MutableMapping
651 _borrow_member_field_ptr_by_index
= staticmethod(
652 native_bt
.field_structure_borrow_member_field_by_index
654 _borrow_member_field_ptr_by_name
= staticmethod(
655 native_bt
.field_structure_borrow_member_field_by_name
658 def __setitem__(self
, key
, value
):
659 # raises if key is somehow invalid
662 # the field's property does the appropriate conversion or raises
663 # the appropriate exception
666 def _set_value(self
, values
):
668 for key
, value
in values
.items():
669 self
[key
].value
= value
673 value
= property(fset
=_set_value
)
676 class _OptionFieldConst(_FieldConst
):
677 _NAME
= "Const option"
678 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field_const
)
682 field_ptr
= self
._borrow
_field
_ptr
(self
._ptr
)
684 if field_ptr
is None:
687 return self
._create
_field
_from
_ptr
(
688 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
693 return self
.field
is not None
695 def _spec_eq(self
, other
):
696 return _get_leaf_field(self
) == other
699 return self
.has_field
702 return str(self
.field
)
705 return repr(self
.field
)
708 class _OptionField(_OptionFieldConst
, _Field
):
710 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field
)
712 def _has_field(self
, value
):
713 bt2_utils
._check
_bool
(value
)
714 native_bt
.field_option_set_has_field(self
._ptr
, value
)
716 has_field
= property(fget
=_OptionFieldConst
.has_field
.fget
, fset
=_has_field
)
718 def _set_value(self
, value
):
719 self
.has_field
= True
721 assert field
is not None
724 value
= property(fset
=_set_value
)
727 class _VariantFieldConst(_ContainerFieldConst
, _FieldConst
):
728 _NAME
= "Const variant"
729 _borrow_selected_option_field_ptr
= staticmethod(
730 native_bt
.field_variant_borrow_selected_option_field_const
737 def selected_option_index(self
):
738 return native_bt
.field_variant_get_selected_option_index(self
._ptr
)
741 def selected_option(self
):
742 # TODO: Is there a way to check if the variant field has a selected_option,
743 # so we can raise an exception instead of hitting a pre-condition check?
744 # If there is something, that check should be added to selected_option_index too.
745 field_ptr
= self
._borrow
_selected
_option
_field
_ptr
(self
._ptr
)
747 return self
._create
_field
_from
_ptr
(
748 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
751 def _spec_eq(self
, other
):
752 return _get_leaf_field(self
) == other
755 raise NotImplementedError
758 return str(self
.selected_option
)
761 return repr(self
.selected_option
)
764 class _VariantField(_VariantFieldConst
, _ContainerField
, _Field
):
766 _borrow_selected_option_field_ptr
= staticmethod(
767 native_bt
.field_variant_borrow_selected_option_field
770 def _selected_option_index(self
, index
):
771 if index
< 0 or index
>= len(self
):
772 raise IndexError("{} field object index is out of range".format(self
._NAME
))
774 native_bt
.field_variant_select_option_by_index(self
._ptr
, index
)
776 selected_option_index
= property(
777 fget
=_VariantFieldConst
.selected_option_index
.fget
, fset
=_selected_option_index
780 def _set_value(self
, value
):
781 self
.selected_option
.value
= value
783 value
= property(fset
=_set_value
)
786 class _ArrayFieldConst(_ContainerFieldConst
, _FieldConst
, collections
.abc
.Sequence
):
787 _borrow_element_field_ptr_by_index
= staticmethod(
788 native_bt
.field_array_borrow_element_field_by_index_const
791 def _get_length(self
):
792 return native_bt
.field_array_get_length(self
._ptr
)
794 length
= property(fget
=_get_length
)
796 def __getitem__(self
, index
):
797 if not isinstance(index
, numbers
.Integral
):
799 "'{}' is not an integral number object: invalid index".format(
800 index
.__class
__.__name
__
806 if index
< 0 or index
>= len(self
):
807 raise IndexError("{} field object index is out of range".format(self
._NAME
))
809 field_ptr
= self
._borrow
_element
_field
_ptr
_by
_index
(self
._ptr
, index
)
811 return self
._create
_field
_from
_ptr
(
812 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
815 def insert(self
, index
, value
):
816 raise NotImplementedError
818 def _spec_eq(self
, other
):
819 if not isinstance(other
, collections
.abc
.Sequence
):
822 if len(self
) != len(other
):
826 for self_elem
, other_elem
in zip(self
, other
):
827 if self_elem
!= other_elem
:
833 return "[{}]".format(", ".join([repr(v
) for v
in self
]))
837 _ArrayFieldConst
, _ContainerField
, _Field
, collections
.abc
.MutableSequence
839 _borrow_element_field_ptr_by_index
= staticmethod(
840 native_bt
.field_array_borrow_element_field_by_index
843 def __setitem__(self
, index
, value
):
844 # raises if index is somehow invalid
847 if not isinstance(field
, (_NumericField
, _StringField
)):
848 raise TypeError("can only set the value of a number or string field")
850 # the field's property does the appropriate conversion or raises
851 # the appropriate exception
855 class _StaticArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
856 _NAME
= "Const static array"
859 return native_bt
.field_array_get_length(self
._ptr
)
862 class _StaticArrayField(_StaticArrayFieldConst
, _ArrayField
, _Field
):
863 _NAME
= "Static array"
865 def _set_value(self
, values
):
866 if len(self
) != len(values
):
868 "expected length of value ({}) and array field ({}) to match".format(
869 len(values
), len(self
)
873 for index
, value
in enumerate(values
):
874 if value
is not None:
875 self
[index
].value
= value
877 value
= property(fset
=_set_value
)
880 class _DynamicArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
881 _NAME
= "Const dynamic array"
887 class _DynamicArrayField(_DynamicArrayFieldConst
, _ArrayField
, _Field
):
888 _NAME
= "Dynamic array"
890 def _set_length(self
, length
):
891 bt2_utils
._check
_uint
64(length
)
892 status
= native_bt
.field_array_dynamic_set_length(self
._ptr
, length
)
893 bt2_utils
._handle
_func
_status
(status
, "cannot set dynamic array length")
895 length
= property(fget
=_ArrayField
._get
_length
, fset
=_set_length
)
897 def _set_value(self
, values
):
898 if len(values
) != self
.length
:
899 self
.length
= len(values
)
901 for index
, value
in enumerate(values
):
902 if value
is not None:
903 self
[index
].value
= value
905 value
= property(fset
=_set_value
)
908 _TYPE_ID_TO_CONST_OBJ
= {
909 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolFieldConst
,
910 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayFieldConst
,
911 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerFieldConst
,
912 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerFieldConst
,
913 native_bt
.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL
: _SinglePrecisionRealFieldConst
,
914 native_bt
.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL
: _DoublePrecisionRealFieldConst
,
915 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationFieldConst
,
916 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationFieldConst
,
917 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringFieldConst
,
918 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureFieldConst
,
919 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayFieldConst
,
920 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD
: _DynamicArrayFieldConst
,
921 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD
: _DynamicArrayFieldConst
,
922 native_bt
.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD
: _OptionFieldConst
,
923 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD
: _OptionFieldConst
,
924 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _OptionFieldConst
,
925 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _OptionFieldConst
,
926 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD
: _VariantFieldConst
,
927 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _VariantFieldConst
,
928 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _VariantFieldConst
,
932 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolField
,
933 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayField
,
934 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerField
,
935 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerField
,
936 native_bt
.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL
: _SinglePrecisionRealField
,
937 native_bt
.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL
: _DoublePrecisionRealField
,
938 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationField
,
939 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationField
,
940 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringField
,
941 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureField
,
942 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayField
,
943 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD
: _DynamicArrayField
,
944 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD
: _DynamicArrayField
,
945 native_bt
.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD
: _OptionField
,
946 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD
: _OptionField
,
947 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _OptionField
,
948 native_bt
.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _OptionField
,
949 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD
: _VariantField
,
950 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD
: _VariantField
,
951 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD
: _VariantField
,