Class StructDescriptor

java.lang.Object
edu.wpi.first.util.struct.StructDescriptor

public class StructDescriptor extends Object
Raw struct dynamic struct descriptor.
  • Method Details

    • getName

      public String getName()
      Gets the struct name.
      Returns:
      name
    • getSchema

      public String getSchema()
      Gets the struct schema.
      Returns:
      schema
    • isValid

      public boolean isValid()
      Returns whether the struct is valid (e.g. the struct is fully defined and field offsets computed).
      Returns:
      true if valid
    • getSize

      public int getSize()
      Returns the struct size, in bytes. Not valid unless IsValid() is true.
      Returns:
      size in bytes
      Throws:
      IllegalStateException - if descriptor is invalid
    • findFieldByName

      Gets a field descriptor by name. Note the field cannot be accessed until the struct is valid.
      Parameters:
      name - field name
      Returns:
      field descriptor, or nullptr if not found
    • getFields

      Gets all field descriptors. Note fields cannot be accessed until the struct is valid.
      Returns:
      field descriptors