Package-level declarations

StructSchema, the description of a WPILib struct (type name, fixed size, schema text, nested types, and a packer), and structSchema, a builder for defining one by hand. StructSchemaRegistry builds schemas by reflecting over a class's properties, or a Java class's public fields, getters, or record components, with StructName, StructIgnore, StructSize and related annotations to adjust the result.

Types

Link copied to clipboard

Leaves a property, field, or getter out of the struct when a StructSchemaRegistry reflects its class.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class StructName(val value: String)

Sets the struct type name of a class when a StructSchemaRegistry reflects it, instead of the class's simple name.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class StructOrder(val value: String)

Sets the order of a class's struct fields when a StructSchemaRegistry reflects it. The order is the layout on the wire.

Link copied to clipboard
interface StructSchema<T>

Describes a WPILib struct: a fixed-size, packed, little-endian binary encoding of T together with a text schema that tells readers how to decode it.

Link copied to clipboard

Declares the fields of a struct. See structSchema.

Link copied to clipboard

Finds or builds a StructSchema for a class, reflecting over its fields.

Link copied to clipboard

Declares the fixed length of an array property, field, or getter, which a struct needs and the array's type can't say. Only DoubleArray (double[] in Java) is supported.

Functions

Link copied to clipboard
fun <T> structSchema(typeName: String, block: StructSchemaBuilder<T>.() -> Unit): StructSchema<T>

Builds a StructSchema for T by declaring its fields in wire order.