From: Philippe Proulx Date: Tue, 16 Dec 2014 23:08:46 +0000 (-0500) Subject: Python: document writer.SequenceFieldDeclaration X-Git-Tag: v2.0.0-pre1~1365 X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=28ada968f7aa10ea7b040584a37dd702b8b11299;p=babeltrace.git Python: document writer.SequenceFieldDeclaration Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/bindings/python/writer.py b/bindings/python/writer.py index 65822fa4..e24631d4 100644 --- a/bindings/python/writer.py +++ b/bindings/python/writer.py @@ -1011,9 +1011,19 @@ class ArrayFieldDeclaration(FieldDeclaration): class SequenceFieldDeclaration(FieldDeclaration): + """ + Sequence (dynamic array) field declaration. + """ + def __init__(self, element_type, length_field_name): """ - Create a new sequence field declaration. + Creates a sequence field declaration of + elements of type *element_type* (:class:`FieldDeclaration`). + The length of a sequence field based on this sequence field + declaration is obtained by retrieving the dynamic integer + value of the field named *length_field_name*. + + :exc:`ValueError` is raised on error. """ self._ft = nbt._bt_ctf_field_type_sequence_create(element_type._ft, @@ -1023,7 +1033,10 @@ class SequenceFieldDeclaration(FieldDeclaration): @property def element_type(self): """ - Get the sequence's element type. + Type of the elements of this sequence (subclass of + :class:`FieldDeclaration`). + + :exc:`TypeError` is raised on error. """ ret = nbt._bt_ctf_field_type_sequence_get_element_type(self._ft) @@ -1036,7 +1049,10 @@ class SequenceFieldDeclaration(FieldDeclaration): @property def length_field_name(self): """ - Get the sequence's length field name. + Name of the integer field defining the dynamic length of + sequence fields based on this sequence field declaration. + + :exc:`TypeError` is raised on error. """ ret = nbt._bt_ctf_field_type_sequence_get_length_field_name(self._ft)