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
)
183 def __rmod__(self
, other
):
184 return self
._extract
_value
(other
) % self
._value
186 def __mod__(self
, other
):
187 return self
._value
% self
._extract
_value
(other
)
189 def __rfloordiv__(self
, other
):
190 return self
._extract
_value
(other
) // self
._value
192 def __floordiv__(self
, other
):
193 return self
._value
// self
._extract
_value
(other
)
195 def __round__(self
, ndigits
=None):
197 return round(self
._value
)
199 return round(self
._value
, ndigits
)
202 return math
.ceil(self
._value
)
205 return math
.floor(self
._value
)
208 return int(self
._value
)
211 return abs(self
._value
)
213 def __add__(self
, other
):
214 return self
._value
+ self
._extract
_value
(other
)
216 def __radd__(self
, other
):
217 return self
.__add
__(other
)
225 def __mul__(self
, other
):
226 return self
._value
* self
._extract
_value
(other
)
228 def __rmul__(self
, other
):
229 return self
.__mul
__(other
)
231 def __truediv__(self
, other
):
232 return self
._value
/ self
._extract
_value
(other
)
234 def __rtruediv__(self
, other
):
235 return self
._extract
_value
(other
) / self
._value
237 def __pow__(self
, exponent
):
238 return self
._value
** self
._extract
_value
(exponent
)
240 def __rpow__(self
, base
):
241 return self
._extract
_value
(base
) ** self
._value
244 class _NumericField(_NumericFieldConst
, _Field
):
248 class _IntegralFieldConst(_NumericFieldConst
, numbers
.Integral
):
249 def __lshift__(self
, other
):
250 return self
._value
<< self
._extract
_value
(other
)
252 def __rlshift__(self
, other
):
253 return self
._extract
_value
(other
) << self
._value
255 def __rshift__(self
, other
):
256 return self
._value
>> self
._extract
_value
(other
)
258 def __rrshift__(self
, other
):
259 return self
._extract
_value
(other
) >> self
._value
261 def __and__(self
, other
):
262 return self
._value
& self
._extract
_value
(other
)
264 def __rand__(self
, other
):
265 return self
._extract
_value
(other
) & self
._value
267 def __xor__(self
, other
):
268 return self
._value ^ self
._extract
_value
(other
)
270 def __rxor__(self
, other
):
271 return self
._extract
_value
(other
) ^ self
._value
273 def __or__(self
, other
):
274 return self
._value | self
._extract
_value
(other
)
276 def __ror__(self
, other
):
277 return self
._extract
_value
(other
) | self
._value
279 def __invert__(self
):
283 class _IntegralField(_IntegralFieldConst
, _NumericField
):
287 class _BoolFieldConst(_IntegralFieldConst
, _FieldConst
):
288 _NAME
= 'Const boolean'
294 def _value_to_bool(cls
, value
):
295 if isinstance(value
, _BoolFieldConst
):
298 if not isinstance(value
, bool):
300 "'{}' object is not a 'bool', '_BoolFieldConst', or '_BoolField' object".format(
309 return bool(native_bt
.field_bool_get_value(self
._ptr
))
312 class _BoolField(_BoolFieldConst
, _IntegralField
, _Field
):
315 def _set_value(self
, value
):
316 value
= self
._value
_to
_bool
(value
)
317 native_bt
.field_bool_set_value(self
._ptr
, value
)
319 value
= property(fset
=_set_value
)
322 class _IntegerFieldConst(_IntegralFieldConst
, _FieldConst
):
326 class _IntegerField(_IntegerFieldConst
, _IntegralField
, _Field
):
330 class _UnsignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
331 _NAME
= 'Const unsigned integer'
334 def _value_to_int(cls
, value
):
335 if not isinstance(value
, numbers
.Integral
):
336 raise TypeError('expecting an integral number object')
339 utils
._check
_uint
64(value
)
345 return native_bt
.field_integer_unsigned_get_value(self
._ptr
)
348 class _UnsignedIntegerField(_UnsignedIntegerFieldConst
, _IntegerField
, _Field
):
349 _NAME
= 'Unsigned integer'
351 def _set_value(self
, value
):
352 value
= self
._value
_to
_int
(value
)
353 native_bt
.field_integer_unsigned_set_value(self
._ptr
, value
)
355 value
= property(fset
=_set_value
)
358 class _SignedIntegerFieldConst(_IntegerFieldConst
, _FieldConst
):
359 _NAME
= 'Const signed integer'
362 def _value_to_int(cls
, value
):
363 if not isinstance(value
, numbers
.Integral
):
364 raise TypeError('expecting an integral number object')
367 utils
._check
_int
64(value
)
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
)
381 native_bt
.field_integer_signed_set_value(self
._ptr
, value
)
383 value
= property(fset
=_set_value
)
386 class _RealFieldConst(_NumericFieldConst
, numbers
.Real
):
390 def _value_to_float(cls
, value
):
391 if not isinstance(value
, numbers
.Real
):
392 raise TypeError("expecting a real number object")
398 return native_bt
.field_real_get_value(self
._ptr
)
401 class _RealField(_RealFieldConst
, _NumericField
):
404 def _set_value(self
, value
):
405 value
= self
._value
_to
_float
(value
)
406 native_bt
.field_real_set_value(self
._ptr
, value
)
408 value
= property(fset
=_set_value
)
411 class _EnumerationFieldConst(_IntegerFieldConst
):
413 return '{} ({})'.format(self
._value
, ', '.join(self
.labels
))
417 status
, labels
= self
._get
_mapping
_labels
(self
._ptr
)
418 utils
._handle
_func
_status
(status
, "cannot get label for enumeration field")
420 assert labels
is not None
424 class _EnumerationField(_EnumerationFieldConst
, _IntegerField
):
428 class _UnsignedEnumerationFieldConst(
429 _EnumerationFieldConst
, _UnsignedIntegerFieldConst
431 _NAME
= 'Const unsigned Enumeration'
432 _get_mapping_labels
= staticmethod(
433 native_bt
.field_enumeration_unsigned_get_mapping_labels
437 class _UnsignedEnumerationField(
438 _UnsignedEnumerationFieldConst
, _EnumerationField
, _UnsignedIntegerField
440 _NAME
= 'Unsigned enumeration'
443 class _SignedEnumerationFieldConst(_EnumerationFieldConst
, _SignedIntegerFieldConst
):
444 _NAME
= 'Const signed Enumeration'
445 _get_mapping_labels
= staticmethod(
446 native_bt
.field_enumeration_signed_get_mapping_labels
450 class _SignedEnumerationField(
451 _SignedEnumerationFieldConst
, _EnumerationField
, _SignedIntegerField
453 _NAME
= 'Signed enumeration'
456 @functools.total_ordering
457 class _StringFieldConst(_FieldConst
):
458 _NAME
= 'Const string'
461 def _value_to_str(cls
, value
):
462 if isinstance(value
, _StringFieldConst
):
465 if not isinstance(value
, str):
466 raise TypeError("expecting a 'str' object")
472 return native_bt
.field_string_get_value(self
._ptr
)
474 def _spec_eq(self
, other
):
476 return self
._value
== self
._value
_to
_str
(other
)
480 def __lt__(self
, other
):
481 return self
._value
< self
._value
_to
_str
(other
)
484 return bool(self
._value
)
487 return repr(self
._value
)
490 return str(self
._value
)
492 def __getitem__(self
, index
):
493 return self
._value
[index
]
496 return native_bt
.field_string_get_length(self
._ptr
)
499 class _StringField(_StringFieldConst
, _Field
):
502 def _set_value(self
, value
):
503 value
= self
._value
_to
_str
(value
)
504 native_bt
.field_string_set_value(self
._ptr
, value
)
506 value
= property(fset
=_set_value
)
508 def __iadd__(self
, value
):
509 value
= self
._value
_to
_str
(value
)
510 status
= native_bt
.field_string_append(self
._ptr
, value
)
511 utils
._handle
_func
_status
(
512 status
, "cannot append to string field object's value"
517 class _ContainerFieldConst(_FieldConst
):
519 return len(self
) != 0
525 count
= self
._count
()
529 def __delitem__(self
, index
):
530 raise NotImplementedError
532 def __setitem__(self
, index
, value
):
534 '\'{}\' object does not support item assignment'.format(self
.__class
__)
538 class _ContainerField(_ContainerFieldConst
, _Field
):
542 class _StructureFieldConst(_ContainerFieldConst
, collections
.abc
.Mapping
):
543 _NAME
= 'Const structure'
544 _borrow_member_field_ptr_by_index
= staticmethod(
545 native_bt
.field_structure_borrow_member_field_by_index_const
547 _borrow_member_field_ptr_by_name
= staticmethod(
548 native_bt
.field_structure_borrow_member_field_by_name_const
556 return iter(self
.cls
)
558 def _spec_eq(self
, other
):
559 if not isinstance(other
, collections
.abc
.Mapping
):
562 if len(self
) != len(other
):
566 for self_key
in self
:
567 if self_key
not in other
:
570 if self
[self_key
] != other
[self_key
]:
576 items
= ['{}: {}'.format(repr(k
), repr(v
)) for k
, v
in self
.items()]
577 return '{{{}}}'.format(', '.join(items
))
579 def __getitem__(self
, key
):
580 utils
._check
_str
(key
)
581 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_name
(self
._ptr
, key
)
583 if field_ptr
is None:
586 return self
._create
_field
_from
_ptr
(
587 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
590 def member_at_index(self
, index
):
591 utils
._check
_uint
64(index
)
593 if index
>= len(self
):
595 field_ptr
= self
._borrow
_member
_field
_ptr
_by
_index
(self
._ptr
, index
)
596 assert field_ptr
is not None
597 return self
._create
_field
_from
_ptr
(
598 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
602 class _StructureField(
603 _StructureFieldConst
, _ContainerField
, collections
.abc
.MutableMapping
606 _borrow_member_field_ptr_by_index
= staticmethod(
607 native_bt
.field_structure_borrow_member_field_by_index
609 _borrow_member_field_ptr_by_name
= staticmethod(
610 native_bt
.field_structure_borrow_member_field_by_name
613 def __setitem__(self
, key
, value
):
614 # raises if key is somehow invalid
617 # the field's property does the appropriate conversion or raises
618 # the appropriate exception
621 def _set_value(self
, values
):
623 for key
, value
in values
.items():
624 self
[key
].value
= value
628 value
= property(fset
=_set_value
)
631 class _OptionFieldConst(_FieldConst
):
632 _NAME
= 'Const option'
633 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field_const
)
637 field_ptr
= self
._borrow
_field
_ptr
(self
._ptr
)
639 if field_ptr
is None:
642 return self
._create
_field
_from
_ptr
(
643 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
648 return self
.field
is not None
650 def _spec_eq(self
, other
):
651 return _get_leaf_field(self
) == other
654 return self
.has_field
657 return str(self
.field
)
660 return repr(self
.field
)
663 class _OptionField(_OptionFieldConst
, _Field
):
665 _borrow_field_ptr
= staticmethod(native_bt
.field_option_borrow_field
)
667 def _has_field(self
, value
):
668 utils
._check
_bool
(value
)
669 native_bt
.field_option_set_has_field(self
._ptr
, value
)
671 has_field
= property(fget
=_OptionFieldConst
.has_field
.fget
, fset
=_has_field
)
673 def _set_value(self
, value
):
674 self
.has_field
= True
676 assert field
is not None
679 value
= property(fset
=_set_value
)
682 class _VariantFieldConst(_ContainerFieldConst
, _FieldConst
):
683 _NAME
= 'Const variant'
684 _borrow_selected_option_field_ptr
= staticmethod(
685 native_bt
.field_variant_borrow_selected_option_field_const
692 def selected_option_index(self
):
693 return native_bt
.field_variant_get_selected_option_field_index(self
._ptr
)
696 def selected_option(self
):
697 # TODO: Is there a way to check if the variant field has a selected_option,
698 # so we can raise an exception instead of hitting a pre-condition check?
699 # If there is something, that check should be added to selected_option_index too.
700 field_ptr
= self
._borrow
_selected
_option
_field
_ptr
(self
._ptr
)
702 return self
._create
_field
_from
_ptr
(
703 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
706 def _spec_eq(self
, other
):
707 return _get_leaf_field(self
) == other
710 raise NotImplementedError
713 return str(self
.selected_option
)
716 return repr(self
.selected_option
)
719 class _VariantField(_VariantFieldConst
, _ContainerField
, _Field
):
721 _borrow_selected_option_field_ptr
= staticmethod(
722 native_bt
.field_variant_borrow_selected_option_field
725 def _selected_option_index(self
, index
):
726 if index
< 0 or index
>= len(self
):
727 raise IndexError('{} field object index is out of range'.format(self
._NAME
))
729 native_bt
.field_variant_select_option_field_by_index(self
._ptr
, index
)
731 selected_option_index
= property(
732 fget
=_VariantFieldConst
.selected_option_index
.fget
, fset
=_selected_option_index
735 def _set_value(self
, value
):
736 self
.selected_option
.value
= value
738 value
= property(fset
=_set_value
)
741 class _ArrayFieldConst(_ContainerFieldConst
, _FieldConst
, collections
.abc
.Sequence
):
742 _borrow_element_field_ptr_by_index
= staticmethod(
743 native_bt
.field_array_borrow_element_field_by_index_const
746 def _get_length(self
):
747 return native_bt
.field_array_get_length(self
._ptr
)
749 length
= property(fget
=_get_length
)
751 def __getitem__(self
, index
):
752 if not isinstance(index
, numbers
.Integral
):
754 "'{}' is not an integral number object: invalid index".format(
755 index
.__class
__.__name
__
761 if index
< 0 or index
>= len(self
):
762 raise IndexError('{} field object index is out of range'.format(self
._NAME
))
764 field_ptr
= self
._borrow
_element
_field
_ptr
_by
_index
(self
._ptr
, index
)
766 return self
._create
_field
_from
_ptr
(
767 field_ptr
, self
._owner
_ptr
, self
._owner
_get
_ref
, self
._owner
_put
_ref
770 def insert(self
, index
, value
):
771 raise NotImplementedError
773 def _spec_eq(self
, other
):
774 if not isinstance(other
, collections
.abc
.Sequence
):
777 if len(self
) != len(other
):
781 for self_elem
, other_elem
in zip(self
, other
):
782 if self_elem
!= other_elem
:
788 return '[{}]'.format(', '.join([repr(v
) for v
in self
]))
792 _ArrayFieldConst
, _ContainerField
, _Field
, collections
.abc
.MutableSequence
794 _borrow_element_field_ptr_by_index
= staticmethod(
795 native_bt
.field_array_borrow_element_field_by_index
798 def __setitem__(self
, index
, value
):
799 # raises if index is somehow invalid
802 if not isinstance(field
, (_NumericField
, _StringField
)):
803 raise TypeError('can only set the value of a number or string field')
805 # the field's property does the appropriate conversion or raises
806 # the appropriate exception
810 class _StaticArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
811 _NAME
= 'Const static array'
814 return native_bt
.field_array_get_length(self
._ptr
)
817 class _StaticArrayField(_StaticArrayFieldConst
, _ArrayField
, _Field
):
818 _NAME
= 'Static array'
820 def _set_value(self
, values
):
821 if len(self
) != len(values
):
822 raise ValueError('expected length of value and array field to match')
824 for index
, value
in enumerate(values
):
825 if value
is not None:
826 self
[index
].value
= value
828 value
= property(fset
=_set_value
)
831 class _DynamicArrayFieldConst(_ArrayFieldConst
, _FieldConst
):
832 _NAME
= 'Const dynamic array'
838 class _DynamicArrayField(_DynamicArrayFieldConst
, _ArrayField
, _Field
):
839 _NAME
= 'Dynamic array'
841 def _set_length(self
, length
):
842 utils
._check
_uint
64(length
)
843 status
= native_bt
.field_array_dynamic_set_length(self
._ptr
, length
)
844 utils
._handle
_func
_status
(status
, "cannot set dynamic array length")
846 length
= property(fget
=_ArrayField
._get
_length
, fset
=_set_length
)
848 def _set_value(self
, values
):
849 if len(values
) != self
.length
:
850 self
.length
= len(values
)
852 for index
, value
in enumerate(values
):
853 if value
is not None:
854 self
[index
].value
= value
856 value
= property(fset
=_set_value
)
859 _TYPE_ID_TO_CONST_OBJ
= {
860 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolFieldConst
,
861 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayFieldConst
,
862 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerFieldConst
,
863 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerFieldConst
,
864 native_bt
.FIELD_CLASS_TYPE_REAL
: _RealFieldConst
,
865 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationFieldConst
,
866 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationFieldConst
,
867 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringFieldConst
,
868 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureFieldConst
,
869 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayFieldConst
,
870 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY
: _DynamicArrayFieldConst
,
871 native_bt
.FIELD_CLASS_TYPE_OPTION
: _OptionFieldConst
,
872 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR
: _VariantFieldConst
,
873 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR
: _VariantFieldConst
,
874 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR
: _VariantFieldConst
,
878 native_bt
.FIELD_CLASS_TYPE_BOOL
: _BoolField
,
879 native_bt
.FIELD_CLASS_TYPE_BIT_ARRAY
: _BitArrayField
,
880 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_INTEGER
: _UnsignedIntegerField
,
881 native_bt
.FIELD_CLASS_TYPE_SIGNED_INTEGER
: _SignedIntegerField
,
882 native_bt
.FIELD_CLASS_TYPE_REAL
: _RealField
,
883 native_bt
.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION
: _UnsignedEnumerationField
,
884 native_bt
.FIELD_CLASS_TYPE_SIGNED_ENUMERATION
: _SignedEnumerationField
,
885 native_bt
.FIELD_CLASS_TYPE_STRING
: _StringField
,
886 native_bt
.FIELD_CLASS_TYPE_STRUCTURE
: _StructureField
,
887 native_bt
.FIELD_CLASS_TYPE_STATIC_ARRAY
: _StaticArrayField
,
888 native_bt
.FIELD_CLASS_TYPE_DYNAMIC_ARRAY
: _DynamicArrayField
,
889 native_bt
.FIELD_CLASS_TYPE_OPTION
: _OptionField
,
890 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR
: _VariantField
,
891 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_SELECTOR
: _VariantField
,
892 native_bt
.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_SELECTOR
: _VariantField
,