File: static-array-ft-obj.adoc

package info (click to toggle)
barectf 3.1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,840 kB
  • sloc: python: 3,781; ansic: 1,585; makefile: 45; sh: 11
file content (88 lines) | stat: -rw-r--r-- 2,247 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
= YAML static array field type objects

A _**static array field type object**_ is the type of static array data
fields, found in xref:how-barectf-works:ctf-primer.adoc#ds[data
streams].

A static array data field is a sequence of data fields, or
_elements_. In CTF, the number of elements in a static array data field
(its length) is found in the
xref:how-barectf-works:ctf-primer.adoc#trace[metadata stream].

[[props]]
== Properties

[%autowidth.stretch, cols="d,d,a,d"]
|===
|Name |Type |Description |{req-abbr}

|[[class-prop]]`class`
|String
|This property's value must be `static-array`.
|Yes if the <<inherit-prop,`$inherit`>> property is not set.

include::partial$ft-obj-inherit-prop.adoc[]

|[[length-prop]]`length`
|Positive integer
|Number of elements in this field type's instances.
|Yes

|[[element-ft-prop]]`element-field-type`
|xref:ft-obj.adoc[Field type object] (except a
xref:struct-ft-obj.adoc[structure field type object] and a
xref:dyn-array-ft-obj.adoc[dynamic array field type object]) or string
|Type of each element (data fields) in this field type's instances.

If this property's value is a string, it must be the name of an existing
xref:trace-type-obj.adoc#ft-aliases-prop[field type alias]. This
field type must _not_ be a structure field type or a dynamic array
field type.
|Yes
|===

== Generated C{nbsp}types

Pointer to `const __T__`, where `__T__` is the generated C{nbsp}type for
the field type object of the <<element-ft-prop,`element-field-type`
property>>.

include::partial$array-ft-obj-gen-c-types-example.adoc[]

== Examples

.Static array field type object: <<length-prop,four>> 8-bit unsigned xref:int-ft-obj.adoc[integers].
====
[source,yaml]
----
class: static-array
length: 4
element-field-type: uint8
----
====

.Static array field type object: <<length-prop,22>>{nbsp}xref:str-ft-obj.adoc[strings].
====
[source,yaml]
----
class: static-array
length: 22
element-field-type:
  class: string
----
====

.Static array field type object: <<length-prop,five>> static arrays of 32{nbsp}double-precision xref:real-ft-obj.adoc[reals].
====
[source,yaml]
----
class: static-array
length: 5
element-field-type:
  class: static-array
  length: 32
  element-field-type:
    class: real
    size: 64
----
====