python: standardize intra-bt2 imports
[babeltrace.git] / src / bindings / python / bt2 / bt2 / field_class.py
CommitLineData
0235b0db 1# SPDX-License-Identifier: MIT
81447b5b 2#
811644b8 3# Copyright (c) 2017 Philippe Proulx <pproulx@efficios.com>
81447b5b 4
e5914347
SM
5from bt2 import native_bt
6from bt2 import object as bt2_object
7from bt2 import utils as bt2_utils
81447b5b 8import collections.abc
3fb99a22
PP
9from bt2 import field_path as bt2_field_path
10from bt2 import integer_range_set as bt2_integer_range_set
5783664e 11from bt2 import value as bt2_value
81447b5b
PP
12import bt2
13
14
2bebdd7f 15def _obj_type_from_field_class_ptr_template(type_map, ptr):
3cdfbaea 16 typeid = native_bt.field_class_get_type(ptr)
2bebdd7f
SM
17 return type_map[typeid]
18
19
20def _obj_type_from_field_class_ptr(ptr):
21 return _obj_type_from_field_class_ptr_template(_FIELD_CLASS_TYPE_TO_OBJ, ptr)
22
23
24def _create_field_class_from_ptr_and_get_ref_template(type_map, ptr):
25 return _obj_type_from_field_class_ptr_template(
26 type_map, ptr
27 )._create_from_ptr_and_get_ref(ptr)
f0a42b33
FD
28
29
30def _create_field_class_from_ptr_and_get_ref(ptr):
31 return _create_field_class_from_ptr_and_get_ref_template(
32 _FIELD_CLASS_TYPE_TO_OBJ, ptr
33 )
34
35
36def _create_field_class_from_const_ptr_and_get_ref(ptr):
37 return _create_field_class_from_ptr_and_get_ref_template(
38 _FIELD_CLASS_TYPE_TO_CONST_OBJ, ptr
39 )
81447b5b
PP
40
41
d47b87ac
SM
42class IntegerDisplayBase:
43 BINARY = native_bt.FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_BINARY
44 OCTAL = native_bt.FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_OCTAL
45 DECIMAL = native_bt.FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_DECIMAL
46 HEXADECIMAL = native_bt.FIELD_CLASS_INTEGER_PREFERRED_DISPLAY_BASE_HEXADECIMAL
81447b5b 47
81447b5b 48
e5914347 49class _FieldClassConst(bt2_object._SharedObject):
9dee90bd
SM
50 @staticmethod
51 def _get_ref(ptr):
52 native_bt.field_class_get_ref(ptr)
53
54 @staticmethod
55 def _put_ref(ptr):
56 native_bt.field_class_put_ref(ptr)
57
f0a42b33
FD
58 _borrow_user_attributes_ptr = staticmethod(
59 native_bt.field_class_borrow_user_attributes_const
60 )
61 _create_value_from_ptr_and_get_ref = staticmethod(
62 bt2_value._create_from_const_ptr_and_get_ref
63 )
81447b5b
PP
64
65 def _check_create_status(self, ptr):
66 if ptr is None:
694c792b 67 raise bt2._MemoryError(
f5567ea8 68 "cannot create {} field class object".format(self._NAME.lower())
cfbd7cf3 69 )
81447b5b 70
5783664e
PP
71 @property
72 def user_attributes(self):
f0a42b33 73 ptr = self._borrow_user_attributes_ptr(self._ptr)
5783664e 74 assert ptr is not None
f0a42b33
FD
75 return self._create_value_from_ptr_and_get_ref(ptr)
76
77
78class _FieldClass(_FieldClassConst):
79 _borrow_user_attributes_ptr = staticmethod(
80 native_bt.field_class_borrow_user_attributes
81 )
82 _create_value_from_ptr_and_get_ref = staticmethod(
83 bt2_value._create_from_ptr_and_get_ref
84 )
5783664e
PP
85
86 def _user_attributes(self, user_attributes):
87 value = bt2_value.create_value(user_attributes)
e5914347 88 bt2_utils._check_type(value, bt2_value.MapValue)
5783664e
PP
89 native_bt.field_class_set_user_attributes(self._ptr, value._ptr)
90
91 _user_attributes = property(fset=_user_attributes)
92
81447b5b 93
f0a42b33 94class _BoolFieldClassConst(_FieldClassConst):
f5567ea8 95 _NAME = "Const boolean"
f0a42b33
FD
96
97
98class _BoolFieldClass(_BoolFieldClassConst, _FieldClass):
f5567ea8 99 _NAME = "Boolean"
aae30e61
PP
100
101
f0a42b33 102class _BitArrayFieldClassConst(_FieldClassConst):
f5567ea8 103 _NAME = "Const bit array"
ead8c3d4
PP
104
105 @property
106 def length(self):
107 length = native_bt.field_class_bit_array_get_length(self._ptr)
108 assert length >= 1
109 return length
110
111
f0a42b33 112class _BitArrayFieldClass(_BitArrayFieldClassConst, _FieldClass):
f5567ea8 113 _NAME = "Bit array"
f0a42b33
FD
114
115
116class _IntegerFieldClassConst(_FieldClassConst):
81447b5b 117 @property
d47b87ac
SM
118 def field_value_range(self):
119 size = native_bt.field_class_integer_get_field_value_range(self._ptr)
cfbd7cf3 120 assert size >= 1
81447b5b
PP
121 return size
122
f0a42b33
FD
123 @property
124 def preferred_display_base(self):
125 base = native_bt.field_class_integer_get_preferred_display_base(self._ptr)
126 assert base >= 0
127 return base
128
129
130class _IntegerFieldClass(_FieldClass, _IntegerFieldClassConst):
d47b87ac
SM
131 def _field_value_range(self, size):
132 if size < 1 or size > 64:
133 raise ValueError("Value is outside valid range [1, 64] ({})".format(size))
134 native_bt.field_class_integer_set_field_value_range(self._ptr, size)
81447b5b 135
d47b87ac 136 _field_value_range = property(fset=_field_value_range)
81447b5b 137
d47b87ac 138 def _preferred_display_base(self, base):
e5914347 139 bt2_utils._check_uint64(base)
81447b5b 140
cfbd7cf3
FD
141 if base not in (
142 IntegerDisplayBase.BINARY,
143 IntegerDisplayBase.OCTAL,
144 IntegerDisplayBase.DECIMAL,
145 IntegerDisplayBase.HEXADECIMAL,
146 ):
d47b87ac 147 raise ValueError("Display base is not a valid IntegerDisplayBase value")
81447b5b 148
cfbd7cf3 149 native_bt.field_class_integer_set_preferred_display_base(self._ptr, base)
81447b5b 150
d47b87ac 151 _preferred_display_base = property(fset=_preferred_display_base)
81447b5b
PP
152
153
f0a42b33 154class _UnsignedIntegerFieldClassConst(_IntegerFieldClassConst, _FieldClassConst):
f5567ea8 155 _NAME = "Const unsigned integer"
f0a42b33
FD
156
157
158class _UnsignedIntegerFieldClass(
159 _UnsignedIntegerFieldClassConst, _IntegerFieldClass, _FieldClass
160):
f5567ea8 161 _NAME = "Unsigned integer"
2ae9f48c
SM
162
163
f0a42b33 164class _SignedIntegerFieldClassConst(_IntegerFieldClassConst, _FieldClassConst):
f5567ea8 165 _NAME = "Const signed integer"
f0a42b33
FD
166
167
168class _SignedIntegerFieldClass(
169 _SignedIntegerFieldClassConst, _IntegerFieldClass, _FieldClass
170):
f5567ea8 171 _NAME = "Signed integer"
2ae9f48c 172
af4bbfc7 173
f0a42b33 174class _RealFieldClassConst(_FieldClassConst):
fe4df857 175 pass
81447b5b 176
fe4df857
FD
177
178class _SinglePrecisionRealFieldClassConst(_RealFieldClassConst):
f5567ea8 179 _NAME = "Const single-precision real"
fe4df857
FD
180
181
182class _DoublePrecisionRealFieldClassConst(_RealFieldClassConst):
f5567ea8 183 _NAME = "Const double-precision real"
81447b5b 184
f0a42b33
FD
185
186class _RealFieldClass(_FieldClass, _RealFieldClassConst):
fe4df857
FD
187 pass
188
189
190class _SinglePrecisionRealFieldClass(_RealFieldClass):
f5567ea8 191 _NAME = "Single-precision real"
f0a42b33 192
81447b5b 193
fe4df857 194class _DoublePrecisionRealFieldClass(_RealFieldClass):
f5567ea8 195 _NAME = "Double-precision real"
81447b5b
PP
196
197
45c51519
PP
198# an enumeration field class mapping does not have a reference count, so
199# we copy the properties here to avoid eventual memory access errors.
200class _EnumerationFieldClassMapping:
d47b87ac 201 def __init__(self, mapping_ptr):
45c51519 202 base_mapping_ptr = self._as_enumeration_field_class_mapping_ptr(mapping_ptr)
cfbd7cf3
FD
203 self._label = native_bt.field_class_enumeration_mapping_get_label(
204 base_mapping_ptr
205 )
45c51519
PP
206 assert self._label is not None
207 ranges_ptr = self._mapping_borrow_ranges_ptr(mapping_ptr)
208 assert ranges_ptr is not None
ef9cc185 209 self._ranges = self._range_set_pycls._create_from_ptr_and_get_ref(ranges_ptr)
81447b5b
PP
210
211 @property
d47b87ac 212 def label(self):
45c51519 213 return self._label
81447b5b 214
45c51519
PP
215 @property
216 def ranges(self):
217 return self._ranges
81447b5b 218
81447b5b 219
f0a42b33 220class _UnsignedEnumerationFieldClassMappingConst(_EnumerationFieldClassMapping):
fc866000 221 _range_set_pycls = bt2_integer_range_set._UnsignedIntegerRangeSetConst
cfbd7cf3 222 _as_enumeration_field_class_mapping_ptr = staticmethod(
9c08c816 223 native_bt.field_class_enumeration_unsigned_mapping_as_mapping_const
cfbd7cf3
FD
224 )
225 _mapping_borrow_ranges_ptr = staticmethod(
9c08c816 226 native_bt.field_class_enumeration_unsigned_mapping_borrow_ranges_const
cfbd7cf3 227 )
81447b5b 228
81447b5b 229
f0a42b33 230class _SignedEnumerationFieldClassMappingConst(_EnumerationFieldClassMapping):
fc866000 231 _range_set_pycls = bt2_integer_range_set._SignedIntegerRangeSetConst
cfbd7cf3 232 _as_enumeration_field_class_mapping_ptr = staticmethod(
9c08c816 233 native_bt.field_class_enumeration_signed_mapping_as_mapping_const
cfbd7cf3
FD
234 )
235 _mapping_borrow_ranges_ptr = staticmethod(
9c08c816 236 native_bt.field_class_enumeration_signed_mapping_borrow_ranges_const
cfbd7cf3 237 )
81447b5b 238
81447b5b 239
f0a42b33 240class _EnumerationFieldClassConst(_IntegerFieldClassConst, collections.abc.Mapping):
81447b5b 241 def __len__(self):
b4f45851 242 count = native_bt.field_class_enumeration_get_mapping_count(self._ptr)
45c51519 243 assert count >= 0
81447b5b
PP
244 return count
245
45c51519 246 def mappings_for_value(self, value):
f0a42b33
FD
247 self._check_int_type(value)
248
185ecf64 249 status, labels = self._get_mapping_labels_for_value(self._ptr, value)
e5914347 250 bt2_utils._handle_func_status(
f5567ea8 251 status, "cannot get mapping labels for value {}".format(value)
cfbd7cf3 252 )
45c51519 253 return [self[label] for label in labels]
81447b5b 254
d47b87ac
SM
255 def __iter__(self):
256 for idx in range(len(self)):
f0a42b33
FD
257 mapping_ptr = self._borrow_mapping_ptr_by_index(self._ptr, idx)
258 yield self._mapping_pycls(mapping_ptr).label
81447b5b 259
45c51519 260 def __getitem__(self, label):
e5914347 261 bt2_utils._check_str(label)
f0a42b33 262 mapping_ptr = self._borrow_mapping_ptr_by_label(self._ptr, label)
81447b5b 263
f0a42b33 264 if mapping_ptr is None:
45c51519
PP
265 raise KeyError(label)
266
f0a42b33
FD
267 return self._mapping_pycls(mapping_ptr)
268
269
270class _EnumerationFieldClass(_EnumerationFieldClassConst, _IntegerFieldClass):
271 def add_mapping(self, label, ranges):
e5914347
SM
272 bt2_utils._check_str(label)
273 bt2_utils._check_type(ranges, self._range_set_pycls)
f0a42b33
FD
274
275 if label in self:
276 raise ValueError("duplicate mapping label '{}'".format(label))
277
278 status = self._add_mapping(self._ptr, label, ranges._ptr)
e5914347 279 bt2_utils._handle_func_status(
f5567ea8 280 status, "cannot add mapping to enumeration field class object"
f0a42b33 281 )
81447b5b 282
d47b87ac 283 def __iadd__(self, mappings):
45c51519
PP
284 for label, ranges in mappings:
285 self.add_mapping(label, ranges)
81447b5b 286
d47b87ac 287 return self
81447b5b 288
81447b5b 289
f0a42b33
FD
290class _UnsignedEnumerationFieldClassConst(
291 _EnumerationFieldClassConst, _UnsignedIntegerFieldClassConst
cfbd7cf3 292):
f5567ea8 293 _NAME = "Const unsigned enumeration"
f0a42b33
FD
294 _borrow_mapping_ptr_by_label = staticmethod(
295 native_bt.field_class_enumeration_unsigned_borrow_mapping_by_label_const
296 )
297 _borrow_mapping_ptr_by_index = staticmethod(
298 native_bt.field_class_enumeration_unsigned_borrow_mapping_by_index_const
299 )
300 _mapping_pycls = property(lambda _: _UnsignedEnumerationFieldClassMappingConst)
301 _get_mapping_labels_for_value = staticmethod(
302 native_bt.field_class_enumeration_unsigned_get_mapping_labels_for_value
303 )
e5914347 304 _check_int_type = staticmethod(bt2_utils._check_uint64)
81447b5b 305
45c51519 306
f0a42b33
FD
307class _UnsignedEnumerationFieldClass(
308 _UnsignedEnumerationFieldClassConst,
309 _EnumerationFieldClass,
310 _UnsignedIntegerFieldClass,
311):
f5567ea8 312 _NAME = "Unsigned enumeration"
fc866000 313 _range_set_pycls = bt2_integer_range_set.UnsignedIntegerRangeSet
f0a42b33 314 _add_mapping = staticmethod(native_bt.field_class_enumeration_unsigned_add_mapping)
45c51519 315
81447b5b 316
f0a42b33
FD
317class _SignedEnumerationFieldClassConst(
318 _EnumerationFieldClassConst, _SignedIntegerFieldClassConst
319):
f5567ea8 320 _NAME = "Const signed enumeration"
f0a42b33
FD
321 _borrow_mapping_ptr_by_label = staticmethod(
322 native_bt.field_class_enumeration_signed_borrow_mapping_by_label_const
323 )
324 _borrow_mapping_ptr_by_index = staticmethod(
325 native_bt.field_class_enumeration_signed_borrow_mapping_by_index_const
326 )
327 _mapping_pycls = property(lambda _: _SignedEnumerationFieldClassMappingConst)
328 _get_mapping_labels_for_value = staticmethod(
329 native_bt.field_class_enumeration_signed_get_mapping_labels_for_value
330 )
e5914347 331 _check_int_type = staticmethod(bt2_utils._check_int64)
81447b5b
PP
332
333
f0a42b33
FD
334class _SignedEnumerationFieldClass(
335 _SignedEnumerationFieldClassConst, _EnumerationFieldClass, _SignedIntegerFieldClass
336):
f5567ea8 337 _NAME = "Signed enumeration"
fc866000 338 _range_set_pycls = bt2_integer_range_set.SignedIntegerRangeSet
9c08c816 339 _add_mapping = staticmethod(native_bt.field_class_enumeration_signed_add_mapping)
81447b5b 340
81447b5b 341
f0a42b33 342class _StringFieldClassConst(_FieldClassConst):
f5567ea8 343 _NAME = "Const string"
81447b5b 344
d47b87ac 345
f0a42b33 346class _StringFieldClass(_StringFieldClassConst, _FieldClass):
f5567ea8 347 _NAME = "String"
81447b5b
PP
348
349
f0a42b33
FD
350class _StructureFieldClassMemberConst:
351 _create_field_class_from_ptr_and_get_ref = staticmethod(
352 _create_field_class_from_const_ptr_and_get_ref
353 )
354 _borrow_field_class_ptr = staticmethod(
355 native_bt.field_class_structure_member_borrow_field_class_const
356 )
357 _borrow_user_attributes_ptr = staticmethod(
358 native_bt.field_class_structure_member_borrow_user_attributes_const
359 )
360 _create_value_from_ptr_and_get_ref = staticmethod(
361 bt2_value._create_from_const_ptr_and_get_ref
362 )
363
5783664e
PP
364 def __init__(self, owning_struct_fc, member_ptr):
365 # this field class owns the member; keeping it here maintains
366 # the member alive as members are not shared objects
367 self._owning_struct_fc = owning_struct_fc
368 self._ptr = member_ptr
45c51519
PP
369
370 @property
371 def name(self):
5783664e
PP
372 name = native_bt.field_class_structure_member_get_name(self._ptr)
373 assert name is not None
374 return name
45c51519
PP
375
376 @property
377 def field_class(self):
f0a42b33 378 fc_ptr = self._borrow_field_class_ptr(self._ptr)
5783664e 379 assert fc_ptr is not None
f0a42b33 380 return self._create_field_class_from_ptr_and_get_ref(fc_ptr)
5783664e
PP
381
382 @property
383 def user_attributes(self):
f0a42b33 384 ptr = self._borrow_user_attributes_ptr(self._ptr)
5783664e 385 assert ptr is not None
f0a42b33
FD
386 return self._create_value_from_ptr_and_get_ref(ptr)
387
388
389class _StructureFieldClassMember(_StructureFieldClassMemberConst):
390 _borrow_field_class_ptr = staticmethod(
391 native_bt.field_class_structure_member_borrow_field_class
392 )
393 _borrow_user_attributes_ptr = staticmethod(
394 native_bt.field_class_structure_member_borrow_user_attributes
395 )
396 _create_field_class_from_ptr_and_get_ref = staticmethod(
397 _create_field_class_from_ptr_and_get_ref
398 )
399 _create_value_from_ptr_and_get_ref = staticmethod(
400 bt2_value._create_from_ptr_and_get_ref
401 )
5783664e
PP
402
403 def _user_attributes(self, user_attributes):
404 value = bt2_value.create_value(user_attributes)
e5914347 405 bt2_utils._check_type(value, bt2_value.MapValue)
5783664e
PP
406 native_bt.field_class_structure_member_set_user_attributes(
407 self._ptr, value._ptr
408 )
409
410 _user_attributes = property(fset=_user_attributes)
45c51519
PP
411
412
f0a42b33 413class _StructureFieldClassConst(_FieldClassConst, collections.abc.Mapping):
f5567ea8 414 _NAME = "Const structure"
f0a42b33
FD
415 _borrow_member_ptr_by_index = staticmethod(
416 native_bt.field_class_structure_borrow_member_by_index_const
417 )
418 _borrow_member_ptr_by_name = staticmethod(
419 native_bt.field_class_structure_borrow_member_by_name_const
420 )
421 _structure_member_field_class_pycls = property(
422 lambda _: _StructureFieldClassMemberConst
423 )
424
425 def __len__(self):
426 count = native_bt.field_class_structure_get_member_count(self._ptr)
427 assert count >= 0
428 return count
429
430 def __getitem__(self, key):
431 if not isinstance(key, str):
432 raise TypeError(
433 "key must be a 'str' object, got '{}'".format(key.__class__.__name__)
434 )
435
436 member_ptr = self._borrow_member_ptr_by_name(self._ptr, key)
437
438 if member_ptr is None:
439 raise KeyError(key)
440
441 return self._structure_member_field_class_pycls(self, member_ptr)
442
443 def __iter__(self):
444 for idx in range(len(self)):
445 member_ptr = self._borrow_member_ptr_by_index(self._ptr, idx)
446 assert member_ptr is not None
447 yield native_bt.field_class_structure_member_get_name(member_ptr)
448
449 def member_at_index(self, index):
e5914347 450 bt2_utils._check_uint64(index)
f0a42b33
FD
451
452 if index >= len(self):
453 raise IndexError
454
455 member_ptr = self._borrow_member_ptr_by_index(self._ptr, index)
456 assert member_ptr is not None
457 return self._structure_member_field_class_pycls(self, member_ptr)
458
459
460class _StructureFieldClass(_StructureFieldClassConst, _FieldClass):
f5567ea8 461 _NAME = "Structure"
f0a42b33
FD
462 _borrow_member_by_index = staticmethod(
463 native_bt.field_class_structure_borrow_member_by_index
464 )
465 _borrow_member_ptr_by_name = staticmethod(
466 native_bt.field_class_structure_borrow_member_by_name
467 )
468 _structure_member_field_class_pycls = property(lambda _: _StructureFieldClassMember)
45c51519 469
5783664e 470 def append_member(self, name, field_class, user_attributes=None):
e5914347
SM
471 bt2_utils._check_str(name)
472 bt2_utils._check_type(field_class, _FieldClass)
45c51519
PP
473
474 if name in self:
ce4923b0 475 raise ValueError("duplicate member name '{}'".format(name))
45c51519 476
5783664e
PP
477 user_attributes_value = None
478
479 if user_attributes is not None:
480 # check now that user attributes are valid
481 user_attributes_value = bt2.create_value(user_attributes)
482
cfbd7cf3
FD
483 status = native_bt.field_class_structure_append_member(
484 self._ptr, name, field_class._ptr
485 )
e5914347 486 bt2_utils._handle_func_status(
f5567ea8 487 status, "cannot append member to structure field class object"
cfbd7cf3 488 )
45c51519 489
5783664e
PP
490 if user_attributes is not None:
491 self[name]._user_attributes = user_attributes_value
492
45c51519
PP
493 def __iadd__(self, members):
494 for name, field_class in members:
495 self.append_member(name, field_class)
81447b5b
PP
496
497 return self
498
45c51519 499
f0a42b33 500class _OptionFieldClassConst(_FieldClassConst):
f5567ea8 501 _NAME = "Const option"
f0a42b33
FD
502 _create_field_class_from_ptr_and_get_ref = staticmethod(
503 _create_field_class_from_const_ptr_and_get_ref
504 )
505 _borrow_field_class_ptr = staticmethod(
506 native_bt.field_class_option_borrow_field_class_const
507 )
81447b5b 508
cec0261d
PP
509 @property
510 def field_class(self):
f0a42b33
FD
511 elem_fc_ptr = self._borrow_field_class_ptr(self._ptr)
512 return self._create_field_class_from_ptr_and_get_ref(elem_fc_ptr)
cec0261d 513
0aa006b7
PP
514
515class _OptionWithSelectorFieldClassConst(_OptionFieldClassConst):
f5567ea8 516 _NAME = "Const option (with selector)"
0aa006b7 517
cec0261d
PP
518 @property
519 def selector_field_path(self):
de821fe5 520 ptr = native_bt.field_class_option_with_selector_field_borrow_selector_field_path_const(
0aa006b7
PP
521 self._ptr
522 )
cec0261d
PP
523 if ptr is None:
524 return
525
5679964c 526 return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
cec0261d
PP
527
528
0aa006b7 529class _OptionWithBoolSelectorFieldClassConst(_OptionWithSelectorFieldClassConst):
f5567ea8 530 _NAME = "Const option (with boolean selector)"
0aa006b7
PP
531
532 @property
533 def selector_is_reversed(self):
534 return bool(
de821fe5 535 native_bt.field_class_option_with_selector_field_bool_selector_is_reversed(
0aa006b7
PP
536 self._ptr
537 )
538 )
539
540
541class _OptionWithIntegerSelectorFieldClassConst(_OptionWithSelectorFieldClassConst):
f5567ea8 542 _NAME = "Const option (with integer selector)"
0aa006b7
PP
543
544 @property
545 def ranges(self):
546 range_set_ptr = self._borrow_selector_ranges_ptr(self._ptr)
547 assert range_set_ptr is not None
548 return self._range_set_pycls._create_from_ptr_and_get_ref(range_set_ptr)
549
550
551class _OptionWithUnsignedIntegerSelectorFieldClassConst(
552 _OptionWithIntegerSelectorFieldClassConst
553):
f5567ea8 554 _NAME = "Const option (with unsigned integer selector)"
0aa006b7
PP
555 _range_set_pycls = bt2_integer_range_set._UnsignedIntegerRangeSetConst
556 _borrow_selector_ranges_ptr = staticmethod(
de821fe5 557 native_bt.field_class_option_with_selector_field_integer_unsigned_borrow_selector_ranges_const
0aa006b7
PP
558 )
559
560
561class _OptionWithSignedIntegerSelectorFieldClassConst(
562 _OptionWithIntegerSelectorFieldClassConst
563):
f5567ea8 564 _NAME = "Const option (with signed integer selector)"
0aa006b7
PP
565 _range_set_pycls = bt2_integer_range_set._SignedIntegerRangeSetConst
566 _borrow_selector_ranges_ptr = staticmethod(
de821fe5 567 native_bt.field_class_option_with_selector_field_integer_signed_borrow_selector_ranges_const
0aa006b7
PP
568 )
569
570
f0a42b33 571class _OptionFieldClass(_OptionFieldClassConst, _FieldClass):
f5567ea8 572 _NAME = "Option"
f0a42b33
FD
573 _borrow_field_class_ptr = staticmethod(
574 native_bt.field_class_option_borrow_field_class
575 )
576 _create_field_class_from_ptr_and_get_ref = staticmethod(
577 _create_field_class_from_ptr_and_get_ref
578 )
579
580
0aa006b7
PP
581class _OptionWithSelectorFieldClass(
582 _OptionWithSelectorFieldClassConst, _OptionFieldClass
583):
f5567ea8 584 _NAME = "Option (with selector)"
0aa006b7
PP
585
586
587class _OptionWithBoolSelectorFieldClass(
588 _OptionWithBoolSelectorFieldClassConst, _OptionWithSelectorFieldClass
589):
f5567ea8 590 _NAME = "Option (with boolean selector)"
0aa006b7
PP
591
592 def _selector_is_reversed(self, selector_is_reversed):
e5914347 593 bt2_utils._check_bool(selector_is_reversed)
de821fe5 594 native_bt.field_class_option_with_selector_field_bool_set_selector_is_reversed(
0aa006b7
PP
595 self._ptr, selector_is_reversed
596 )
597
598 _selector_is_reversed = property(fset=_selector_is_reversed)
599
600
601class _OptionWithIntegerSelectorFieldClass(
602 _OptionWithIntegerSelectorFieldClassConst, _OptionWithSelectorFieldClass
603):
f5567ea8 604 _NAME = "Option (with integer selector)"
0aa006b7
PP
605
606
607class _OptionWithUnsignedIntegerSelectorFieldClass(
608 _OptionWithUnsignedIntegerSelectorFieldClassConst,
609 _OptionWithIntegerSelectorFieldClass,
610):
f5567ea8 611 _NAME = "Option (with unsigned integer selector)"
0aa006b7
PP
612
613
614class _OptionWithSignedIntegerSelectorFieldClass(
615 _OptionWithSignedIntegerSelectorFieldClassConst,
616 _OptionWithIntegerSelectorFieldClass,
617):
f5567ea8 618 _NAME = "Option (with signed integer selector)"
0aa006b7
PP
619
620
f0a42b33
FD
621class _VariantFieldClassOptionConst:
622 _create_field_class_from_ptr_and_get_ref = staticmethod(
623 _create_field_class_from_const_ptr_and_get_ref
624 )
625 _borrow_field_class_ptr = staticmethod(
626 native_bt.field_class_variant_option_borrow_field_class_const
627 )
628 _borrow_user_attributes_ptr = staticmethod(
629 native_bt.field_class_variant_option_borrow_user_attributes_const
630 )
631 _create_value_from_ptr_and_get_ref = staticmethod(
632 bt2_value._create_from_const_ptr_and_get_ref
633 )
634
5783664e
PP
635 def __init__(self, owning_var_fc, option_ptr):
636 # this field class owns the option; keeping it here maintains
637 # the option alive as options are not shared objects
638 self._owning_var_fc = owning_var_fc
639 self._ptr = option_ptr
81447b5b 640
45c51519
PP
641 @property
642 def name(self):
5783664e
PP
643 name = native_bt.field_class_variant_option_get_name(self._ptr)
644 assert name is not None
645 return name
81447b5b 646
45c51519
PP
647 @property
648 def field_class(self):
f0a42b33 649 fc_ptr = self._borrow_field_class_ptr(self._ptr)
5783664e 650 assert fc_ptr is not None
f0a42b33 651 return self._create_field_class_from_ptr_and_get_ref(fc_ptr)
81447b5b 652
5783664e
PP
653 @property
654 def user_attributes(self):
f0a42b33 655 ptr = self._borrow_user_attributes_ptr(self._ptr)
5783664e 656 assert ptr is not None
f0a42b33
FD
657 return self._create_value_from_ptr_and_get_ref(ptr)
658
659
660class _VariantFieldClassOption(_VariantFieldClassOptionConst):
661 _create_field_class_from_ptr_and_get_ref = staticmethod(
662 _create_field_class_from_ptr_and_get_ref
663 )
664 _borrow_field_class_ptr = staticmethod(
665 native_bt.field_class_variant_option_borrow_field_class
666 )
667 _borrow_user_attributes_ptr = staticmethod(
70a79f65 668 native_bt.field_class_variant_option_borrow_user_attributes
f0a42b33
FD
669 )
670 _create_value_from_ptr_and_get_ref = staticmethod(
671 bt2_value._create_from_ptr_and_get_ref
672 )
81447b5b 673
5783664e
PP
674 def _user_attributes(self, user_attributes):
675 value = bt2_value.create_value(user_attributes)
e5914347 676 bt2_utils._check_type(value, bt2_value.MapValue)
5783664e 677 native_bt.field_class_variant_option_set_user_attributes(self._ptr, value._ptr)
81447b5b 678
5783664e 679 _user_attributes = property(fset=_user_attributes)
81447b5b
PP
680
681
fabfe034 682class _VariantFieldClassWithIntegerSelectorOptionConst(_VariantFieldClassOptionConst):
f0a42b33
FD
683 def __init__(self, owning_var_fc, spec_opt_ptr):
684 self._spec_ptr = spec_opt_ptr
685 super().__init__(owning_var_fc, self._as_option_ptr(spec_opt_ptr))
686
687 @property
688 def ranges(self):
689 range_set_ptr = self._borrow_ranges_ptr(self._spec_ptr)
690 assert range_set_ptr is not None
ef9cc185 691 return self._range_set_pycls._create_from_ptr_and_get_ref(range_set_ptr)
f0a42b33
FD
692
693
fabfe034
PP
694class _VariantFieldClassWithIntegerSelectorOption(
695 _VariantFieldClassWithIntegerSelectorOptionConst, _VariantFieldClassOption
f0a42b33
FD
696):
697 pass
698
699
fabfe034
PP
700class _VariantFieldClassWithSignedIntegerSelectorOptionConst(
701 _VariantFieldClassWithIntegerSelectorOptionConst
f0a42b33
FD
702):
703 _as_option_ptr = staticmethod(
de821fe5 704 native_bt.field_class_variant_with_selector_field_integer_signed_option_as_option_const
f0a42b33
FD
705 )
706 _borrow_ranges_ptr = staticmethod(
de821fe5 707 native_bt.field_class_variant_with_selector_field_integer_signed_option_borrow_ranges_const
f0a42b33 708 )
fc866000 709 _range_set_pycls = bt2_integer_range_set._SignedIntegerRangeSetConst
f0a42b33
FD
710
711
fabfe034
PP
712class _VariantFieldClassWithSignedIntegerSelectorOption(
713 _VariantFieldClassWithSignedIntegerSelectorOptionConst,
714 _VariantFieldClassWithIntegerSelectorOption,
f0a42b33
FD
715):
716 pass
717
718
fabfe034
PP
719class _VariantFieldClassWithUnsignedIntegerSelectorOptionConst(
720 _VariantFieldClassWithIntegerSelectorOptionConst
f0a42b33
FD
721):
722 _as_option_ptr = staticmethod(
de821fe5 723 native_bt.field_class_variant_with_selector_field_integer_unsigned_option_as_option_const
f0a42b33
FD
724 )
725 _borrow_ranges_ptr = staticmethod(
de821fe5 726 native_bt.field_class_variant_with_selector_field_integer_unsigned_option_borrow_ranges_const
f0a42b33 727 )
fc866000 728 _range_set_pycls = bt2_integer_range_set._UnsignedIntegerRangeSetConst
f0a42b33
FD
729
730
fabfe034
PP
731class _VariantFieldClassWithUnsignedIntegerSelectorOption(
732 _VariantFieldClassWithUnsignedIntegerSelectorOptionConst,
733 _VariantFieldClassWithIntegerSelectorOption,
f0a42b33
FD
734):
735 pass
736
737
738class _VariantFieldClassConst(_FieldClassConst, collections.abc.Mapping):
f5567ea8 739 _NAME = "Const variant"
f0a42b33 740 _borrow_option_ptr_by_name = staticmethod(
cfbd7cf3
FD
741 native_bt.field_class_variant_borrow_option_by_name_const
742 )
f0a42b33 743 _borrow_option_ptr_by_index = staticmethod(
cfbd7cf3
FD
744 native_bt.field_class_variant_borrow_option_by_index_const
745 )
f0a42b33 746 _variant_option_pycls = _VariantFieldClassOptionConst
811644b8 747
45c51519
PP
748 @staticmethod
749 def _as_option_ptr(opt_ptr):
750 return opt_ptr
751
752 def _create_option_from_ptr(self, opt_ptr):
f0a42b33 753 return self._variant_option_pycls(self, opt_ptr)
45c51519
PP
754
755 def __len__(self):
756 count = native_bt.field_class_variant_get_option_count(self._ptr)
757 assert count >= 0
758 return count
759
760 def __getitem__(self, key):
761 if not isinstance(key, str):
cfbd7cf3
FD
762 raise TypeError(
763 "key must be a 'str' object, got '{}'".format(key.__class__.__name__)
764 )
45c51519 765
f0a42b33 766 opt_ptr = self._borrow_option_ptr_by_name(self._ptr, key)
45c51519
PP
767
768 if opt_ptr is None:
769 raise KeyError(key)
770
771 return self._create_option_from_ptr(opt_ptr)
772
773 def __iter__(self):
774 for idx in range(len(self)):
f0a42b33 775 opt_ptr = self._borrow_option_ptr_by_index(self._ptr, idx)
45c51519
PP
776 assert opt_ptr is not None
777 base_opt_ptr = self._as_option_ptr(opt_ptr)
778 yield native_bt.field_class_variant_option_get_name(base_opt_ptr)
811644b8 779
d47b87ac 780 def option_at_index(self, index):
e5914347 781 bt2_utils._check_uint64(index)
45c51519
PP
782
783 if index >= len(self):
784 raise IndexError
785
f0a42b33 786 opt_ptr = self._borrow_option_ptr_by_index(self._ptr, index)
45c51519
PP
787 assert opt_ptr is not None
788 return self._create_option_from_ptr(opt_ptr)
789
790
f0a42b33 791class _VariantFieldClass(_VariantFieldClassConst, _FieldClass, collections.abc.Mapping):
f5567ea8 792 _NAME = "Variant"
f0a42b33
FD
793 _borrow_option_ptr_by_name = staticmethod(
794 native_bt.field_class_variant_borrow_option_by_name
795 )
796 _borrow_option_ptr_by_index = staticmethod(
797 native_bt.field_class_variant_borrow_option_by_index
798 )
799 _variant_option_pycls = _VariantFieldClassOption
800
801
802class _VariantFieldClassWithoutSelectorConst(_VariantFieldClassConst):
f5567ea8 803 _NAME = "Const variant (without selector)"
f0a42b33
FD
804
805
806class _VariantFieldClassWithoutSelector(
807 _VariantFieldClassWithoutSelectorConst, _VariantFieldClass
808):
f5567ea8 809 _NAME = "Variant (without selector)"
45c51519 810
5783664e 811 def append_option(self, name, field_class, user_attributes=None):
e5914347
SM
812 bt2_utils._check_str(name)
813 bt2_utils._check_type(field_class, _FieldClass)
45c51519
PP
814
815 if name in self:
ce4923b0 816 raise ValueError("duplicate option name '{}'".format(name))
45c51519 817
5783664e
PP
818 user_attributes_value = None
819
820 if user_attributes is not None:
821 # check now that user attributes are valid
822 user_attributes_value = bt2.create_value(user_attributes)
823
cfbd7cf3
FD
824 status = native_bt.field_class_variant_without_selector_append_option(
825 self._ptr, name, field_class._ptr
826 )
e5914347 827 bt2_utils._handle_func_status(
f5567ea8 828 status, "cannot append option to variant field class object"
cfbd7cf3 829 )
45c51519 830
5783664e
PP
831 if user_attributes is not None:
832 self[name]._user_attributes = user_attributes_value
833
45c51519
PP
834 def __iadd__(self, options):
835 for name, field_class in options:
836 self.append_option(name, field_class)
837
838 return self
839
840
fabfe034 841class _VariantFieldClassWithIntegerSelectorConst(_VariantFieldClassConst):
f5567ea8 842 _NAME = "Const variant (with selector)"
81447b5b
PP
843
844 @property
d47b87ac 845 def selector_field_path(self):
de821fe5 846 ptr = native_bt.field_class_variant_with_selector_field_borrow_selector_field_path_const(
cfbd7cf3
FD
847 self._ptr
848 )
45c51519 849
d47b87ac 850 if ptr is None:
811644b8
PP
851 return
852
5679964c 853 return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
81447b5b 854
f0a42b33 855
fabfe034
PP
856class _VariantFieldClassWithIntegerSelector(
857 _VariantFieldClassWithIntegerSelectorConst, _VariantFieldClass
f0a42b33 858):
f5567ea8 859 _NAME = "Variant (with selector)"
f0a42b33 860
5783664e 861 def append_option(self, name, field_class, ranges, user_attributes=None):
e5914347
SM
862 bt2_utils._check_str(name)
863 bt2_utils._check_type(field_class, _FieldClass)
864 bt2_utils._check_type(ranges, self._variant_option_pycls._range_set_pycls)
45c51519
PP
865
866 if name in self:
ce4923b0 867 raise ValueError("duplicate option name '{}'".format(name))
45c51519
PP
868
869 if len(ranges) == 0:
f5567ea8 870 raise ValueError("range set is empty")
45c51519 871
5783664e
PP
872 user_attributes_value = None
873
874 if user_attributes is not None:
875 # check now that user attributes are valid
876 user_attributes_value = bt2.create_value(user_attributes)
877
45c51519
PP
878 # TODO: check overlaps (precondition of self._append_option())
879
880 status = self._append_option(self._ptr, name, field_class._ptr, ranges._ptr)
e5914347 881 bt2_utils._handle_func_status(
f5567ea8 882 status, "cannot append option to variant field class object"
cfbd7cf3 883 )
45c51519 884
5783664e
PP
885 if user_attributes is not None:
886 self[name]._user_attributes = user_attributes_value
887
45c51519
PP
888 def __iadd__(self, options):
889 for name, field_class, ranges in options:
890 self.append_option(name, field_class, ranges)
891
892 return self
893
894
fabfe034
PP
895class _VariantFieldClassWithUnsignedIntegerSelectorConst(
896 _VariantFieldClassWithIntegerSelectorConst
897):
f5567ea8 898 _NAME = "Const variant (with unsigned integer selector)"
f0a42b33 899 _borrow_option_ptr_by_name = staticmethod(
de821fe5 900 native_bt.field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_name_const
cfbd7cf3 901 )
f0a42b33 902 _borrow_option_ptr_by_index = staticmethod(
de821fe5 903 native_bt.field_class_variant_with_selector_field_integer_unsigned_borrow_option_by_index_const
cfbd7cf3 904 )
fabfe034 905 _variant_option_pycls = _VariantFieldClassWithUnsignedIntegerSelectorOptionConst
f0a42b33 906 _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
45c51519 907
81447b5b 908
fabfe034
PP
909class _VariantFieldClassWithUnsignedIntegerSelector(
910 _VariantFieldClassWithUnsignedIntegerSelectorConst,
911 _VariantFieldClassWithIntegerSelector,
f0a42b33 912):
f5567ea8 913 _NAME = "Variant (with unsigned integer selector)"
fabfe034 914 _variant_option_pycls = _VariantFieldClassWithUnsignedIntegerSelectorOption
f0a42b33 915 _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
8863ba6f 916 _append_option = staticmethod(
de821fe5 917 native_bt.field_class_variant_with_selector_field_integer_unsigned_append_option
8863ba6f 918 )
f0a42b33
FD
919
920
fabfe034
PP
921class _VariantFieldClassWithSignedIntegerSelectorConst(
922 _VariantFieldClassWithIntegerSelectorConst
923):
f5567ea8 924 _NAME = "Const variant (with signed integer selector)"
f0a42b33 925 _borrow_option_ptr_by_name = staticmethod(
de821fe5 926 native_bt.field_class_variant_with_selector_field_integer_signed_borrow_option_by_name_const
cfbd7cf3 927 )
f0a42b33 928 _borrow_option_ptr_by_index = staticmethod(
de821fe5 929 native_bt.field_class_variant_with_selector_field_integer_signed_borrow_option_by_index_const
cfbd7cf3 930 )
fabfe034 931 _variant_option_pycls = _VariantFieldClassWithSignedIntegerSelectorOptionConst
f0a42b33
FD
932 _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
933
934
fabfe034
PP
935class _VariantFieldClassWithSignedIntegerSelector(
936 _VariantFieldClassWithSignedIntegerSelectorConst,
937 _VariantFieldClassWithIntegerSelector,
f0a42b33 938):
f5567ea8 939 _NAME = "Variant (with signed integer selector)"
fabfe034 940 _variant_option_pycls = _VariantFieldClassWithSignedIntegerSelectorOption
f0a42b33 941 _as_option_ptr = staticmethod(_variant_option_pycls._as_option_ptr)
8863ba6f 942 _append_option = staticmethod(
de821fe5 943 native_bt.field_class_variant_with_selector_field_integer_signed_append_option
8863ba6f 944 )
811644b8 945
81447b5b 946
f0a42b33
FD
947class _ArrayFieldClassConst(_FieldClassConst):
948 _create_field_class_from_ptr_and_get_ref = staticmethod(
949 _create_field_class_from_const_ptr_and_get_ref
950 )
951 _borrow_element_field_class = staticmethod(
952 native_bt.field_class_array_borrow_element_field_class_const
953 )
954
d47b87ac
SM
955 @property
956 def element_field_class(self):
f0a42b33
FD
957 elem_fc_ptr = self._borrow_element_field_class(self._ptr)
958 return self._create_field_class_from_ptr_and_get_ref(elem_fc_ptr)
959
960
961class _ArrayFieldClass(_ArrayFieldClassConst, _FieldClass):
962 _create_field_class_from_ptr_and_get_ref = staticmethod(
963 _create_field_class_from_ptr_and_get_ref
964 )
965 _borrow_element_field_class = staticmethod(
966 native_bt.field_class_array_borrow_element_field_class
967 )
81447b5b 968
81447b5b 969
f0a42b33 970class _StaticArrayFieldClassConst(_ArrayFieldClassConst):
f5567ea8 971 _NAME = "Const static array"
f0a42b33 972
81447b5b
PP
973 @property
974 def length(self):
9c08c816 975 return native_bt.field_class_array_static_get_length(self._ptr)
81447b5b
PP
976
977
f0a42b33 978class _StaticArrayFieldClass(_StaticArrayFieldClassConst, _ArrayFieldClass):
f5567ea8 979 _NAME = "Static array"
f0a42b33
FD
980
981
982class _DynamicArrayFieldClassConst(_ArrayFieldClassConst):
f5567ea8 983 _NAME = "Const dynamic array"
f0a42b33 984
81b8fa44
PP
985
986class _DynamicArrayWithLengthFieldFieldClassConst(_DynamicArrayFieldClassConst):
f5567ea8 987 _NAME = "Const dynamic array (with length field)"
81b8fa44 988
d47b87ac
SM
989 @property
990 def length_field_path(self):
81b8fa44 991 ptr = native_bt.field_class_array_dynamic_with_length_field_borrow_length_field_path_const(
cfbd7cf3
FD
992 self._ptr
993 )
d47b87ac
SM
994 if ptr is None:
995 return
81447b5b 996
5679964c 997 return bt2_field_path._FieldPathConst._create_from_ptr_and_get_ref(ptr)
81447b5b 998
81447b5b 999
f0a42b33 1000class _DynamicArrayFieldClass(_DynamicArrayFieldClassConst, _ArrayFieldClass):
f5567ea8 1001 _NAME = "Dynamic array"
f0a42b33
FD
1002
1003
81b8fa44
PP
1004class _DynamicArrayWithLengthFieldFieldClass(
1005 _DynamicArrayWithLengthFieldFieldClassConst, _DynamicArrayFieldClass
1006):
f5567ea8 1007 _NAME = "Dynamic array (with length field)"
81b8fa44
PP
1008
1009
f0a42b33
FD
1010_FIELD_CLASS_TYPE_TO_CONST_OBJ = {
1011 native_bt.FIELD_CLASS_TYPE_BOOL: _BoolFieldClassConst,
1012 native_bt.FIELD_CLASS_TYPE_BIT_ARRAY: _BitArrayFieldClassConst,
1013 native_bt.FIELD_CLASS_TYPE_UNSIGNED_INTEGER: _UnsignedIntegerFieldClassConst,
1014 native_bt.FIELD_CLASS_TYPE_SIGNED_INTEGER: _SignedIntegerFieldClassConst,
fe4df857
FD
1015 native_bt.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL: _SinglePrecisionRealFieldClassConst,
1016 native_bt.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL: _DoublePrecisionRealFieldClassConst,
f0a42b33
FD
1017 native_bt.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: _UnsignedEnumerationFieldClassConst,
1018 native_bt.FIELD_CLASS_TYPE_SIGNED_ENUMERATION: _SignedEnumerationFieldClassConst,
1019 native_bt.FIELD_CLASS_TYPE_STRING: _StringFieldClassConst,
1020 native_bt.FIELD_CLASS_TYPE_STRUCTURE: _StructureFieldClassConst,
1021 native_bt.FIELD_CLASS_TYPE_STATIC_ARRAY: _StaticArrayFieldClassConst,
81b8fa44
PP
1022 native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD: _DynamicArrayFieldClassConst,
1023 native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD: _DynamicArrayWithLengthFieldFieldClassConst,
de821fe5
PP
1024 native_bt.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD: _OptionFieldClassConst,
1025 native_bt.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD: _OptionWithBoolSelectorFieldClassConst,
1026 native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _OptionWithUnsignedIntegerSelectorFieldClassConst,
1027 native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _OptionWithSignedIntegerSelectorFieldClassConst,
1028 native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD: _VariantFieldClassWithoutSelectorConst,
1029 native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithUnsignedIntegerSelectorConst,
1030 native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithSignedIntegerSelectorConst,
f0a42b33
FD
1031}
1032
3cdfbaea 1033_FIELD_CLASS_TYPE_TO_OBJ = {
aae30e61 1034 native_bt.FIELD_CLASS_TYPE_BOOL: _BoolFieldClass,
ead8c3d4 1035 native_bt.FIELD_CLASS_TYPE_BIT_ARRAY: _BitArrayFieldClass,
d47b87ac
SM
1036 native_bt.FIELD_CLASS_TYPE_UNSIGNED_INTEGER: _UnsignedIntegerFieldClass,
1037 native_bt.FIELD_CLASS_TYPE_SIGNED_INTEGER: _SignedIntegerFieldClass,
fe4df857
FD
1038 native_bt.FIELD_CLASS_TYPE_SINGLE_PRECISION_REAL: _SinglePrecisionRealFieldClass,
1039 native_bt.FIELD_CLASS_TYPE_DOUBLE_PRECISION_REAL: _DoublePrecisionRealFieldClass,
d47b87ac
SM
1040 native_bt.FIELD_CLASS_TYPE_UNSIGNED_ENUMERATION: _UnsignedEnumerationFieldClass,
1041 native_bt.FIELD_CLASS_TYPE_SIGNED_ENUMERATION: _SignedEnumerationFieldClass,
1042 native_bt.FIELD_CLASS_TYPE_STRING: _StringFieldClass,
3cdfbaea 1043 native_bt.FIELD_CLASS_TYPE_STRUCTURE: _StructureFieldClass,
d47b87ac 1044 native_bt.FIELD_CLASS_TYPE_STATIC_ARRAY: _StaticArrayFieldClass,
81b8fa44
PP
1045 native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITHOUT_LENGTH_FIELD: _DynamicArrayFieldClass,
1046 native_bt.FIELD_CLASS_TYPE_DYNAMIC_ARRAY_WITH_LENGTH_FIELD: _DynamicArrayWithLengthFieldFieldClass,
de821fe5
PP
1047 native_bt.FIELD_CLASS_TYPE_OPTION_WITHOUT_SELECTOR_FIELD: _OptionFieldClass,
1048 native_bt.FIELD_CLASS_TYPE_OPTION_WITH_BOOL_SELECTOR_FIELD: _OptionWithBoolSelectorFieldClass,
1049 native_bt.FIELD_CLASS_TYPE_OPTION_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _OptionWithUnsignedIntegerSelectorFieldClass,
1050 native_bt.FIELD_CLASS_TYPE_OPTION_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _OptionWithSignedIntegerSelectorFieldClass,
1051 native_bt.FIELD_CLASS_TYPE_VARIANT_WITHOUT_SELECTOR_FIELD: _VariantFieldClassWithoutSelector,
1052 native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_UNSIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithUnsignedIntegerSelector,
1053 native_bt.FIELD_CLASS_TYPE_VARIANT_WITH_SIGNED_INTEGER_SELECTOR_FIELD: _VariantFieldClassWithSignedIntegerSelector,
81447b5b 1054}
This page took 0.1338 seconds and 4 git commands to generate.