[commands] Merge CommandBase into Command and SubsystemBase into Subsystem (#5392)

Moves all CommandBase functionality into Command and deprecates CommandBase for removal.
Moves all SubsystemBase functionality into Subsystem and deprecates SubsystemBase for removal.
Adds a function to CommandScheduler to remove all registered Subsystems.
This commit is contained in:
Ryan Blue
2023-07-14 01:12:01 -04:00
committed by GitHub
parent 7ac932996a
commit aaea85ff16
176 changed files with 887 additions and 910 deletions

View File

@@ -4,11 +4,7 @@
#pragma once
#include <string>
#include <string_view>
#include <wpi/sendable/Sendable.h>
#include <wpi/sendable/SendableHelper.h>
#include <wpi/deprecated.h>
#include "frc2/command/Subsystem.h"
@@ -18,51 +14,13 @@ namespace frc2 {
* provides a more intuitive method for setting the default command.
*
* This class is provided by the NewCommands VendorDep
*
* @deprecated All functionality provided by SubsystemBase has been merged into
* Subsystem. Use Subsystem instead.
*/
class SubsystemBase : public Subsystem,
public wpi::Sendable,
public wpi::SendableHelper<SubsystemBase> {
public:
void InitSendable(wpi::SendableBuilder& builder) override;
/**
* Gets the name of this Subsystem.
*
* @return Name
*/
std::string GetName() const;
/**
* Sets the name of this Subsystem.
*
* @param name name
*/
void SetName(std::string_view name);
/**
* Gets the subsystem name of this Subsystem.
*
* @return Subsystem name
*/
std::string GetSubsystem() const;
/**
* Sets the subsystem name of this Subsystem.
*
* @param name subsystem name
*/
void SetSubsystem(std::string_view name);
/**
* Associate a Sendable with this Subsystem.
* Also update the child's name.
*
* @param name name to give child
* @param child sendable
*/
void AddChild(std::string name, wpi::Sendable* child);
class [[deprecated("Use Subsystem instead")]] SubsystemBase : public Subsystem {
protected:
WPI_DEPRECATED("Use Subsystem instead")
SubsystemBase();
};
} // namespace frc2