+ def get_value(self):
+ """
+ Return the value associated with the field according to its type.
+ Return None on error.
+ """
+ id = self.field_type()
+ if id == ctf.type_id.STRING:
+ return self.get_str()
+ if id == ctf.type_id.ARRAY:
+ array = []
+ for i in range(self.get_array_len()):
+ element = self.get_array_element_at(i)
+ array.append(element.get_value())
+ return array
+ if id == ctf.type_id.INTEGER:
+ if self.get_int_signedness() == 0:
+ return self.get_uint64()
+ else:
+ return self.get_int64()
+ if id == ctf.type_id.ENUM:
+ return self.get_enum_str()
+ return None
+