= 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
----
====
