docs: {static,dyn}-array-ft-obj.adoc: use example block
[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 .Generated C{nbsp}types for various element field types.
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
82 == Examples
83
84 .Static array field type object: <<length-prop,four>> 8-bit unsigned xref:int-ft-obj.adoc[integers].
85 ====
86 [source,yaml]
87 ----
88 class: static-array
89 length: 4
90 element-field-type: uint8
91 ----
92 ====
93
94 .Static array field type object: <<length-prop,22>>{nbsp}xref:str-ft-obj.adoc[strings].
95 ====
96 [source,yaml]
97 ----
98 class: static-array
99 length: 22
100 element-field-type:
101 class: string
102 ----
103 ====
104
105 .Static array field type object: <<length-prop,five>> static arrays of 32{nbsp}double-precision xref:real-ft-obj.adoc[reals].
106 ====
107 [source,yaml]
108 ----
109 class: static-array
110 length: 5
111 element-field-type:
112 class: static-array
113 length: 32
114 element-field-type:
115 class: real
116 size: 64
117 ----
118 ====
This page took 0.032837 seconds and 4 git commands to generate.