1 # The MIT License (MIT)
3 # Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
5 # Permission is hereby granted, free of charge, to any person obtaining a copy
6 # of this software and associated documentation files (the "Software"), to deal
7 # in the Software without restriction, including without limitation the rights
8 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 # copies of the Software, and to permit persons to whom the Software is
10 # furnished to do so, subject to the following conditions:
12 # The above copyright notice and this permission notice shall be included in
13 # all copies or substantial portions of the Software.
15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 from bt2
import native_bt
, object, utils
24 from bt2
import field_class
as bt2_field_class
25 import collections
.abc
31 def _create_field_from_ptr_template(
32 object_map
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
35 field_class_ptr
= native_bt
.field_borrow_class_const(ptr
)
36 typeid
= native_bt
.field_class_get_type(field_class_ptr
)
37 field
= object_map
[typeid
]._create
_from
_ptr
_and
_get
_ref
(
38 ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
43 def _create_field_from_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
44 return _create_field_from_ptr_template(
45 _TYPE_ID_TO_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
49 def _create_field_from_const_ptr(ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
):
50 return _create_field_from_ptr_template(
51 _TYPE_ID_TO_CONST_OBJ
, ptr
, owner_ptr
, owner_get_ref
, owner_put_ref
55 # Get the "effective" field of `field`. If `field` is a variant, return
56 # the currently selected field. If `field` is an option, return the
57 # content field. If `field` is of any other type, return `field`
61 def _get_leaf_field(field
):
62 if isinstance(field
, _VariantFieldConst
):
63 return _get_leaf_field(field
.selected_option
)
65 if isinstance(field
, _OptionFieldConst
):
66 return _get_leaf_field(field
.field
)
71 class _FieldConst(object._UniqueObject
):
72 _create_field_from_ptr
= staticmethod(_create_field_from_const_ptr
)
73 _create_field_class_from_ptr_and_get_ref
= staticmethod(
74 bt2_field_class
._create
_field
_class
_from
_const
_ptr
_and
_get
_ref
76 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class_const
)
78 def __eq__(self
, other
):
79 other
= _get_leaf_field(other
)
80 return self
._spec
_eq
(other
)
84 field_class_ptr
= self
._borrow
_class
_ptr
(self
._ptr
)
85 assert field_class_ptr
is not None
86 return self
._create
_field
_class
_from
_ptr
_and
_get
_ref
(field_class_ptr
)
89 raise NotImplementedError
95 class _Field(_FieldConst
):
96 _create_field_from_ptr
= staticmethod(_create_field_from_ptr
)
97 _create_field_class_from_ptr_and_get_ref
= staticmethod(
98 bt2_field_class
._create
_field
_class
_from
_ptr
_and
_get
_ref
100 _borrow_class_ptr
= staticmethod(native_bt
.field_borrow_class
)
103 class _BitArrayFieldConst(_FieldConst
):
104 _NAME
= 'Const bit array'
107 def value_as_integer(self
):
108 return native_bt
.field_bit_array_get_value_as_integer(self
._ptr
)
110 def _spec_eq(self
, other
):
111 if type(other
) is not type(self
):
114 return self
.value_as_integer
== other
.value_as_integer
117 return repr(self
.value_as_integer
)
120 return str(self
.value_as_integer
)
123 return self
.cls
.length
126 class _BitArrayField(_BitArrayFieldConst
, _Field
):
129 def _value_as_integer(self
, value
):
130 utils
._check
_uint
64(value
)
131 native_bt
.field_bit_array_set_value_as_integer(self
._ptr
, value
)
133 value_as_integer
= property(
134 fget
=_BitArrayFieldConst
.value_as_integer
.fget
, fset
=_value_as_integer
138 @functools.total_ordering
139 class _NumericFieldConst(_FieldConst
):
141 def _extract_value(other
):
142 if isinstance(other
, _BoolFieldConst
) or isinstance(other
, bool):
145 if isinstance(other
, numbers
.Integral
):
148 if isinstance(other
, numbers
.Real
):
151 if isinstance(other
, numbers
.Complex
):
152 return complex(other
)
155 "'{}' object is not a number object".format(other
.__class
__.__name
__)
159 return int(self
._value
)
162 return float(self
._value
)
165 return repr(self
._value
)
167 def __lt__(self
, other
):
168 if not isinstance(other
, numbers
.Number
):
170 'unorderable types: {}() < {}()'.format(
171 self
.__class
__.__name
__, other
.__class
__.__name
__
175 return self
._value
< self
._extract
_value
(other
)
177 def _spec_eq(self
, other
):
179 return self
._value
== self
._extract
_value
(other
)
184 return hash(self
._value
)
186 def __rmod__(self
, other
):
187 return self
._extract
_value
(other
) % self
._value
189 def __mod__(self
, other
):
190 return self
._value
% self
._extract
_value
(other
)
192 def __rfloordiv__(self
, other
):
193 return self
._extract
_value
(other
) // self
._value
195 def __floordiv__(self
, other
):
196 return self
._value
// self
._extract
_value
(other
)
198 def __round__(self
, ndigits
=None):
200 return round(self
._value
)
202 return round(self
._value
, ndigits
)
205 return math
.ceil(self
._value
)
208 return math
.floor(self
._value
)
211 return int(self
._value
)
214 return abs(self
._value
)
216 def __add__(self
, other
):
217 return self
._value
+ self
._extract
_value
(other
)
219 def __radd__(self
, other
):
220 return self
.__add
__(other
)
228 def __mul__(self
, other
):
229 return self
._value
* self
._extract
_value
(other
)
231 def __rmul__(self
, other
):
232 return self
.__mul
__(other
)
234 def __truediv__(self
, other
):
235 return self
._value
/ self
._extract
_value
(other
)
237 def __rtruediv__(self
, other
):
238 return self
._extract
_value
(other
) / self
._value
240 def __pow__(self
, exponent
):
241 return self
._value
** self
._extract
_value
(exponent
)
243 def __rpow__(self
, base
):
244 return self
._extract
_value
(base
) ** self
._value
247 class _NumericField(_NumericFieldConst
, _Field
):
249 # Non const field are not hashable as their value may be modified
250 # without changing the underlying Python object.
251 raise TypeError('unhashable type: \'{}\''.format(self
._NAME
))
254 class _IntegralFieldConst(_NumericFieldConst
, numbers
.Integral
):
255 def __lshift__(self
, other
):
256 return self
._value
<< self
._extract
_value
(other
)
258 def __rlshift__(self
, other
):
259 return self
._extract
_value
(other
) << self
._value
261 def __rshift__(self
, other
):
262 return self
._value
>> self
._extract
_value
(other
)
264 def __rrshift__(self
, other
):
265 return self
._extract
_value
(other
) >> self
._value
267 def __and__(self
, other
):
268 return self
._value
& self
._extract
_value
(other
)
270 def __rand__(self
, other
):
271 return self
._extract
_value
(other
) & self
._value
273 def __xor__(self
, other
):
274 return self
._value ^ self
._extract
_value
(other
)
276 def __rxor__(self
, other
):
277 return self
._extract
_value
(other
) ^ self
._value
279 def __or__(self
, other
):
280 return self
._value | self
._extract
_value
(other
)
282 def __ror__(self
, other
):
283 return self
._extract
_value
(other
) | self
._value
285 def __invert__(self
):
289 class _IntegralField(_IntegralFieldConst
, _NumericField
):
293 class _BoolFieldConst(_IntegralFieldConst
, _FieldConst
):
294 _NAME
= 'Const boolean'
300 def _value_to_bool(cls
, value
):
301 if isinstance(value
, _BoolFieldConst
):
304 if not isinstance(value
, bool):
306 "'{}' object is not a 'bool', '_BoolFieldConst', or '_BoolField' object".format(
315 return bool(native_bt
.field_bool_get_value(self
._ptr
))
318 class _BoolField(_BoolFieldConst
, _IntegralField
, _Field
):
321 def _set_value(self
, value
):
322 value
= self
._value
_to
_bool
(value
)
323 native_bt
.field_bool_set_value(self
._ptr
, value
)
325 value
= property(fset
=_set_value
)
328 class _IntegerFieldConst(_IntegralFieldConst
, _FieldConst
):
332 class _IntegerField(_IntegerFieldConst
, _IntegralField
, _Field
):
336 class _UnsignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
337 _NAME
= 'Const unsigned integer'
340 def _value_to_int(cls
, value
):
341 if not isinstance(value
, numbers
.Integral
):
342 raise TypeError('expecting an integral number object')
345 utils
._check
_uint
64(value
)
351 return native_bt
.field_integer_unsigned_get_value(self
._ptr
)
354 class _UnsignedIntegerField(_UnsignedIntegerFieldConst
, _IntegerField
, _Field
):
355 _NAME
= 'Unsigned integer'
357 def _set_value(self
, value
):
358 value
= self
._value
_to
_int
(value
)
359 native_bt
.field_integer_unsigned_set_value(self
._ptr
, value
)
361 value
= property(fset
=_set_value
)
364 class _SignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
365 _NAME
= 'Const signed integer'
368 def _value_to_int(cls
, value
):
369 if not isinstance(value
, numbers
.Integral
):
370 raise TypeError('expecting an integral number object')
373 utils
._check
_int
64(value
)
379 return native_bt
.field_integer_signed_get_value(self
._ptr
)
382 class _SignedIntegerField(_SignedIntegerFieldConst
, _IntegerField
, _Field
):
383 _NAME
= 'Signed integer'
385 def _set_value(self
, value
):
386 value
= self
._value
_to
_int
(value
)
387 native_bt
.field_integer_signed_set_value(self
._ptr
, value
)
389 value
= property(fset
=_set_value
)
392 class _RealFieldConst(_NumericFieldConst
, numbers
.Real
):
396 def _value_to_float(cls
, value
):
397 if not isinstance(value
, numbers
.Real
):
398 raise TypeError("expecting a real number object")
404 return native_bt
.field_real_get_value(self
._ptr
)
407 class _RealField(_RealFieldConst
, _NumericField
):
410 def _set_value(self
, value
):
411 value
= self
._value
_to
_float
(value
)
412 native_bt
.field_real_set_value(self
._ptr
, value
)
414 value
= property(fset
=_set_value
)
417 class _EnumerationFieldConst(_IntegerFieldConst
):
419 return '{} ({})'.format(self
._value
, ', '.join(self
.labels
))
423 status
, labels
= self
._get
_mapping
_labels
(self
._ptr
)
424 utils
._handle
_func
_status
(status
, "cannot get label for enumeration field")
426 assert labels
is not None
430 class _EnumerationField(_EnumerationFieldConst
, _IntegerField
):
434 class _UnsignedEnumerationFieldConst(
435 _EnumerationFieldConst
, _UnsignedIntegerFieldConst
437 _NAME
= 'Const unsigned Enumeration'
438 _get_mapping_labels
= staticmethod(
439 native_bt
.field_enumeration_unsigned_get_mapping_labels
443 class _UnsignedEnumerationField(
444 _UnsignedEnumerationFieldConst
, _EnumerationField
, _UnsignedIntegerField
446 _NAME
= 'Unsigned enumeration'
449 class _SignedEnumerationFieldConst(_EnumerationFieldConst
, _SignedIntegerFieldConst
):
450 _NAME
= 'Const signed Enumeration'
451 _get_mapping_labels
= staticmethod(
452 native_bt
.field_enumeration_signed_get_mapping_labels
456 class _SignedEnumerationField(
457 _SignedEnumerationFieldConst
, _EnumerationField
, _SignedIntegerField
459 _NAME
= 'Signed enumeration'
462 @functools.total_ordering
463 class _StringFieldConst(_FieldConst
):
464 _NAME
= 'Const string'
467 def _value_to_str(cls
, value
):
468 if isinstance(value
, _StringFieldConst
):
471 if not isinstance(value
, str):
472 raise TypeError("expecting a 'str' object")
478 return native_bt
.field_string_get_value(self
._ptr
)
480 def _spec_eq(self
, other
):
482 return self
._value
== self
._value
_to
_str
(other
)
486 def __lt__(self
, other
):
487 return self
._value
< self
._value
_to
_str
(other
)
490 return bool(self
._value
)
493 return hash(self
._value
)
496 return repr(self
._value
)
499 return str(self
._value
)
501 def __getitem__(self
, index
):
502 return self
._value
[index
]
505 return native_bt
.field_string_get_length(self
._ptr
)
508 class _StringField(_StringFieldConst
, _Field
):
511 def _set_value(self
, value
):
512 value
= self
._value
_to
_str
(value
)
513 native_bt
.field_string_set_value(self
._ptr
, value
)
515 value
= property(fset
=_set_value
)
517 def __iadd__(self
, value
):
518 value
= self
._value
_to
_str
(value
)
519 status
= native_bt
.field_string_append(self
._ptr
, value
)
520 utils
._handle
_func
_status
(
521 status
, "cannot append to string field object's value"
526 # Non const field are not hashable as their value may be modified
527 # without changing the underlying Python object.
528 raise TypeError('unhashable type: \'{}\''.format(self
._NAME
))
531 class _ContainerFieldConst(_FieldConst
):
533 return len(self
) != 0
539 count
= self
._count
()
543 def __delitem__(self
, index
):
544 raise NotImplementedError
546 def __setitem__(self
, index
, value
):
548 '\'{}\' object does not support item assignment'.format(self
.__class
__)
552 class _ContainerField(_ContainerFieldConst
, _Field
):
556 class _StructureFieldConst(_ContainerFieldConst
, collections
.abc
.Mapping
):
557 _NAME
= 'Const structure'
558 _borrow_member_field_ptr_by_index
= staticmethod(
559 native_bt
.field_structure_borrow_member_field_by_index_const
561 _borrow_member_field_ptr_by_name
= staticmethod(
562 native_bt
.field_structure_borrow_member_field_by_name_const
570 return iter(self
.cls
)
572 def _spec_eq(self
, other
):
573 if not isinstance(other
, collections
.abc
.Mapping
):
576 if len(self
) != len(other
):
580 for self_key
in self
:
581 if self_key
not in other
:
584 if self
[self_key
] != other
[self_key
]:
590 items
= ['{}: {}'.format(repr(k
), repr(v
)) for k
, v
in self
.items()]
591 return '{{{}}}'.format(', '.join(items
))
593 def __getitem__(self
, key
):
594 utils
._check
_str
(key
)
595 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_name
(self
._ptr
, key
)
597 if field_ptr
is None:
600 return self
._create
_field
_from
_ptr
(
601 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
604 def member_at_index(self
, index
):
605 utils
._check
_uint
64(index
)
607 if index
>= len(self
):
609 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_index
(self
._ptr
, index
)
610 assert field_ptr
is not None
611 return self
._create
_field
_from
_ptr
(
612 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
616 class _StructureField(
617 _StructureFieldConst
, _ContainerField
, collections
.abc
.MutableMapping
620 _borrow_member_field_ptr_by_index
= staticmethod(
621 native_bt
.field_structure_borrow_member_field_by_index
623 _borrow_member_field_ptr_by_name
= staticmethod(
624 native_bt
.field_structure_borrow_member_field_by_name
627 def __setitem__(self
, key
, value
):
628 # raises if key is somehow invalid
631 # the field's property does the appropriate conversion or raises
632 # the appropriate exception
635 def _set_value(self
, values
):
637 for key
, value
in values
.items():
638 self
[key
].value
= value
642 value
= property(fset
=_set_value
)
645 class _OptionFieldConst(_FieldConst
):
646 _NAME
= 'Const option'
647 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field_const
)
651 field_ptr
= self
._borrow
_field
_ptr
(self
._ptr
)
653 if field_ptr
is None:
656 return self
._create
_field
_from
_ptr
(
657 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
662 return self
.field
is not None
664 def _spec_eq(self
, other
):
665 return _get_leaf_field(self
) == other
668 return self
.has_field
671 return str(self
.field
)
674 return repr(self
.field
)
677 class _OptionField(_OptionFieldConst
, _Field
):
679 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field
)
681 def _has_field(self
, value
):
682 utils
._check
_bool
(value
)
683 native_bt
.field_option_set_has_field(self
._ptr
, value
)
685 has_field
= property(fget
=_OptionFieldConst
.has_field
.fget
, fset
=_has_field
)
687 def _set_value(self
, value
):
688 self
.has_field
= True
690 assert field
is not None
693 value
= property(fset
=_set_value
)
696 class _VariantFieldConst(_ContainerFieldConst
, _FieldConst
):
697 _NAME
= 'Const variant'
698 _borrow_selected_option_field_ptr
= staticmethod(
699 native_bt
.field_variant_borrow_selected_option_field_const
706 def selected_option_index(self
):
707 return native_bt
.field_variant_get_selected_option_field_index(self
._ptr
)
710 def selected_option(self
):
711 # TODO: Is there a way to check if the variant field has a selected_option,
712 # so we can raise an exception instead of hitting a pre-condition check?
713 # If there is something, that check should be added to selected_option_index too.
714 field_ptr
= self
._borrow
_selected
_option
_field
_ptr
(self
._ptr
)
716 return self
._create
_field
_from
_ptr
(
717 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
720 def _spec_eq(self
, other
):
721 return _get_leaf_field(self
) == other
724 raise NotImplementedError
727 return str(self
.selected_option
)
730 return repr(self
.selected_option
)
733 class _VariantField(_VariantFieldConst
, _ContainerField
, _Field
):
735 _borrow_selected_option_field_ptr
= staticmethod(
736 native_bt
.field_variant_borrow_selected_option_field
739 def _selected_option_index(self
, index
):
740 if index
< 0 or index
>= len(self
):
741 raise IndexError('{} field object index is out of range'.format(self
._NAME
))
743 native_bt
.field_variant_select_option_field_by_index(self
._ptr
, index
)
745 selected_option_index
= property(
746 fget
=_VariantFieldConst
.selected_option_index
.fget
, fset
=_selected_option_index
749 def _set_value(self
, value
):
750 self
.selected_option
.value
= value
752 value
= property(fset
=_set_value
)
755 class _ArrayFieldConst(_ContainerFieldConst
, _FieldConst
, collections
.abc
.Sequence
):
756 _borrow_element_field_ptr_by_index
= staticmethod(
757 native_bt
.field_array_borrow_element_field_by_index_const
760 def _get_length(self
):
761 return native_bt
.field_array_get_length(self
._ptr
)
763 length
= property(fget
=_get_length
)
765 def __getitem__(self
, index
):
766 if not isinstance(index
, numbers
.Integral
):
768 "'{}' is not an integral number object: invalid index".format(
769 index
.__class
__.__name
__
775 if index
< 0 or index
>= len(self
):
776 raise IndexError('{} field object index is out of range'.format(self
._NAME
))
778 field_ptr
= self
._borrow
_element
_field
_ptr
_by
_index
(self
._ptr
, index
)
780 return self
._create
_field
_from
_ptr
(
781 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
784 def insert(self
, index
, value
):
785 raise NotImplementedError
787 def _spec_eq(self
, other
):
788 if not isinstance(other
, collections
.abc
.Sequence
):
791 if len(self
) != len(other
):
795 for self_elem
, other_elem
in zip(self
, other
):
796 if self_elem
!= other_elem
:
802 return '[{}]'.format(', '.join([repr(v
) for v
in self
]))
806 _ArrayFieldConst
, _ContainerField
, _Field
, collections
.abc
.MutableSequence
808 _borrow_element_field_ptr_by_index
= staticmethod(
809 native_bt
.field_array_borrow_element_field_by_index
812 def __setitem__(self
, index
, value
):
813 # raises if index is somehow invalid
816 if not isinstance(field
, (_NumericField
, _StringField
)):
817 raise TypeError('can only set the value of a number or string field')
819 # the field's property does the appropriate conversion or raises
820 # the appropriate exception
824 class _StaticArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
825 _NAME
= 'Const static array'
828 return native_bt
.field_array_get_length(self
._ptr
)
831 class _StaticArrayField(_StaticArrayFieldConst
, _ArrayField
, _Field
):
832 _NAME
= 'Static array'
834 def _set_value(self
, values
):
835 if len(self
) != len(values
):
836 raise ValueError('expected length of value and array field to match')
838 for index
, value
in enumerate(values
):
839 if value
is not None:
840 self
[index
].value
= value
842 value
= property(fset
=_set_value
)
845 class _DynamicArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
846 _NAME
= 'Const dynamic array'
852 class _DynamicArrayField(_DynamicArrayFieldConst
, _ArrayField
, _Field
):
853 _NAME
= 'Dynamic array'
855 def _set_length(self
, length
):
856 utils
._check
_uint
64(length
)
857 status
= native_bt
.field_array_dynamic_set_length(self
._ptr
, length
)
858 utils
._handle
_func
_status
(status
, "cannot set dynamic array length")
860 length
= property(fget
=_ArrayField
._get
_length
, fset
=_set_length
)
862 def _set_value(self
, values
):
863 if len(values
) != self
.length
:
864 self
.length
= len(values
)
866 for index
, value
in enumerate(values
):
867 if value
is not None:
868 self
[index
].value
= value
870 value
= property(fset
=_set_value
)
873 _TYPE_ID_TO_CONST_OBJ
= {
874 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolFieldConst
,
875 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayFieldConst
,
876 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerFieldConst
,
877 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerFieldConst
,
878 native_bt
.FIELD_CLASS_TYPE_REAL
: _RealFieldConst
,
879 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationFieldConst
,
880 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationFieldConst
,
881 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringFieldConst
,
882 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureFieldConst
,
883 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayFieldConst
,
884 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY
: _DynamicArrayFieldConst
,
885 native_bt
.FIELD_CLASS_TYPE_OPTION
: _OptionFieldConst
,
886 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR
: _VariantFieldConst
,
887 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR
: _VariantFieldConst
,
888 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR
: _VariantFieldConst
,
892 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolField
,
893 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayField
,
894 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerField
,
895 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerField
,
896 native_bt
.FIELD_CLASS_TYPE_REAL
: _RealField
,
897 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationField
,
898 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationField
,
899 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringField
,
900 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureField
,
901 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayField
,
902 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY
: _DynamicArrayField
,
903 native_bt
.FIELD_CLASS_TYPE_OPTION
: _OptionField
,
904 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR
: _VariantField
,
905 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR
: _VariantField
,
906 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR
: _VariantField
,