Class MatrixProto<R extends Num, C extends Num>

java.lang.Object
org.wpilib.math.linalg.proto.MatrixProto<R,C>
All Implemented Interfaces:
Protobuf<Matrix<R,C>, ProtobufMatrix>

public class MatrixProto<R extends Num, C extends Num> extends Object implements Protobuf<Matrix<R,C>, ProtobufMatrix>
  • Constructor Details

    • MatrixProto

      public MatrixProto(Nat<R> rows, Nat<C> cols)
      Constructs the Protobuf implementation.
      Parameters:
      rows - The number of rows of the matrices this serializer processes.
      cols - The number of cols of the matrices this serializer processes.
  • Method Details

    • getTypeClass

      public Class<Matrix<R,C>> getTypeClass()
      Description copied from interface: Protobuf
      Gets the Class object for the stored value.
      Specified by:
      getTypeClass in interface Protobuf<R extends Num, C extends Num>
      Returns:
      Class
    • getDescriptor

      public us.hebi.quickbuf.Descriptors.Descriptor getDescriptor()
      Description copied from interface: Protobuf
      Gets the protobuf descriptor.
      Specified by:
      getDescriptor in interface Protobuf<R extends Num, C extends Num>
      Returns:
      descriptor
    • createMessage

      public ProtobufMatrix createMessage()
      Description copied from interface: Protobuf
      Creates protobuf message.
      Specified by:
      createMessage in interface Protobuf<R extends Num, C extends Num>
      Returns:
      protobuf message
    • unpack

      public Matrix<R,C> unpack(ProtobufMatrix msg)
      Description copied from interface: Protobuf
      Deserializes an object from a protobuf message.
      Specified by:
      unpack in interface Protobuf<R extends Num, C extends Num>
      Parameters:
      msg - protobuf message
      Returns:
      New object
    • pack

      public void pack(ProtobufMatrix msg, Matrix<R,C> value)
      Description copied from interface: Protobuf
      Copies the object contents into a protobuf message. Implementations should call either msg.setMember(member) or member.copyToProto(msg.getMutableMember()) for each member.
      Specified by:
      pack in interface Protobuf<R extends Num, C extends Num>
      Parameters:
      msg - protobuf message
      value - object to serialize