Document barectf 3
[barectf.git] / docs / modules / yaml / pages / static-array-ft-obj.adoc
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 Examples:
51
52 [%autowidth.stretch]
53 |===
54 |Element field type |Generated C{nbsp}type
55
56 |8-bit unsigned xref:int-ft-obj.adoc[integer]
57 |`const uint8_t *`
58
59 |32-bit signed integer
60 |`const int32_t *`
61
62 |Single-precision xref:real-ft-obj.adoc[real]
63 |`const float *`
64
65 |xref:str-ft-obj.adoc[String]
66 |`const char * const *`
67
68 |Static array of 16-bit signed integers
69 |`const int16_t * const *`
70
71 |Static array of double-precision reals
72 |`const double * const *`
73
74 |Static array of strings
75 |`const char * const * const *`
76
77 |Static array of static arrays of 32-bit unsigned integers
78 |`const uint32_t * const * const *`
79 |===
80
81 == Examples
82
83 .Static array field type object: <<length-prop,four>> 8-bit unsigned xref:int-ft-obj.adoc[integers].
84 ====
85 [source,yaml]
86 ----
87 class: static-array
88 length: 4
89 element-field-type: uint8
90 ----
91 ====
92
93 .Static array field type object: <<length-prop,22>>{nbsp}xref:str-ft-obj.adoc[strings].
94 ====
95 [source,yaml]
96 ----
97 class: static-array
98 length: 22
99 element-field-type:
100 class: string
101 ----
102 ====
103
104 .Static array field type object: <<length-prop,five>> static arrays of 32{nbsp}double-precision xref:real-ft-obj.adoc[reals].
105 ====
106 [source,yaml]
107 ----
108 class: static-array
109 length: 5
110 element-field-type:
111 class: static-array
112 length: 32
113 element-field-type:
114 class: real
115 size: 64
116 ----
117 ====
This page took 0.033394 seconds and 4 git commands to generate.