Debian Codegraph @

docs/modules/yaml/pages/static-array-ft-obj.adoc

raw
1 = YAML static array field type objects
2
3 A _**static array field type object**_ is the type of static array data
4 fields, found in xref:how-barectf-works:ctf-primer.adoc#ds[data
5 streams].
6
7 A static array data field is a sequence of data fields, or
8 _elements_. In CTF, the number of elements in a static array data field
9 (its length) is found in the
10 xref:how-barectf-works:ctf-primer.adoc#trace[metadata stream].
11
12 [[props]]
13 == Properties
14
15 [%autowidth.stretch, cols="d,d,a,d"]
16 |===
17 |Name |Type |Description |{req-abbr}
18
19 |[[class-prop]]`class`
20 |String
21 |This property's value must be `static-array`.
22 |Yes if the <<inherit-prop,`$inherit`>> property is not set.
23
24 include::partial$ft-obj-inherit-prop.adoc[]
25
26 |[[length-prop]]`length`
27 |Positive integer
28 |Number of elements in this field type's instances.
29 |Yes
30
31 |[[element-ft-prop]]`element-field-type`
32 |xref:ft-obj.adoc[Field type object] (except a
33 xref:struct-ft-obj.adoc[structure field type object] and a
34 xref:dyn-array-ft-obj.adoc[dynamic array field type object]) or string
35 |Type of each element (data fields) in this field type's instances.
36
37 If this property's value is a string, it must be the name of an existing
38 xref:trace-type-obj.adoc#ft-aliases-prop[field type alias]. This
39 field type must _not_ be a structure field type or a dynamic array
40 field type.
41 |Yes
42 |===
43
44 == Generated C{nbsp}types
45
46 Pointer to `const __T__`, where `__T__` is the generated C{nbsp}type for
47 the field type object of the <<element-ft-prop,`element-field-type`
48 property>>.
49
50 include::partial$array-ft-obj-gen-c-types-example.adoc[]
51
52 == Examples
53
54 .Static array field type object: <<length-prop,four>> 8-bit unsigned xref:int-ft-obj.adoc[integers].
55 ====
56 [source,yaml]
57 ----
58 class: static-array
59 length: 4
60 element-field-type: uint8
61 ----
62 ====
63
64 .Static array field type object: <<length-prop,22>>{nbsp}xref:str-ft-obj.adoc[strings].
65 ====
66 [source,yaml]
67 ----
68 class: static-array
69 length: 22
70 element-field-type:
71 class: string
72 ----
73 ====
74
75 .Static array field type object: <<length-prop,five>> static arrays of 32{nbsp}double-precision xref:real-ft-obj.adoc[reals].
76 ====
77 [source,yaml]
78 ----
79 class: static-array
80 length: 5
81 element-field-type:
82 class: static-array
83 length: 32
84 element-field-type:
85 class: real
86 size: 64
87 ----
88 ====