[wpiutil] Struct: Change from GetTypeString() to GetTypeName() (#6872)

This makes it easier to define schemas when the type name is non-trivial (e.g., templated structs).

This is breaking for a) custom struct implementations and b) anything calling `wpi::Struct<T>::GetTypeString(info...)` in C++ directly. In both cases, it's a simple translation: For A, rename `GetTypeString()` to `GetTypeName()` and remove the struct: at the beginning, and for B, use `wpi::GetStructTypeString<T>(info...)` instead.
This commit is contained in:
Joseph Eng
2024-07-27 20:23:45 -07:00
committed by GitHub
parent 5dcaa6d671
commit 158fb23072
58 changed files with 185 additions and 162 deletions

View File

@@ -15,8 +15,8 @@ public class ChassisSpeedsStruct implements Struct<ChassisSpeeds> {
}
@Override
public String getTypeString() {
return "struct:ChassisSpeeds";
public String getTypeName() {
return "ChassisSpeeds";
}
@Override

View File

@@ -15,8 +15,8 @@ public class DifferentialDriveKinematicsStruct implements Struct<DifferentialDri
}
@Override
public String getTypeString() {
return "struct:DifferentialDriveKinematics";
public String getTypeName() {
return "DifferentialDriveKinematics";
}
@Override

View File

@@ -16,8 +16,8 @@ public class DifferentialDriveWheelPositionsStruct
}
@Override
public String getTypeString() {
return "struct:DifferentialDriveWheelPositions";
public String getTypeName() {
return "DifferentialDriveWheelPositions";
}
@Override

View File

@@ -15,8 +15,8 @@ public class DifferentialDriveWheelSpeedsStruct implements Struct<DifferentialDr
}
@Override
public String getTypeString() {
return "struct:DifferentialDriveWheelSpeeds";
public String getTypeName() {
return "DifferentialDriveWheelSpeeds";
}
@Override

View File

@@ -16,8 +16,8 @@ public class MecanumDriveKinematicsStruct implements Struct<MecanumDriveKinemati
}
@Override
public String getTypeString() {
return "struct:MecanumDriveKinematics";
public String getTypeName() {
return "MecanumDriveKinematics";
}
@Override

View File

@@ -15,8 +15,8 @@ public class MecanumDriveWheelPositionsStruct implements Struct<MecanumDriveWhee
}
@Override
public String getTypeString() {
return "struct:MecanumDriveWheelPositions";
public String getTypeName() {
return "MecanumDriveWheelPositions";
}
@Override

View File

@@ -15,8 +15,8 @@ public class MecanumDriveWheelSpeedsStruct implements Struct<MecanumDriveWheelSp
}
@Override
public String getTypeString() {
return "struct:MecanumDriveWheelSpeeds";
public String getTypeName() {
return "MecanumDriveWheelSpeeds";
}
@Override

View File

@@ -16,8 +16,8 @@ public class SwerveModulePositionStruct implements Struct<SwerveModulePosition>
}
@Override
public String getTypeString() {
return "struct:SwerveModulePosition";
public String getTypeName() {
return "SwerveModulePosition";
}
@Override

View File

@@ -16,8 +16,8 @@ public class SwerveModuleStateStruct implements Struct<SwerveModuleState> {
}
@Override
public String getTypeString() {
return "struct:SwerveModuleState";
public String getTypeName() {
return "SwerveModuleState";
}
@Override