diff --git a/ntcore/src/test/native/cpp/StructTest.cpp b/ntcore/src/test/native/cpp/StructTest.cpp index 55b6a906c3..6842edb480 100644 --- a/ntcore/src/test/native/cpp/StructTest.cpp +++ b/ntcore/src/test/native/cpp/StructTest.cpp @@ -46,7 +46,7 @@ struct Info1 { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:Inner"; } + static constexpr std::string_view GetTypeName() { return "Inner"; } static constexpr size_t GetSize() { return 8; } static constexpr std::string_view GetSchema() { return "int32 a; int32 b"; } @@ -62,7 +62,7 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:Outer"; } + static constexpr std::string_view GetTypeName() { return "Outer"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + 4; } static constexpr std::string_view GetSchema() { return "Inner inner; int32 c"; @@ -86,7 +86,7 @@ struct wpi::Struct { template <> struct wpi::Struct { - static std::string_view GetTypeString() { return "struct:Inner2"; } + static std::string_view GetTypeName() { return "Inner2"; } static size_t GetSize() { return 8; } static std::string_view GetSchema() { return "int32 a; int32 b"; } @@ -102,7 +102,7 @@ struct wpi::Struct { template <> struct wpi::Struct { - static std::string_view GetTypeString() { return "struct:Outer2"; } + static std::string_view GetTypeName() { return "Outer2"; } static size_t GetSize() { return wpi::GetStructSize() + 4; } static std::string_view GetSchema() { return "Inner2 inner; int32 c"; } @@ -124,7 +124,7 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:ThingA"; } + static constexpr std::string_view GetTypeName() { return "ThingA"; } static constexpr size_t GetSize() { return 1; } static constexpr std::string_view GetSchema() { return "uint8 value"; } static ThingA Unpack(std::span data) { @@ -137,8 +137,8 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString(const Info1&) { - return "struct:ThingB"; + static constexpr std::string_view GetTypeName(const Info1&) { + return "ThingB"; } static constexpr size_t GetSize(const Info1&) { return 1; } static constexpr std::string_view GetSchema(const Info1&) { diff --git a/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ArmFeedforwardStruct.java b/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ArmFeedforwardStruct.java index 1f967bc0ac..b0d1b832cb 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ArmFeedforwardStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ArmFeedforwardStruct.java @@ -15,8 +15,8 @@ public class ArmFeedforwardStruct implements Struct { } @Override - public String getTypeString() { - return "struct:ArmFeedforward"; + public String getTypeName() { + return "ArmFeedforward"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/controller/struct/DifferentialDriveWheelVoltagesStruct.java b/wpimath/src/main/java/edu/wpi/first/math/controller/struct/DifferentialDriveWheelVoltagesStruct.java index 1695d812e0..fd34b8086b 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/controller/struct/DifferentialDriveWheelVoltagesStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/controller/struct/DifferentialDriveWheelVoltagesStruct.java @@ -16,8 +16,8 @@ public class DifferentialDriveWheelVoltagesStruct } @Override - public String getTypeString() { - return "struct:DifferentialDriveWheelVoltages"; + public String getTypeName() { + return "DifferentialDriveWheelVoltages"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ElevatorFeedforwardStruct.java b/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ElevatorFeedforwardStruct.java index 06e2126668..f43eb6b69c 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ElevatorFeedforwardStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/controller/struct/ElevatorFeedforwardStruct.java @@ -15,8 +15,8 @@ public class ElevatorFeedforwardStruct implements Struct { } @Override - public String getTypeString() { - return "struct:ElevatorFeedforward"; + public String getTypeName() { + return "ElevatorFeedforward"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Ellipse2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Ellipse2dStruct.java index 870cfaddb2..31a045356b 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Ellipse2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Ellipse2dStruct.java @@ -16,8 +16,8 @@ public class Ellipse2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Ellipse2d"; + public String getTypeName() { + return "Ellipse2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose2dStruct.java index ff588791cf..027a0a3300 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose2dStruct.java @@ -17,8 +17,8 @@ public class Pose2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Pose2d"; + public String getTypeName() { + return "Pose2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose3dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose3dStruct.java index 8e24818915..7ff6f77a63 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose3dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Pose3dStruct.java @@ -17,8 +17,8 @@ public class Pose3dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Pose3d"; + public String getTypeName() { + return "Pose3d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/QuaternionStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/QuaternionStruct.java index 93b8598414..be80cc5e89 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/QuaternionStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/QuaternionStruct.java @@ -15,8 +15,8 @@ public class QuaternionStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Quaternion"; + public String getTypeName() { + return "Quaternion"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rectangle2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rectangle2dStruct.java index 62c6eff6bb..57cde1b3cb 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rectangle2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rectangle2dStruct.java @@ -16,8 +16,8 @@ public class Rectangle2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Rectangle2d"; + public String getTypeName() { + return "Rectangle2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation2dStruct.java index 8dc36462a8..1f348d73a0 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation2dStruct.java @@ -15,8 +15,8 @@ public class Rotation2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Rotation2d"; + public String getTypeName() { + return "Rotation2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation3dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation3dStruct.java index 3d9fba0a25..ec44c603d0 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation3dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Rotation3dStruct.java @@ -16,8 +16,8 @@ public class Rotation3dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Rotation3d"; + public String getTypeName() { + return "Rotation3d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform2dStruct.java index 5e3bb30505..188ab07051 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform2dStruct.java @@ -17,8 +17,8 @@ public class Transform2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Transform2d"; + public String getTypeName() { + return "Transform2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform3dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform3dStruct.java index 6e02e9e527..5bdf788118 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform3dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Transform3dStruct.java @@ -17,8 +17,8 @@ public class Transform3dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Transform3d"; + public String getTypeName() { + return "Transform3d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation2dStruct.java index 643090a308..dfa925a8fa 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation2dStruct.java @@ -15,8 +15,8 @@ public class Translation2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Translation2d"; + public String getTypeName() { + return "Translation2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation3dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation3dStruct.java index c4e6eeda97..dd58afb2c1 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation3dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Translation3dStruct.java @@ -15,8 +15,8 @@ public class Translation3dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Translation3d"; + public String getTypeName() { + return "Translation3d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist2dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist2dStruct.java index 7797f3ac9d..43b7a117f7 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist2dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist2dStruct.java @@ -15,8 +15,8 @@ public class Twist2dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Twist2d"; + public String getTypeName() { + return "Twist2d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist3dStruct.java b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist3dStruct.java index 68926a4c41..435e06a30a 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist3dStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/geometry/struct/Twist3dStruct.java @@ -15,8 +15,8 @@ public class Twist3dStruct implements Struct { } @Override - public String getTypeString() { - return "struct:Twist3d"; + public String getTypeName() { + return "Twist3d"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/ChassisSpeedsStruct.java b/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/ChassisSpeedsStruct.java index ea26f86e62..16457f5e09 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/ChassisSpeedsStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/ChassisSpeedsStruct.java @@ -15,8 +15,8 @@ public class ChassisSpeedsStruct implements Struct { } @Override - public String getTypeString() { - return "struct:ChassisSpeeds"; + public String getTypeName() { + return "ChassisSpeeds"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/DifferentialDriveKinematicsStruct.java b/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/DifferentialDriveKinematicsStruct.java index 1ddadaac1f..cc696ec908 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/DifferentialDriveKinematicsStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/DifferentialDriveKinematicsStruct.java @@ -15,8 +15,8 @@ public class DifferentialDriveKinematicsStruct implements Struct } @Override - public String getTypeString() { - return "struct:SwerveModulePosition"; + public String getTypeName() { + return "SwerveModulePosition"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/SwerveModuleStateStruct.java b/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/SwerveModuleStateStruct.java index 51dd61f045..af29a8d628 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/SwerveModuleStateStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/kinematics/struct/SwerveModuleStateStruct.java @@ -16,8 +16,8 @@ public class SwerveModuleStateStruct implements Struct { } @Override - public String getTypeString() { - return "struct:SwerveModuleState"; + public String getTypeName() { + return "SwerveModuleState"; } @Override diff --git a/wpimath/src/main/java/edu/wpi/first/math/system/plant/struct/DCMotorStruct.java b/wpimath/src/main/java/edu/wpi/first/math/system/plant/struct/DCMotorStruct.java index da159fc63a..a55264b966 100644 --- a/wpimath/src/main/java/edu/wpi/first/math/system/plant/struct/DCMotorStruct.java +++ b/wpimath/src/main/java/edu/wpi/first/math/system/plant/struct/DCMotorStruct.java @@ -15,8 +15,8 @@ public class DCMotorStruct implements Struct { } @Override - public String getTypeString() { - return "struct:DCMotor"; + public String getTypeName() { + return "DCMotor"; } @Override diff --git a/wpimath/src/main/native/include/frc/controller/struct/ArmFeedforwardStruct.h b/wpimath/src/main/native/include/frc/controller/struct/ArmFeedforwardStruct.h index cfc585cb32..fca552995b 100644 --- a/wpimath/src/main/native/include/frc/controller/struct/ArmFeedforwardStruct.h +++ b/wpimath/src/main/native/include/frc/controller/struct/ArmFeedforwardStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:ArmFeedforward"; - } + static constexpr std::string_view GetTypeName() { return "ArmFeedforward"; } static constexpr size_t GetSize() { return 32; } static constexpr std::string_view GetSchema() { return "double ks;double kg;double kv;double ka"; diff --git a/wpimath/src/main/native/include/frc/controller/struct/DifferentialDriveWheelVoltagesStruct.h b/wpimath/src/main/native/include/frc/controller/struct/DifferentialDriveWheelVoltagesStruct.h index cb5311f691..0cfeb08b4b 100644 --- a/wpimath/src/main/native/include/frc/controller/struct/DifferentialDriveWheelVoltagesStruct.h +++ b/wpimath/src/main/native/include/frc/controller/struct/DifferentialDriveWheelVoltagesStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:DifferentialDriveWheelVoltages"; + static constexpr std::string_view GetTypeName() { + return "DifferentialDriveWheelVoltages"; } static constexpr size_t GetSize() { return 16; } static constexpr std::string_view GetSchema() { diff --git a/wpimath/src/main/native/include/frc/controller/struct/ElevatorFeedforwardStruct.h b/wpimath/src/main/native/include/frc/controller/struct/ElevatorFeedforwardStruct.h index fafb7d73ec..e096485264 100644 --- a/wpimath/src/main/native/include/frc/controller/struct/ElevatorFeedforwardStruct.h +++ b/wpimath/src/main/native/include/frc/controller/struct/ElevatorFeedforwardStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:ElevatorFeedforward"; + static constexpr std::string_view GetTypeName() { + return "ElevatorFeedforward"; } static constexpr size_t GetSize() { return 32; } static constexpr std::string_view GetSchema() { diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Ellipse2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Ellipse2dStruct.h index ac7ea3c535..d90df96f16 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Ellipse2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Ellipse2dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Ellipse2d"; - } + static constexpr std::string_view GetTypeName() { return "Ellipse2d"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + 16; } diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Pose2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Pose2dStruct.h index 66e3295f91..ec352090d5 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Pose2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Pose2dStruct.h @@ -11,7 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:Pose2d"; } + static constexpr std::string_view GetTypeName() { return "Pose2d"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Pose3dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Pose3dStruct.h index f47ffec964..0584449a43 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Pose3dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Pose3dStruct.h @@ -11,7 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:Pose3d"; } + static constexpr std::string_view GetTypeName() { return "Pose3d"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/geometry/struct/QuaternionStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/QuaternionStruct.h index 80420c0774..f9e61ffc3f 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/QuaternionStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/QuaternionStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Quaternion"; - } + static constexpr std::string_view GetTypeName() { return "Quaternion"; } static constexpr size_t GetSize() { return 32; } static constexpr std::string_view GetSchema() { return "double w;double x;double y;double z"; diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Rectangle2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Rectangle2dStruct.h index 86bda44a4c..3df9d74f0c 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Rectangle2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Rectangle2dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Rectangle2d"; - } + static constexpr std::string_view GetTypeName() { return "Rectangle2d"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + 16; } diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Rotation2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Rotation2dStruct.h index 85b6ae5178..e7e5ec10a9 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Rotation2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Rotation2dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Rotation2d"; - } + static constexpr std::string_view GetTypeName() { return "Rotation2d"; } static constexpr size_t GetSize() { return 8; } static constexpr std::string_view GetSchema() { return "double value"; } diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Rotation3dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Rotation3dStruct.h index e94b75ee4b..81be3d69c0 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Rotation3dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Rotation3dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Rotation3d"; - } + static constexpr std::string_view GetTypeName() { return "Rotation3d"; } static constexpr size_t GetSize() { return wpi::GetStructSize(); } diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Transform2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Transform2dStruct.h index 28ef463ab1..9711c25efc 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Transform2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Transform2dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Transform2d"; - } + static constexpr std::string_view GetTypeName() { return "Transform2d"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Transform3dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Transform3dStruct.h index e4e88bcf49..4955e5898e 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Transform3dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Transform3dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Transform3d"; - } + static constexpr std::string_view GetTypeName() { return "Transform3d"; } static constexpr size_t GetSize() { return wpi::GetStructSize() + wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Translation2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Translation2dStruct.h index df12760f85..9d9759185d 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Translation2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Translation2dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Translation2d"; - } + static constexpr std::string_view GetTypeName() { return "Translation2d"; } static constexpr size_t GetSize() { return 16; } static constexpr std::string_view GetSchema() { return "double x;double y"; } diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Translation3dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Translation3dStruct.h index b61a8758c6..c77bf512fa 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Translation3dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Translation3dStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:Translation3d"; - } + static constexpr std::string_view GetTypeName() { return "Translation3d"; } static constexpr size_t GetSize() { return 24; } static constexpr std::string_view GetSchema() { return "double x;double y;double z"; diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Twist2dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Twist2dStruct.h index 86bb4ada36..8ff240b4f6 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Twist2dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Twist2dStruct.h @@ -11,7 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:Twist2d"; } + static constexpr std::string_view GetTypeName() { return "Twist2d"; } static constexpr size_t GetSize() { return 24; } static constexpr std::string_view GetSchema() { return "double dx;double dy;double dtheta"; diff --git a/wpimath/src/main/native/include/frc/geometry/struct/Twist3dStruct.h b/wpimath/src/main/native/include/frc/geometry/struct/Twist3dStruct.h index a346a1ad80..9372520880 100644 --- a/wpimath/src/main/native/include/frc/geometry/struct/Twist3dStruct.h +++ b/wpimath/src/main/native/include/frc/geometry/struct/Twist3dStruct.h @@ -11,7 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:Twist3d"; } + static constexpr std::string_view GetTypeName() { return "Twist3d"; } static constexpr size_t GetSize() { return 48; } static constexpr std::string_view GetSchema() { return "double dx;double dy;double dz;double rx;double ry;double rz"; diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/ChassisSpeedsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/ChassisSpeedsStruct.h index 8c65057da9..583f191ecc 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/ChassisSpeedsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/ChassisSpeedsStruct.h @@ -11,9 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:ChassisSpeeds"; - } + static constexpr std::string_view GetTypeName() { return "ChassisSpeeds"; } static constexpr size_t GetSize() { return 24; } static constexpr std::string_view GetSchema() { return "double vx;double vy;double omega"; diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveKinematicsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveKinematicsStruct.h index 0acbc76e47..fa14606f61 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveKinematicsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveKinematicsStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:DifferentialDriveKinematics"; + static constexpr std::string_view GetTypeName() { + return "DifferentialDriveKinematics"; } static constexpr size_t GetSize() { return 8; } static constexpr std::string_view GetSchema() { return "double track_width"; } diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelPositionsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelPositionsStruct.h index ef694bc37b..96cd90abf2 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelPositionsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelPositionsStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:DifferentialDriveWheelPositions"; + static constexpr std::string_view GetTypeName() { + return "DifferentialDriveWheelPositions"; } static constexpr size_t GetSize() { return 16; } static constexpr std::string_view GetSchema() { diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelSpeedsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelSpeedsStruct.h index 12dc8431eb..96a4ad8a84 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelSpeedsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/DifferentialDriveWheelSpeedsStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:DifferentialDriveWheelSpeeds"; + static constexpr std::string_view GetTypeName() { + return "DifferentialDriveWheelSpeeds"; } static constexpr size_t GetSize() { return 16; } static constexpr std::string_view GetSchema() { diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveKinematicsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveKinematicsStruct.h index a4fe3bddca..0751454376 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveKinematicsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveKinematicsStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:MecanumDriveKinematics"; + static constexpr std::string_view GetTypeName() { + return "MecanumDriveKinematics"; } static constexpr size_t GetSize() { return 4 * wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelPositionsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelPositionsStruct.h index 87b5f38624..e7df5619dc 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelPositionsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelPositionsStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:MecanumDriveWheelPositions"; + static constexpr std::string_view GetTypeName() { + return "MecanumDriveWheelPositions"; } static constexpr size_t GetSize() { return 32; } static constexpr std::string_view GetSchema() { diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelSpeedsStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelSpeedsStruct.h index 28f28e8c22..30aa8ef7e1 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelSpeedsStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/MecanumDriveWheelSpeedsStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:MecanumDriveWheelSpeeds"; + static constexpr std::string_view GetTypeName() { + return "MecanumDriveWheelSpeeds"; } static constexpr size_t GetSize() { return 32; } static constexpr std::string_view GetSchema() { diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModulePositionStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModulePositionStruct.h index ee58a2c7cd..2bdcb2a335 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModulePositionStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModulePositionStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:SwerveModulePosition"; + static constexpr std::string_view GetTypeName() { + return "SwerveModulePosition"; } static constexpr size_t GetSize() { return 8 + wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModuleStateStruct.h b/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModuleStateStruct.h index 06885fed51..b521f351e7 100644 --- a/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModuleStateStruct.h +++ b/wpimath/src/main/native/include/frc/kinematics/struct/SwerveModuleStateStruct.h @@ -11,8 +11,8 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { - return "struct:SwerveModuleState"; + static constexpr std::string_view GetTypeName() { + return "SwerveModuleState"; } static constexpr size_t GetSize() { return 8 + wpi::GetStructSize(); diff --git a/wpimath/src/main/native/include/frc/system/plant/struct/DCMotorStruct.h b/wpimath/src/main/native/include/frc/system/plant/struct/DCMotorStruct.h index 22a6405d9a..8f60d4ce3f 100644 --- a/wpimath/src/main/native/include/frc/system/plant/struct/DCMotorStruct.h +++ b/wpimath/src/main/native/include/frc/system/plant/struct/DCMotorStruct.h @@ -11,7 +11,7 @@ template <> struct WPILIB_DLLEXPORT wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:DCMotor"; } + static constexpr std::string_view GetTypeName() { return "DCMotor"; } static constexpr size_t GetSize() { return 40; } static constexpr std::string_view GetSchema() { return "double nominal_voltage;double stall_torque;double " diff --git a/wpiutil/src/main/java/edu/wpi/first/util/struct/Struct.java b/wpiutil/src/main/java/edu/wpi/first/util/struct/Struct.java index 99072ecfd6..05c7a4f654 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/struct/Struct.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/struct/Struct.java @@ -47,13 +47,23 @@ public interface Struct { */ Class getTypeClass(); + /** + * Gets the type name (e.g. for schemas of other structs). This should be globally unique among + * structs. + * + * @return type name + */ + String getTypeName(); + /** * Gets the type string (e.g. for NetworkTables). This should be globally unique and start with * "struct:". * * @return type string */ - String getTypeString(); + default String getTypeString() { + return "struct:" + getTypeName(); + } /** * Gets the serialized size (in bytes). This should always be a constant. diff --git a/wpiutil/src/main/native/include/wpi/DataLog.h b/wpiutil/src/main/native/include/wpi/DataLog.h index 4834b65dd0..35f0859ec0 100644 --- a/wpiutil/src/main/native/include/wpi/DataLog.h +++ b/wpiutil/src/main/native/include/wpi/DataLog.h @@ -1309,7 +1309,8 @@ class StructLogEntry : public DataLogEntry { : m_info{std::move(info)...} { m_log = &log; log.AddStructSchema(info..., timestamp); - m_entry = log.Start(name, S::GetTypeString(info...), metadata, timestamp); + m_entry = + log.Start(name, GetStructTypeString(info...), metadata, timestamp); } StructLogEntry(StructLogEntry&& rhs) diff --git a/wpiutil/src/main/native/include/wpi/struct/Struct.h b/wpiutil/src/main/native/include/wpi/struct/Struct.h index f46d8dc50b..02f28f10ef 100644 --- a/wpiutil/src/main/native/include/wpi/struct/Struct.h +++ b/wpiutil/src/main/native/include/wpi/struct/Struct.h @@ -49,15 +49,15 @@ struct Struct {}; * Implementations must define a template specialization for wpi::Struct with * T being the type that is being serialized/deserialized, with the following * static members (as enforced by this concept): - * - std::string_view GetTypeString(): function that returns the type string + * - std::string_view GetTypeName(): function that returns the type name * - size_t GetSize(): function that returns the structure size in bytes * - std::string_view GetSchema(): function that returns the struct schema * - T Unpack(std::span): function for deserialization * - void Pack(std::span, T&& value): function for * serialization * - * If possible, the GetTypeString(), GetSize(), and GetSchema() functions should - * be marked constexpr. GetTypeString() and GetSchema() may return types other + * If possible, the GetTypeName(), GetSize(), and GetSchema() functions should + * be marked constexpr. GetTypeName() and GetSchema() may return types other * than std::string_view, as long as the return value is convertible to * std::string_view. * @@ -72,7 +72,7 @@ concept StructSerializable = requires(std::span in, typename std::remove_cvref_t...>; { Struct, - typename std::remove_cvref_t...>::GetTypeString(info...) + typename std::remove_cvref_t...>::GetTypeName(info...) } -> std::convertible_to; { Struct, @@ -229,18 +229,41 @@ inline void UnpackStructInto(T* out, std::span data, } } +/** + * Get the type name for a raw struct serializable type + * + * @tparam T serializable type + * @param info optional struct type info + * @return type name + */ +template + requires StructSerializable +constexpr auto GetStructTypeName(const I&... info) { + using S = Struct...>; + return S::GetTypeName(info...); +} + /** * Get the type string for a raw struct serializable type * * @tparam T serializable type * @param info optional struct type info - * @return type string + * @return type string (struct: followed by type name) */ template requires StructSerializable constexpr auto GetStructTypeString(const I&... info) { using S = Struct...>; - return S::GetTypeString(info...); + if constexpr (sizeof...(I) == 0 && + is_constexpr([&] { S::GetTypeName(info...); })) { + constexpr auto typeName = S::GetTypeName(info...); + using namespace literals; + return Concat( + "struct:"_ct_string, + ct_string, typeName.size()>{typeName}); + } else { + return fmt::format("struct:{}", S::GetTypeName(info...)); + } } /** @@ -259,32 +282,43 @@ constexpr size_t GetStructSize(const I&... info) { template requires StructSerializable -constexpr auto MakeStructArrayTypeString(const I&... info) { +constexpr auto MakeStructArrayTypeName(const I&... info) { using S = Struct...>; if constexpr (sizeof...(I) == 0 && - is_constexpr([&] { S::GetTypeString(info...); })) { - constexpr auto typeString = S::GetTypeString(info...); + is_constexpr([&] { S::GetTypeName(info...); })) { + constexpr auto typeName = S::GetTypeName(info...); using namespace literals; if constexpr (N == std::dynamic_extent) { return Concat( - ct_string, typeString.size()>{ - typeString}, + ct_string, typeName.size()>{typeName}, "[]"_ct_string); } else { return Concat( - ct_string, typeString.size()>{ - typeString}, + ct_string, typeName.size()>{typeName}, "["_ct_string, NumToCtString(), "]"_ct_string); } } else { if constexpr (N == std::dynamic_extent) { - return fmt::format("{}[]", S::GetTypeString(info...)); + return fmt::format("{}[]", S::GetTypeName(info...)); } else { - return fmt::format("{}[{}]", S::GetTypeString(info...), N); + return fmt::format("{}[{}]", S::GetTypeName(info...), N); } } } +template + requires StructSerializable +constexpr auto MakeStructArrayTypeString(const I&... info) { + using S = Struct...>; + if constexpr (sizeof...(I) == 0 && + is_constexpr([&] { S::GetTypeName(info...); })) { + using namespace literals; + return Concat("struct:"_ct_string, MakeStructArrayTypeName(info...)); + } else { + return fmt::format("struct:{}", MakeStructArrayTypeName(info...)); + } +} + template requires StructSerializable constexpr auto MakeStructArraySchema(const I&... info) { @@ -336,7 +370,7 @@ void ForEachStructSchema( if constexpr (HasNestedStruct) { S::ForEachNested(fn, info...); } - fn(S::GetTypeString(info...), S::GetSchema(info...)); + fn(GetStructTypeString(info...), S::GetSchema(info...)); } template @@ -397,8 +431,8 @@ class StructArrayBuffer { template requires StructSerializable struct Struct, I...> { - static constexpr auto GetTypeString(const I&... info) { - return MakeStructArrayTypeString(info...); + static constexpr auto GetTypeName(const I&... info) { + return MakeStructArrayTypeName(info...); } static constexpr size_t GetSize(const I&... info) { return N * GetStructSize(info...); @@ -447,7 +481,7 @@ struct Struct, I...> { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:bool"; } + static constexpr std::string_view GetTypeName() { return "bool"; } static constexpr size_t GetSize() { return 1; } static constexpr std::string_view GetSchema() { return "bool value"; } static bool Unpack(std::span data) { return data[0]; } @@ -462,7 +496,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:uint8"; } + static constexpr std::string_view GetTypeName() { return "uint8"; } static constexpr size_t GetSize() { return 1; } static constexpr std::string_view GetSchema() { return "uint8 value"; } static uint8_t Unpack(std::span data) { return data[0]; } @@ -475,7 +509,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:int8"; } + static constexpr std::string_view GetTypeName() { return "int8"; } static constexpr size_t GetSize() { return 1; } static constexpr std::string_view GetSchema() { return "int8 value"; } static int8_t Unpack(std::span data) { return data[0]; } @@ -488,7 +522,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:uint16"; } + static constexpr std::string_view GetTypeName() { return "uint16"; } static constexpr size_t GetSize() { return 2; } static constexpr std::string_view GetSchema() { return "uint16 value"; } static uint16_t Unpack(std::span data) { @@ -505,7 +539,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:int16"; } + static constexpr std::string_view GetTypeName() { return "int16"; } static constexpr size_t GetSize() { return 2; } static constexpr std::string_view GetSchema() { return "int16 value"; } static int16_t Unpack(std::span data) { @@ -522,7 +556,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:uint32"; } + static constexpr std::string_view GetTypeName() { return "uint32"; } static constexpr size_t GetSize() { return 4; } static constexpr std::string_view GetSchema() { return "uint32 value"; } static uint32_t Unpack(std::span data) { @@ -539,7 +573,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:int32"; } + static constexpr std::string_view GetTypeName() { return "int32"; } static constexpr size_t GetSize() { return 4; } static constexpr std::string_view GetSchema() { return "int32 value"; } static int32_t Unpack(std::span data) { @@ -556,7 +590,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:uint64"; } + static constexpr std::string_view GetTypeName() { return "uint64"; } static constexpr size_t GetSize() { return 8; } static constexpr std::string_view GetSchema() { return "uint64 value"; } static uint64_t Unpack(std::span data) { @@ -573,7 +607,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:int64"; } + static constexpr std::string_view GetTypeName() { return "int64"; } static constexpr size_t GetSize() { return 8; } static constexpr std::string_view GetSchema() { return "int64 value"; } static int64_t Unpack(std::span data) { @@ -590,7 +624,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:float"; } + static constexpr std::string_view GetTypeName() { return "float"; } static constexpr size_t GetSize() { return 4; } static constexpr std::string_view GetSchema() { return "float value"; } static float Unpack(std::span data) { @@ -607,7 +641,7 @@ struct Struct { */ template <> struct Struct { - static constexpr std::string_view GetTypeString() { return "struct:double"; } + static constexpr std::string_view GetTypeName() { return "double"; } static constexpr size_t GetSize() { return 8; } static constexpr std::string_view GetSchema() { return "double value"; } static double Unpack(std::span data) { diff --git a/wpiutil/src/test/java/edu/wpi/first/util/datalog/DataLogTest.java b/wpiutil/src/test/java/edu/wpi/first/util/datalog/DataLogTest.java index c84d2846c4..b6d140bfbd 100644 --- a/wpiutil/src/test/java/edu/wpi/first/util/datalog/DataLogTest.java +++ b/wpiutil/src/test/java/edu/wpi/first/util/datalog/DataLogTest.java @@ -27,8 +27,8 @@ class DataLogTest { } @Override - public String getTypeString() { - return "struct:Thing"; + public String getTypeName() { + return "Thing"; } @Override @@ -84,8 +84,8 @@ class DataLogTest { } @Override - public String getTypeString() { - return "struct:Thing"; + public String getTypeName() { + return "Thing"; } @Override @@ -156,8 +156,8 @@ class DataLogTest { } @Override - public String getTypeString() { - return "struct:Thing"; + public String getTypeName() { + return "Thing"; } @Override diff --git a/wpiutil/src/test/native/cpp/DataLogTest.cpp b/wpiutil/src/test/native/cpp/DataLogTest.cpp index aa0a79188f..cc94adf88f 100644 --- a/wpiutil/src/test/native/cpp/DataLogTest.cpp +++ b/wpiutil/src/test/native/cpp/DataLogTest.cpp @@ -39,7 +39,7 @@ struct Info2 { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:ThingA"; } + static constexpr std::string_view GetTypeName() { return "ThingA"; } static constexpr size_t GetSize() { return 1; } static constexpr std::string_view GetSchema() { return "uint8 value"; } static ThingA Unpack(std::span data) { @@ -52,8 +52,8 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString(const Info1&) { - return "struct:ThingB"; + static constexpr std::string_view GetTypeName(const Info1&) { + return "ThingB"; } static constexpr size_t GetSize(const Info1&) { return 1; } static constexpr std::string_view GetSchema(const Info1&) { @@ -69,7 +69,7 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString() { return "struct:ThingC"; } + static constexpr std::string_view GetTypeName() { return "ThingC"; } static constexpr size_t GetSize() { return 1; } static constexpr std::string_view GetSchema() { return "uint8 value"; } static ThingC Unpack(std::span data) { @@ -82,8 +82,8 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString(const Info1&) { - return "struct:ThingC"; + static constexpr std::string_view GetTypeName(const Info1&) { + return "ThingC"; } static constexpr size_t GetSize(const Info1&) { return 1; } static constexpr std::string_view GetSchema(const Info1&) { @@ -99,8 +99,8 @@ struct wpi::Struct { template <> struct wpi::Struct { - static constexpr std::string_view GetTypeString(const Info2&) { - return "struct:ThingC"; + static constexpr std::string_view GetTypeName(const Info2&) { + return "ThingC"; } static constexpr size_t GetSize(const Info2&) { return 1; } static constexpr std::string_view GetSchema(const Info2&) {