+ """Return the name of a FieldDeclaration or None on error."""
+ return self._name
+
+ @property
+ def type(self):
+ """
+ Return the FieldDeclaration's type. One of the entries in class
+ CTFTypeId.
+ """
+ return _bt_ctf_field_type(self._fd)
+
+ @property
+ def scope(self):
+ """
+ Return the FieldDeclaration's scope.
+ """
+ return self._s
+
+class IntegerFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("IntegerFieldDeclaration cannot be instantiated")
+
+ @property
+ def signedness(self):
+ """
+ Return the signedness of an integer:
+ 0 if unsigned; 1 if signed; -1 on error.
+ """
+ return _bt_ctf_get_int_signedness(self._fd)
+
+ @property
+ def base(self):
+ """Return the base of an int or a negative value on error."""
+ return _bt_ctf_get_int_base(self._fd)
+
+ @property
+ def byte_order(self):
+ """
+ Return the byte order. One of class ByteOrder's entries.
+ """
+ ret = _bt_ctf_get_int_byte_order(self._fd)
+ if ret == 1234:
+ return ByteOrder.BYTE_ORDER_LITTLE_ENDIAN
+ elif ret == 4321:
+ return ByteOrder.BYTE_ORDER_BIG_ENDIAN
+ else:
+ return ByteOrder.BYTE_ORDER_UNKNOWN
+
+ @property
+ def length(self):
+ """
+ Return the size, in bits, of an int or a negative
+ value on error.
+ """
+ return _bt_ctf_get_int_len(self._fd)
+
+ @property
+ def encoding(self):
+ """
+ Return the encoding. One of class CTFStringEncoding's entries.
+ Return a negative value on error.
+ """
+ return _bt_ctf_get_encoding(self._fd)
+
+class EnumerationFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("EnumerationFieldDeclaration cannot be instantiated")
+
+class ArrayFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("ArrayFieldDeclaration cannot be instantiated")
+
+ @property
+ def length(self):
+ """
+ Return the length of an array or a negative
+ value on error.
+ """
+ return _bt_ctf_get_array_len(self._fd)
+
+ @property
+ def element_declaration(self):
+ """
+ Return element declaration.
+ """
+ field_decl_ptr = _bt_python_get_array_element_declaration(self._fd)
+ return _create_field_declaration(field_decl_ptr, "", self.scope)
+
+class SequenceFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("SequenceFieldDeclaration cannot be instantiated")
+
+ @property
+ def element_declaration(self):
+ """
+ Return element declaration.
+ """
+ field_decl_ptr = _bt_python_get_sequence_element_declaration(self._fd)
+ return _create_field_declaration(field_decl_ptr, "", self.scope)
+
+class FloatFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("FloatFieldDeclaration cannot be instantiated")
+
+class StructureFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("StructureFieldDeclaration cannot be instantiated")
+
+class StringFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("StringFieldDeclaration cannot be instantiated")
+
+class VariantFieldDeclaration(FieldDeclaration):
+ """Do not instantiate."""
+ def __init__(self):
+ raise NotImplementedError("VariantFieldDeclaration cannot be instantiated")