mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
clang-tidy: modernize-use-override (NFC)
Add NOLINT to CommandTestBase due to gmock not adding "override" keyword, which causes warnings on clang.
This commit is contained in:
@@ -14,12 +14,12 @@ class Command;
|
||||
class CancelButtonScheduler : public ButtonScheduler {
|
||||
public:
|
||||
CancelButtonScheduler(bool last, Trigger* button, Command* orders);
|
||||
virtual ~CancelButtonScheduler() = default;
|
||||
~CancelButtonScheduler() override = default;
|
||||
|
||||
CancelButtonScheduler(CancelButtonScheduler&&) = default;
|
||||
CancelButtonScheduler& operator=(CancelButtonScheduler&&) = default;
|
||||
|
||||
virtual void Execute();
|
||||
void Execute() override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -14,12 +14,12 @@ class Command;
|
||||
class HeldButtonScheduler : public ButtonScheduler {
|
||||
public:
|
||||
HeldButtonScheduler(bool last, Trigger* button, Command* orders);
|
||||
virtual ~HeldButtonScheduler() = default;
|
||||
~HeldButtonScheduler() override = default;
|
||||
|
||||
HeldButtonScheduler(HeldButtonScheduler&&) = default;
|
||||
HeldButtonScheduler& operator=(HeldButtonScheduler&&) = default;
|
||||
|
||||
virtual void Execute();
|
||||
void Execute() override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -12,7 +12,7 @@ class InternalButton : public Button {
|
||||
public:
|
||||
InternalButton() = default;
|
||||
explicit InternalButton(bool inverted);
|
||||
virtual ~InternalButton() = default;
|
||||
~InternalButton() override = default;
|
||||
|
||||
InternalButton(InternalButton&&) = default;
|
||||
InternalButton& operator=(InternalButton&&) = default;
|
||||
@@ -20,7 +20,7 @@ class InternalButton : public Button {
|
||||
void SetInverted(bool inverted);
|
||||
void SetPressed(bool pressed);
|
||||
|
||||
virtual bool Get();
|
||||
bool Get() override;
|
||||
|
||||
private:
|
||||
bool m_pressed = false;
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace frc {
|
||||
class JoystickButton : public Button {
|
||||
public:
|
||||
JoystickButton(GenericHID* joystick, int buttonNumber);
|
||||
virtual ~JoystickButton() = default;
|
||||
~JoystickButton() override = default;
|
||||
|
||||
JoystickButton(JoystickButton&&) = default;
|
||||
JoystickButton& operator=(JoystickButton&&) = default;
|
||||
|
||||
virtual bool Get();
|
||||
bool Get() override;
|
||||
|
||||
private:
|
||||
GenericHID* m_joystick;
|
||||
|
||||
@@ -19,12 +19,12 @@ class NetworkButton : public Button {
|
||||
NetworkButton(const wpi::Twine& tableName, const wpi::Twine& field);
|
||||
NetworkButton(std::shared_ptr<nt::NetworkTable> table,
|
||||
const wpi::Twine& field);
|
||||
virtual ~NetworkButton() = default;
|
||||
~NetworkButton() override = default;
|
||||
|
||||
NetworkButton(NetworkButton&&) = default;
|
||||
NetworkButton& operator=(NetworkButton&&) = default;
|
||||
|
||||
virtual bool Get();
|
||||
bool Get() override;
|
||||
|
||||
private:
|
||||
nt::NetworkTableEntry m_entry;
|
||||
|
||||
@@ -18,7 +18,7 @@ class POVButton : public Button {
|
||||
* @param povNumber The POV number (@see GenericHID#GetPOV)
|
||||
*/
|
||||
POVButton(GenericHID& joystick, int angle, int povNumber = 0);
|
||||
virtual ~POVButton() = default;
|
||||
~POVButton() override = default;
|
||||
|
||||
POVButton(POVButton&&) = default;
|
||||
POVButton& operator=(POVButton&&) = default;
|
||||
|
||||
@@ -14,12 +14,12 @@ class Command;
|
||||
class PressedButtonScheduler : public ButtonScheduler {
|
||||
public:
|
||||
PressedButtonScheduler(bool last, Trigger* button, Command* orders);
|
||||
virtual ~PressedButtonScheduler() = default;
|
||||
~PressedButtonScheduler() override = default;
|
||||
|
||||
PressedButtonScheduler(PressedButtonScheduler&&) = default;
|
||||
PressedButtonScheduler& operator=(PressedButtonScheduler&&) = default;
|
||||
|
||||
virtual void Execute();
|
||||
void Execute() override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -14,12 +14,12 @@ class Command;
|
||||
class ReleasedButtonScheduler : public ButtonScheduler {
|
||||
public:
|
||||
ReleasedButtonScheduler(bool last, Trigger* button, Command* orders);
|
||||
virtual ~ReleasedButtonScheduler() = default;
|
||||
~ReleasedButtonScheduler() override = default;
|
||||
|
||||
ReleasedButtonScheduler(ReleasedButtonScheduler&&) = default;
|
||||
ReleasedButtonScheduler& operator=(ReleasedButtonScheduler&&) = default;
|
||||
|
||||
virtual void Execute();
|
||||
void Execute() override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -14,12 +14,12 @@ class Command;
|
||||
class ToggleButtonScheduler : public ButtonScheduler {
|
||||
public:
|
||||
ToggleButtonScheduler(bool last, Trigger* button, Command* orders);
|
||||
virtual ~ToggleButtonScheduler() = default;
|
||||
~ToggleButtonScheduler() override = default;
|
||||
|
||||
ToggleButtonScheduler(ToggleButtonScheduler&&) = default;
|
||||
ToggleButtonScheduler& operator=(ToggleButtonScheduler&&) = default;
|
||||
|
||||
virtual void Execute();
|
||||
void Execute() override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -41,7 +41,7 @@ class CommandGroup : public Command {
|
||||
*/
|
||||
explicit CommandGroup(const wpi::Twine& name);
|
||||
|
||||
virtual ~CommandGroup() = default;
|
||||
~CommandGroup() override = default;
|
||||
|
||||
CommandGroup(CommandGroup&&) = default;
|
||||
CommandGroup& operator=(CommandGroup&&) = default;
|
||||
@@ -134,32 +134,32 @@ class CommandGroup : public Command {
|
||||
/**
|
||||
* Can be overridden by teams.
|
||||
*/
|
||||
virtual void Initialize();
|
||||
void Initialize() override;
|
||||
|
||||
/**
|
||||
* Can be overridden by teams.
|
||||
*/
|
||||
virtual void Execute();
|
||||
void Execute() override;
|
||||
|
||||
/**
|
||||
* Can be overridden by teams.
|
||||
*/
|
||||
virtual bool IsFinished();
|
||||
bool IsFinished() override;
|
||||
|
||||
/**
|
||||
* Can be overridden by teams.
|
||||
*/
|
||||
virtual void End();
|
||||
void End() override;
|
||||
|
||||
/**
|
||||
* Can be overridden by teams.
|
||||
*/
|
||||
virtual void Interrupted();
|
||||
void Interrupted() override;
|
||||
|
||||
virtual void _Initialize();
|
||||
virtual void _Execute();
|
||||
virtual void _End();
|
||||
virtual void _Interrupted();
|
||||
void _Initialize() override;
|
||||
void _Execute() override;
|
||||
void _End() override;
|
||||
void _Interrupted() override;
|
||||
|
||||
private:
|
||||
void CancelConflicts(Command* command);
|
||||
|
||||
@@ -49,7 +49,7 @@ class ConditionalCommand : public Command {
|
||||
ConditionalCommand(const wpi::Twine& name, Command* onTrue,
|
||||
Command* onFalse = nullptr);
|
||||
|
||||
virtual ~ConditionalCommand() = default;
|
||||
~ConditionalCommand() override = default;
|
||||
|
||||
ConditionalCommand(ConditionalCommand&&) = default;
|
||||
ConditionalCommand& operator=(ConditionalCommand&&) = default;
|
||||
|
||||
@@ -76,7 +76,7 @@ class InstantCommand : public Command {
|
||||
std::function<void()> func);
|
||||
|
||||
InstantCommand() = default;
|
||||
virtual ~InstantCommand() = default;
|
||||
~InstantCommand() override = default;
|
||||
|
||||
InstantCommand(InstantCommand&&) = default;
|
||||
InstantCommand& operator=(InstantCommand&&) = default;
|
||||
|
||||
@@ -35,7 +35,7 @@ class PIDCommand : public Command, public PIDOutput, public PIDSource {
|
||||
PIDCommand(double p, double i, double d, double period, Subsystem& subsystem);
|
||||
PIDCommand(double p, double i, double d, double f, double period,
|
||||
Subsystem& subsystem);
|
||||
virtual ~PIDCommand() = default;
|
||||
~PIDCommand() override = default;
|
||||
|
||||
PIDCommand(PIDCommand&&) = default;
|
||||
PIDCommand& operator=(PIDCommand&&) = default;
|
||||
|
||||
@@ -15,13 +15,13 @@ namespace frc {
|
||||
class PrintCommand : public InstantCommand {
|
||||
public:
|
||||
explicit PrintCommand(const wpi::Twine& message);
|
||||
virtual ~PrintCommand() = default;
|
||||
~PrintCommand() override = default;
|
||||
|
||||
PrintCommand(PrintCommand&&) = default;
|
||||
PrintCommand& operator=(PrintCommand&&) = default;
|
||||
|
||||
protected:
|
||||
virtual void Initialize();
|
||||
void Initialize() override;
|
||||
|
||||
private:
|
||||
std::string m_message;
|
||||
|
||||
@@ -11,13 +11,13 @@ namespace frc {
|
||||
class StartCommand : public InstantCommand {
|
||||
public:
|
||||
explicit StartCommand(Command* commandToStart);
|
||||
virtual ~StartCommand() = default;
|
||||
~StartCommand() override = default;
|
||||
|
||||
StartCommand(StartCommand&&) = default;
|
||||
StartCommand& operator=(StartCommand&&) = default;
|
||||
|
||||
protected:
|
||||
virtual void Initialize();
|
||||
void Initialize() override;
|
||||
|
||||
private:
|
||||
Command* m_commandToFork;
|
||||
|
||||
@@ -49,7 +49,7 @@ class TimedCommand : public Command {
|
||||
*/
|
||||
TimedCommand(double timeout, Subsystem& subsystem);
|
||||
|
||||
virtual ~TimedCommand() = default;
|
||||
~TimedCommand() override = default;
|
||||
|
||||
TimedCommand(TimedCommand&&) = default;
|
||||
TimedCommand& operator=(TimedCommand&&) = default;
|
||||
|
||||
@@ -27,7 +27,7 @@ class WaitCommand : public TimedCommand {
|
||||
*/
|
||||
WaitCommand(const wpi::Twine& name, double timeout);
|
||||
|
||||
virtual ~WaitCommand() = default;
|
||||
~WaitCommand() override = default;
|
||||
|
||||
WaitCommand(WaitCommand&&) = default;
|
||||
WaitCommand& operator=(WaitCommand&&) = default;
|
||||
|
||||
@@ -14,13 +14,13 @@ class WaitForChildren : public Command {
|
||||
public:
|
||||
explicit WaitForChildren(double timeout);
|
||||
WaitForChildren(const wpi::Twine& name, double timeout);
|
||||
virtual ~WaitForChildren() = default;
|
||||
~WaitForChildren() override = default;
|
||||
|
||||
WaitForChildren(WaitForChildren&&) = default;
|
||||
WaitForChildren& operator=(WaitForChildren&&) = default;
|
||||
|
||||
protected:
|
||||
virtual bool IsFinished();
|
||||
bool IsFinished() override;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
@@ -24,7 +24,7 @@ class WaitUntilCommand : public Command {
|
||||
|
||||
WaitUntilCommand(const wpi::Twine& name, double time);
|
||||
|
||||
virtual ~WaitUntilCommand() = default;
|
||||
~WaitUntilCommand() override = default;
|
||||
|
||||
WaitUntilCommand(WaitUntilCommand&&) = default;
|
||||
WaitUntilCommand& operator=(WaitUntilCommand&&) = default;
|
||||
@@ -33,7 +33,7 @@ class WaitUntilCommand : public Command {
|
||||
/**
|
||||
* Check if we've reached the actual finish time.
|
||||
*/
|
||||
virtual bool IsFinished();
|
||||
bool IsFinished() override;
|
||||
|
||||
private:
|
||||
double m_time;
|
||||
|
||||
Reference in New Issue
Block a user