mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
[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:
@@ -11,7 +11,7 @@
|
||||
|
||||
template <>
|
||||
struct WPILIB_DLLEXPORT wpi::Struct<frc::DCMotor> {
|
||||
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 "
|
||||
|
||||
Reference in New Issue
Block a user