diff --git a/cscore/src/main/native/cpp/MjpegServerImpl.cpp b/cscore/src/main/native/cpp/MjpegServerImpl.cpp index a5196c1a53..4ffded64bc 100644 --- a/cscore/src/main/native/cpp/MjpegServerImpl.cpp +++ b/cscore/src/main/native/cpp/MjpegServerImpl.cpp @@ -75,7 +75,7 @@ class MjpegServerImpl::ConnThread : public wpi::SafeThread { explicit ConnThread(const wpi::Twine& name, wpi::Logger& logger) : m_name(name.str()), m_logger(logger) {} - void Main(); + void Main() override; bool ProcessCommand(wpi::raw_ostream& os, SourceImpl& source, wpi::StringRef parameters, bool respond); diff --git a/cscore/src/main/native/cpp/Notifier.cpp b/cscore/src/main/native/cpp/Notifier.cpp index f79e0b4488..d385bb583c 100644 --- a/cscore/src/main/native/cpp/Notifier.cpp +++ b/cscore/src/main/native/cpp/Notifier.cpp @@ -68,7 +68,7 @@ class Notifier::Thread : public wpi::SafeThread { Thread(std::function on_start, std::function on_exit) : m_on_start(on_start), m_on_exit(on_exit) {} - void Main(); + void Main() override; struct Listener { Listener() = default; diff --git a/cscore/src/main/native/cpp/SinkImpl.h b/cscore/src/main/native/cpp/SinkImpl.h index 14d4199b08..5c8faa42e7 100644 --- a/cscore/src/main/native/cpp/SinkImpl.h +++ b/cscore/src/main/native/cpp/SinkImpl.h @@ -29,7 +29,7 @@ class SinkImpl : public PropertyContainer { public: explicit SinkImpl(const wpi::Twine& name, wpi::Logger& logger, Notifier& notifier, Telemetry& telemetry); - virtual ~SinkImpl(); + ~SinkImpl() override; SinkImpl(const SinkImpl& queue) = delete; SinkImpl& operator=(const SinkImpl& queue) = delete; diff --git a/cscore/src/main/native/cpp/SourceImpl.h b/cscore/src/main/native/cpp/SourceImpl.h index 6f78b5160e..9b7fae4175 100644 --- a/cscore/src/main/native/cpp/SourceImpl.h +++ b/cscore/src/main/native/cpp/SourceImpl.h @@ -39,7 +39,7 @@ class SourceImpl : public PropertyContainer { public: SourceImpl(const wpi::Twine& name, wpi::Logger& logger, Notifier& notifier, Telemetry& telemetry); - virtual ~SourceImpl(); + ~SourceImpl() override; SourceImpl(const SourceImpl& oth) = delete; SourceImpl& operator=(const SourceImpl& oth) = delete; diff --git a/cscore/src/main/native/cpp/Telemetry.cpp b/cscore/src/main/native/cpp/Telemetry.cpp index de5168d19a..c57b55b461 100644 --- a/cscore/src/main/native/cpp/Telemetry.cpp +++ b/cscore/src/main/native/cpp/Telemetry.cpp @@ -22,7 +22,7 @@ class Telemetry::Thread : public wpi::SafeThread { public: explicit Thread(Notifier& notifier) : m_notifier(notifier) {} - void Main(); + void Main() override; Notifier& m_notifier; wpi::DenseMap, int64_t> m_user; diff --git a/cscore/src/main/native/linux/NetworkListener.cpp b/cscore/src/main/native/linux/NetworkListener.cpp index 63f2070f37..bab556fb9b 100644 --- a/cscore/src/main/native/linux/NetworkListener.cpp +++ b/cscore/src/main/native/linux/NetworkListener.cpp @@ -34,7 +34,7 @@ class NetworkListener::Impl { public: Thread(wpi::Logger& logger, Notifier& notifier) : m_logger(logger), m_notifier(notifier) {} - void Main(); + void Main() override; wpi::Logger& m_logger; Notifier& m_notifier; diff --git a/hal/src/main/native/athena/Interrupts.cpp b/hal/src/main/native/athena/Interrupts.cpp index 7cdac4e0f4..4e22c27446 100644 --- a/hal/src/main/native/athena/Interrupts.cpp +++ b/hal/src/main/native/athena/Interrupts.cpp @@ -24,7 +24,7 @@ namespace { // Safe thread to allow callbacks to run on their own thread class InterruptThread : public wpi::SafeThread { public: - void Main() { + void Main() override { std::unique_lock lock(m_mutex); while (m_active) { m_cond.wait(lock, [&] { return !m_active || m_notify; }); diff --git a/hal/src/main/native/cpp/jni/InterruptJNI.cpp b/hal/src/main/native/cpp/jni/InterruptJNI.cpp index d6c366a2e6..0eebdf14b7 100644 --- a/hal/src/main/native/cpp/jni/InterruptJNI.cpp +++ b/hal/src/main/native/cpp/jni/InterruptJNI.cpp @@ -31,7 +31,7 @@ using namespace hal; // process, we will just ignore the redundant wakeup. class InterruptThreadJNI : public wpi::SafeThread { public: - void Main(); + void Main() override; bool m_notify = false; uint32_t m_mask = 0; diff --git a/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h b/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h index 3292753d0c..d96de2bba4 100644 --- a/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h +++ b/hal/src/main/native/include/hal/handles/IndexedClassedHandleResource.h @@ -49,7 +49,7 @@ class IndexedClassedHandleResource : public HandleBase { } std::shared_ptr Get(THandle handle); void Free(THandle handle); - void ResetHandles(); + void ResetHandles() override; private: std::array, size> m_structures; diff --git a/ntcore/src/main/native/cpp/CallbackManager.h b/ntcore/src/main/native/cpp/CallbackManager.h index 34c4a6afc3..e48ba7dab7 100644 --- a/ntcore/src/main/native/cpp/CallbackManager.h +++ b/ntcore/src/main/native/cpp/CallbackManager.h @@ -54,7 +54,7 @@ class CallbackThread : public wpi::SafeThread { using NotifierData = TNotifierData; using ListenerData = TListenerData; - ~CallbackThread() { + ~CallbackThread() override { // Wake up any blocked pollers for (size_t i = 0; i < m_pollers.size(); ++i) { if (auto poller = m_pollers[i]) { diff --git a/ntcore/src/main/native/cpp/Dispatcher.h b/ntcore/src/main/native/cpp/Dispatcher.h index 9564c37b24..bbe9ad9745 100644 --- a/ntcore/src/main/native/cpp/Dispatcher.h +++ b/ntcore/src/main/native/cpp/Dispatcher.h @@ -41,7 +41,7 @@ class DispatcherBase : public IDispatcher { DispatcherBase(IStorage& storage, IConnectionNotifier& notifier, wpi::Logger& logger); - virtual ~DispatcherBase(); + ~DispatcherBase() override; unsigned int GetNetworkMode() const; void StartLocal(); diff --git a/ntcore/src/main/native/cpp/DsClient.cpp b/ntcore/src/main/native/cpp/DsClient.cpp index 5cdece80c5..073be143fa 100644 --- a/ntcore/src/main/native/cpp/DsClient.cpp +++ b/ntcore/src/main/native/cpp/DsClient.cpp @@ -19,7 +19,7 @@ class DsClient::Thread : public wpi::SafeThread { Thread(Dispatcher& dispatcher, wpi::Logger& logger, unsigned int port) : m_dispatcher(dispatcher), m_logger(logger), m_port(port) {} - void Main(); + void Main() override; Dispatcher& m_dispatcher; wpi::Logger& m_logger; diff --git a/ntcore/src/main/native/cpp/NetworkConnection.h b/ntcore/src/main/native/cpp/NetworkConnection.h index f6779174d4..3e2b8111b2 100644 --- a/ntcore/src/main/native/cpp/NetworkConnection.h +++ b/ntcore/src/main/native/cpp/NetworkConnection.h @@ -49,7 +49,7 @@ class NetworkConnection : public INetworkConnection { IConnectionNotifier& notifier, wpi::Logger& logger, HandshakeFunc handshake, Message::GetEntryTypeFunc get_entry_type); - ~NetworkConnection(); + ~NetworkConnection() override; // Set the input processor function. This must be called before Start(). void set_process_incoming(ProcessIncomingFunc func) { diff --git a/ntcore/src/main/native/cpp/Storage.h b/ntcore/src/main/native/cpp/Storage.h index 9057f0f99e..73bc0c617c 100644 --- a/ntcore/src/main/native/cpp/Storage.h +++ b/ntcore/src/main/native/cpp/Storage.h @@ -47,7 +47,7 @@ class Storage : public IStorage { Storage(const Storage&) = delete; Storage& operator=(const Storage&) = delete; - ~Storage(); + ~Storage() override; // Accessors required by Dispatcher. An interface is used for // generation of outgoing messages to break a dependency loop between diff --git a/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp b/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp index b88e55eb3f..d5bf569a41 100644 --- a/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/EncoderSimGui.cpp @@ -56,7 +56,7 @@ class EncoderSimModel : public glass::EncoderModel { : EncoderSimModel(index, HALSIM_GetEncoderDigitalChannelA(index), HALSIM_GetEncoderDigitalChannelB(index)) {} - ~EncoderSimModel() { + ~EncoderSimModel() override { if (m_distancePerPulseCallback != 0) { HALSIM_CancelEncoderDistancePerPulseCallback(m_index, m_distancePerPulseCallback); diff --git a/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp b/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp index 778a7ab9ab..95a92f1e0f 100644 --- a/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp +++ b/simulation/halsim_gui/src/main/native/cpp/SimDeviceGui.cpp @@ -24,7 +24,7 @@ class SimValueSource : public glass::DataSource { : DataSource(wpi::Twine{device} + wpi::Twine{'-'} + name), m_callback{HALSIM_RegisterSimValueChangedCallback( handle, this, CallbackFunc, true)} {} - ~SimValueSource() { + ~SimValueSource() override { if (m_callback != 0) { HALSIM_CancelSimValueChangedCallback(m_callback); } diff --git a/simulation/halsim_ws_core/src/main/native/include/WSHalProviders.h b/simulation/halsim_ws_core/src/main/native/include/WSHalProviders.h index d83d68850f..1771a81176 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSHalProviders.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSHalProviders.h @@ -27,8 +27,9 @@ class HALSimWSHalProvider : public HALSimWSBaseProvider { public: using HALSimWSBaseProvider::HALSimWSBaseProvider; - void OnNetworkConnected(std::shared_ptr ws); - void OnNetworkDisconnected(); + void OnNetworkConnected( + std::shared_ptr ws) override; + void OnNetworkDisconnected() override; void ProcessHalCallback(const wpi::json& payload); diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Analog.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Analog.h index f57abd71bd..a2f07d1f00 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Analog.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Analog.h @@ -15,7 +15,7 @@ class HALSimWSProviderAnalogIn : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderAnalogIn(); + ~HALSimWSProviderAnalogIn() override; void OnNetValueChanged(const wpi::json& json) override; @@ -41,7 +41,7 @@ class HALSimWSProviderAnalogOut : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderAnalogOut(); + ~HALSimWSProviderAnalogOut() override; protected: void RegisterCallbacks() override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_BuiltInAccelerometer.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_BuiltInAccelerometer.h index f369c2303d..62568e7e9d 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_BuiltInAccelerometer.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_BuiltInAccelerometer.h @@ -13,7 +13,7 @@ class HALSimWSProviderBuiltInAccelerometer : public HALSimWSHalProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalProvider::HALSimWSHalProvider; - ~HALSimWSProviderBuiltInAccelerometer(); + ~HALSimWSProviderBuiltInAccelerometer() override; void OnNetValueChanged(const wpi::json& json) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_DIO.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_DIO.h index c48ced01a7..5fc3296de8 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_DIO.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_DIO.h @@ -15,7 +15,7 @@ class HALSimWSProviderDIO : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderDIO(); + ~HALSimWSProviderDIO() override; void OnNetValueChanged(const wpi::json& json) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_DriverStation.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_DriverStation.h index 38e39204ff..f164a70eb5 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_DriverStation.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_DriverStation.h @@ -15,7 +15,7 @@ class HALSimWSProviderDriverStation : public HALSimWSHalProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalProvider::HALSimWSHalProvider; - ~HALSimWSProviderDriverStation(); + ~HALSimWSProviderDriverStation() override; void OnNetValueChanged(const wpi::json& json) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Encoder.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Encoder.h index f00284178a..b7601b3e55 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Encoder.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Encoder.h @@ -15,7 +15,7 @@ class HALSimWSProviderEncoder : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderEncoder(); + ~HALSimWSProviderEncoder() override; void OnNetValueChanged(const wpi::json& json) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Joystick.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Joystick.h index 3056313860..edabad0cc4 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Joystick.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Joystick.h @@ -15,7 +15,7 @@ class HALSimWSProviderJoystick : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderJoystick(); + ~HALSimWSProviderJoystick() override; void OnNetValueChanged(const wpi::json& json) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_PWM.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_PWM.h index 046b58d96f..badb02d34b 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_PWM.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_PWM.h @@ -15,7 +15,7 @@ class HALSimWSProviderPWM : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderPWM(); + ~HALSimWSProviderPWM() override; protected: void RegisterCallbacks() override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Relay.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Relay.h index 01c7e9e94f..d7128653f6 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_Relay.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_Relay.h @@ -15,7 +15,7 @@ class HALSimWSProviderRelay : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderRelay(); + ~HALSimWSProviderRelay() override; protected: void RegisterCallbacks() override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_RoboRIO.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_RoboRIO.h index c3969b75e4..0b8e44ee94 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_RoboRIO.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_RoboRIO.h @@ -15,7 +15,7 @@ class HALSimWSProviderRoboRIO : public HALSimWSHalProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalProvider::HALSimWSHalProvider; - ~HALSimWSProviderRoboRIO(); + ~HALSimWSProviderRoboRIO() override; void OnNetValueChanged(const wpi::json& json) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_SimDevice.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_SimDevice.h index 82ae89cfd4..ff9314e7ba 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_SimDevice.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_SimDevice.h @@ -39,7 +39,7 @@ class HALSimWSProviderSimDevice : public HALSimWSBaseProvider { m_deviceId = deviceId; } - ~HALSimWSProviderSimDevice(); + ~HALSimWSProviderSimDevice() override; void OnNetworkConnected( std::shared_ptr ws) override; diff --git a/simulation/halsim_ws_core/src/main/native/include/WSProvider_dPWM.h b/simulation/halsim_ws_core/src/main/native/include/WSProvider_dPWM.h index f58ae59ccd..0340a59837 100644 --- a/simulation/halsim_ws_core/src/main/native/include/WSProvider_dPWM.h +++ b/simulation/halsim_ws_core/src/main/native/include/WSProvider_dPWM.h @@ -15,7 +15,7 @@ class HALSimWSProviderDigitalPWM : public HALSimWSHalChanProvider { static void Initialize(WSRegisterFunc webRegisterFunc); using HALSimWSHalChanProvider::HALSimWSHalChanProvider; - ~HALSimWSProviderDigitalPWM(); + ~HALSimWSProviderDigitalPWM() override; protected: void RegisterCallbacks() override; diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h index a0bb7ca0db..bc5edb59fe 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h @@ -49,7 +49,7 @@ class ProxyScheduleCommand; class Command : public frc::ErrorBase { public: Command() = default; - virtual ~Command(); + ~Command() override; Command(const Command&); Command& operator=(const Command&); diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/CommandScheduler.h b/wpilibNewCommands/src/main/native/include/frc2/command/CommandScheduler.h index b5de2219ab..f9f5f37984 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/CommandScheduler.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/CommandScheduler.h @@ -39,7 +39,7 @@ class CommandScheduler final : public frc::Sendable, */ static CommandScheduler& GetInstance(); - ~CommandScheduler(); + ~CommandScheduler() override; CommandScheduler(const CommandScheduler&) = delete; CommandScheduler& operator=(const CommandScheduler&) = delete; diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h b/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h index 9d35ede424..e04ceea9f3 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/RunCommand.h @@ -45,7 +45,7 @@ class RunCommand : public CommandHelper { RunCommand(const RunCommand& other) = default; - void Execute(); + void Execute() override; protected: std::function m_toRun; diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandTestBase.h b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandTestBase.h index 66fde8f9a7..912936ba9f 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandTestBase.h +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandTestBase.h @@ -72,13 +72,13 @@ class CommandTestBase : public ::testing::Test { .WillRepeatedly(::testing::Return(finished)); } - ~MockCommand() { + ~MockCommand() { // NOLINT auto& scheduler = CommandScheduler::GetInstance(); scheduler.Cancel(this); } protected: - std::unique_ptr TransferOwnership() && { + std::unique_ptr TransferOwnership() && { // NOLINT return std::make_unique(std::move(*this)); } diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/CancelButtonScheduler.h b/wpilibOldCommands/src/main/native/include/frc/buttons/CancelButtonScheduler.h index 6448abc6b4..c3938eb4c1 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/CancelButtonScheduler.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/CancelButtonScheduler.h @@ -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 diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/HeldButtonScheduler.h b/wpilibOldCommands/src/main/native/include/frc/buttons/HeldButtonScheduler.h index 19b9ebbbac..721688fa52 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/HeldButtonScheduler.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/HeldButtonScheduler.h @@ -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 diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/InternalButton.h b/wpilibOldCommands/src/main/native/include/frc/buttons/InternalButton.h index 84f79f6e73..e9c1fb1a78 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/InternalButton.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/InternalButton.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/JoystickButton.h b/wpilibOldCommands/src/main/native/include/frc/buttons/JoystickButton.h index a4cd877c9a..24900b4bd1 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/JoystickButton.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/JoystickButton.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/NetworkButton.h b/wpilibOldCommands/src/main/native/include/frc/buttons/NetworkButton.h index ae8c9b1d1e..7a2a27c1f2 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/NetworkButton.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/NetworkButton.h @@ -19,12 +19,12 @@ class NetworkButton : public Button { NetworkButton(const wpi::Twine& tableName, const wpi::Twine& field); NetworkButton(std::shared_ptr 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; diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/POVButton.h b/wpilibOldCommands/src/main/native/include/frc/buttons/POVButton.h index fb0e90326e..87e1789dbc 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/POVButton.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/POVButton.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/PressedButtonScheduler.h b/wpilibOldCommands/src/main/native/include/frc/buttons/PressedButtonScheduler.h index 4c858f5bf5..378d2c5f5c 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/PressedButtonScheduler.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/PressedButtonScheduler.h @@ -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 diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/ReleasedButtonScheduler.h b/wpilibOldCommands/src/main/native/include/frc/buttons/ReleasedButtonScheduler.h index cac6968461..6ed53eecbc 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/ReleasedButtonScheduler.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/ReleasedButtonScheduler.h @@ -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 diff --git a/wpilibOldCommands/src/main/native/include/frc/buttons/ToggleButtonScheduler.h b/wpilibOldCommands/src/main/native/include/frc/buttons/ToggleButtonScheduler.h index a41144770a..8df27a9b27 100644 --- a/wpilibOldCommands/src/main/native/include/frc/buttons/ToggleButtonScheduler.h +++ b/wpilibOldCommands/src/main/native/include/frc/buttons/ToggleButtonScheduler.h @@ -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 diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/CommandGroup.h b/wpilibOldCommands/src/main/native/include/frc/commands/CommandGroup.h index a344c52aa9..2f34946bea 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/CommandGroup.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/CommandGroup.h @@ -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); diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/ConditionalCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/ConditionalCommand.h index acbebdcadd..7c28dd3731 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/ConditionalCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/ConditionalCommand.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/InstantCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/InstantCommand.h index 546fc0821e..90b895245c 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/InstantCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/InstantCommand.h @@ -76,7 +76,7 @@ class InstantCommand : public Command { std::function func); InstantCommand() = default; - virtual ~InstantCommand() = default; + ~InstantCommand() override = default; InstantCommand(InstantCommand&&) = default; InstantCommand& operator=(InstantCommand&&) = default; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/PIDCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/PIDCommand.h index b7f4bc7faa..52e00d2c76 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/PIDCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/PIDCommand.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/PrintCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/PrintCommand.h index 9f538f1d3c..4a48647f3c 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/PrintCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/PrintCommand.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/StartCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/StartCommand.h index 59a0471f38..a58c0587c4 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/StartCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/StartCommand.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/TimedCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/TimedCommand.h index 33998c70fe..710cf93a22 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/TimedCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/TimedCommand.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/WaitCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/WaitCommand.h index a6c2c5ff17..d1ca7997c1 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/WaitCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/WaitCommand.h @@ -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; diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/WaitForChildren.h b/wpilibOldCommands/src/main/native/include/frc/commands/WaitForChildren.h index 60e9b1e1b9..87334ec82b 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/WaitForChildren.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/WaitForChildren.h @@ -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 diff --git a/wpilibOldCommands/src/main/native/include/frc/commands/WaitUntilCommand.h b/wpilibOldCommands/src/main/native/include/frc/commands/WaitUntilCommand.h index 53db19731c..46c3fc4c01 100644 --- a/wpilibOldCommands/src/main/native/include/frc/commands/WaitUntilCommand.h +++ b/wpilibOldCommands/src/main/native/include/frc/commands/WaitUntilCommand.h @@ -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; diff --git a/wpilibc/src/main/native/include/frc/DigitalSource.h b/wpilibc/src/main/native/include/frc/DigitalSource.h index 9e89e9ee15..b29c37987c 100644 --- a/wpilibc/src/main/native/include/frc/DigitalSource.h +++ b/wpilibc/src/main/native/include/frc/DigitalSource.h @@ -25,8 +25,8 @@ class DigitalSource : public InterruptableSensorBase { DigitalSource(DigitalSource&&) = default; DigitalSource& operator=(DigitalSource&&) = default; - virtual HAL_Handle GetPortHandleForRouting() const = 0; - virtual AnalogTriggerType GetAnalogTriggerTypeForRouting() const = 0; + HAL_Handle GetPortHandleForRouting() const override = 0; + AnalogTriggerType GetAnalogTriggerTypeForRouting() const override = 0; virtual bool IsAnalogTrigger() const = 0; virtual int GetChannel() const = 0; }; diff --git a/wpilibc/src/main/native/include/frc/GenericHID.h b/wpilibc/src/main/native/include/frc/GenericHID.h index 12ab653f74..e441204034 100644 --- a/wpilibc/src/main/native/include/frc/GenericHID.h +++ b/wpilibc/src/main/native/include/frc/GenericHID.h @@ -44,7 +44,7 @@ class GenericHID : public ErrorBase { enum JoystickHand { kLeftHand = 0, kRightHand = 1 }; explicit GenericHID(int port); - virtual ~GenericHID() = default; + ~GenericHID() override = default; GenericHID(GenericHID&&) = default; GenericHID& operator=(GenericHID&&) = default; diff --git a/wpilibc/src/main/native/include/frc/InterruptableSensorBase.h b/wpilibc/src/main/native/include/frc/InterruptableSensorBase.h index dd3d45bdcb..6e361ab26d 100644 --- a/wpilibc/src/main/native/include/frc/InterruptableSensorBase.h +++ b/wpilibc/src/main/native/include/frc/InterruptableSensorBase.h @@ -35,7 +35,7 @@ class InterruptableSensorBase : public ErrorBase { /** * Free the resources for an interrupt event. */ - virtual ~InterruptableSensorBase(); + ~InterruptableSensorBase() override; InterruptableSensorBase(InterruptableSensorBase&&) = default; InterruptableSensorBase& operator=(InterruptableSensorBase&&) = default; diff --git a/wpilibc/src/main/native/include/frc/IterativeRobot.h b/wpilibc/src/main/native/include/frc/IterativeRobot.h index f33c9089af..f6c1532917 100644 --- a/wpilibc/src/main/native/include/frc/IterativeRobot.h +++ b/wpilibc/src/main/native/include/frc/IterativeRobot.h @@ -28,7 +28,7 @@ class IterativeRobot : public IterativeRobotBase { "Use TimedRobot instead. It's a drop-in replacement that provides more " "regular execution periods.") IterativeRobot(); - virtual ~IterativeRobot() = default; + ~IterativeRobot() override = default; /** * Provide an alternate "main loop" via StartCompetition(). diff --git a/wpilibc/src/main/native/include/frc/IterativeRobotBase.h b/wpilibc/src/main/native/include/frc/IterativeRobotBase.h index 07f345f6b8..7d04868da7 100644 --- a/wpilibc/src/main/native/include/frc/IterativeRobotBase.h +++ b/wpilibc/src/main/native/include/frc/IterativeRobotBase.h @@ -178,7 +178,7 @@ class IterativeRobotBase : public RobotBase { */ explicit IterativeRobotBase(units::second_t period); - virtual ~IterativeRobotBase() = default; + ~IterativeRobotBase() override = default; protected: IterativeRobotBase(IterativeRobotBase&&) = default; diff --git a/wpilibc/src/main/native/include/frc/Joystick.h b/wpilibc/src/main/native/include/frc/Joystick.h index 31371cd3e9..093480c290 100644 --- a/wpilibc/src/main/native/include/frc/Joystick.h +++ b/wpilibc/src/main/native/include/frc/Joystick.h @@ -39,7 +39,7 @@ class Joystick : public GenericHID { */ explicit Joystick(int port); - virtual ~Joystick() = default; + ~Joystick() override = default; Joystick(Joystick&&) = default; Joystick& operator=(Joystick&&) = default; diff --git a/wpilibc/src/main/native/include/frc/MotorSafety.h b/wpilibc/src/main/native/include/frc/MotorSafety.h index 2c169588af..ee191b8459 100644 --- a/wpilibc/src/main/native/include/frc/MotorSafety.h +++ b/wpilibc/src/main/native/include/frc/MotorSafety.h @@ -21,7 +21,7 @@ namespace frc { class MotorSafety : public ErrorBase { public: MotorSafety(); - virtual ~MotorSafety(); + ~MotorSafety() override; MotorSafety(MotorSafety&& rhs); MotorSafety& operator=(MotorSafety&& rhs); diff --git a/wpilibc/src/main/native/include/frc/Notifier.h b/wpilibc/src/main/native/include/frc/Notifier.h index 9e44cd752b..dc109360dc 100644 --- a/wpilibc/src/main/native/include/frc/Notifier.h +++ b/wpilibc/src/main/native/include/frc/Notifier.h @@ -62,7 +62,7 @@ class Notifier : public ErrorBase { /** * Free the resources for a timer event. */ - virtual ~Notifier(); + ~Notifier() override; Notifier(Notifier&& rhs); Notifier& operator=(Notifier&& rhs); diff --git a/wpilibc/src/main/native/include/frc/PIDBase.h b/wpilibc/src/main/native/include/frc/PIDBase.h index 35fb7d646c..52048bfed3 100644 --- a/wpilibc/src/main/native/include/frc/PIDBase.h +++ b/wpilibc/src/main/native/include/frc/PIDBase.h @@ -65,7 +65,7 @@ class PIDBase : public PIDInterface, PIDBase(double p, double i, double d, double f, PIDSource& source, PIDOutput& output); - virtual ~PIDBase() = default; + ~PIDBase() override = default; /** * Return the current PID result. diff --git a/wpilibc/src/main/native/include/frc/Preferences.h b/wpilibc/src/main/native/include/frc/Preferences.h index 99b121a551..368ff2cac8 100644 --- a/wpilibc/src/main/native/include/frc/Preferences.h +++ b/wpilibc/src/main/native/include/frc/Preferences.h @@ -226,7 +226,7 @@ class Preferences : public ErrorBase { protected: Preferences(); - virtual ~Preferences() = default; + ~Preferences() override = default; Preferences(Preferences&&) = default; Preferences& operator=(Preferences&&) = default; diff --git a/wpilibc/src/main/native/include/frc/Resource.h b/wpilibc/src/main/native/include/frc/Resource.h index de6c5a387a..6880d65265 100644 --- a/wpilibc/src/main/native/include/frc/Resource.h +++ b/wpilibc/src/main/native/include/frc/Resource.h @@ -28,7 +28,7 @@ namespace frc { */ class Resource : public ErrorBase { public: - virtual ~Resource() = default; + ~Resource() override = default; /** * Factory method to create a Resource allocation-tracker *if* needed. diff --git a/wpilibc/src/main/native/include/frc/RobotDrive.h b/wpilibc/src/main/native/include/frc/RobotDrive.h index c728c20a33..fa22e0e8cc 100644 --- a/wpilibc/src/main/native/include/frc/RobotDrive.h +++ b/wpilibc/src/main/native/include/frc/RobotDrive.h @@ -126,7 +126,7 @@ class RobotDrive : public MotorSafety { std::shared_ptr frontRightMotor, std::shared_ptr rearRightMotor); - virtual ~RobotDrive() = default; + ~RobotDrive() override = default; RobotDrive(RobotDrive&&) = default; RobotDrive& operator=(RobotDrive&&) = default; diff --git a/wpilibc/src/main/native/include/frc/SerialPort.h b/wpilibc/src/main/native/include/frc/SerialPort.h index 4490d5cfd8..9323574a1a 100644 --- a/wpilibc/src/main/native/include/frc/SerialPort.h +++ b/wpilibc/src/main/native/include/frc/SerialPort.h @@ -87,7 +87,7 @@ class SerialPort : public ErrorBase { int dataBits = 8, Parity parity = kParity_None, StopBits stopBits = kStopBits_One); - ~SerialPort(); + ~SerialPort() override; SerialPort(SerialPort&& rhs) = default; SerialPort& operator=(SerialPort&& rhs) = default; diff --git a/wpilibc/src/main/native/include/frc/XboxController.h b/wpilibc/src/main/native/include/frc/XboxController.h index dc206e42d3..0132fb3e2e 100644 --- a/wpilibc/src/main/native/include/frc/XboxController.h +++ b/wpilibc/src/main/native/include/frc/XboxController.h @@ -29,7 +29,7 @@ class XboxController : public GenericHID { */ explicit XboxController(int port); - virtual ~XboxController() = default; + ~XboxController() override = default; XboxController(XboxController&&) = default; XboxController& operator=(XboxController&&) = default; diff --git a/wpilibc/src/main/native/include/frc/filters/Filter.h b/wpilibc/src/main/native/include/frc/filters/Filter.h index 8f018aedc8..9ec3efb3dd 100644 --- a/wpilibc/src/main/native/include/frc/filters/Filter.h +++ b/wpilibc/src/main/native/include/frc/filters/Filter.h @@ -23,7 +23,7 @@ class Filter : public PIDSource { explicit Filter(PIDSource& source); WPI_DEPRECATED("This class is no longer used.") explicit Filter(std::shared_ptr source); - virtual ~Filter() = default; + ~Filter() override = default; Filter(Filter&&) = default; Filter& operator=(Filter&&) = default; diff --git a/wpilibc/src/main/native/include/frc/interfaces/Potentiometer.h b/wpilibc/src/main/native/include/frc/interfaces/Potentiometer.h index f2fe9ce28c..f3392c9b03 100644 --- a/wpilibc/src/main/native/include/frc/interfaces/Potentiometer.h +++ b/wpilibc/src/main/native/include/frc/interfaces/Potentiometer.h @@ -14,7 +14,7 @@ namespace frc { class Potentiometer : public PIDSource { public: Potentiometer() = default; - virtual ~Potentiometer() = default; + ~Potentiometer() override = default; Potentiometer(Potentiometer&&) = default; Potentiometer& operator=(Potentiometer&&) = default; diff --git a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponent.h b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponent.h index 321ebf6fab..1108810d3f 100644 --- a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponent.h +++ b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponent.h @@ -29,7 +29,7 @@ class ShuffleboardComponent : public ShuffleboardComponentBase { ShuffleboardComponent(ShuffleboardContainer& parent, const wpi::Twine& title, const wpi::Twine& type = ""); - virtual ~ShuffleboardComponent() = default; + ~ShuffleboardComponent() override = default; /** * Sets custom properties for this component. Property names are diff --git a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponentBase.h b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponentBase.h index 8b37df6bd7..0b906246d1 100644 --- a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponentBase.h +++ b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardComponentBase.h @@ -27,7 +27,7 @@ class ShuffleboardComponentBase : public virtual ShuffleboardValue { const wpi::Twine& title, const wpi::Twine& type = ""); - virtual ~ShuffleboardComponentBase() = default; + ~ShuffleboardComponentBase() override = default; void SetType(const wpi::Twine& type); diff --git a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardContainer.h b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardContainer.h index 3227d08011..a25c81fe89 100644 --- a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardContainer.h +++ b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardContainer.h @@ -45,7 +45,7 @@ class ShuffleboardContainer : public virtual ShuffleboardValue, ShuffleboardContainer(ShuffleboardContainer&& rhs) = default; - virtual ~ShuffleboardContainer() = default; + ~ShuffleboardContainer() override = default; /** * Gets the components that are direct children of this container. diff --git a/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h b/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h index e62c651094..1dd0a1efbf 100644 --- a/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h +++ b/wpilibc/src/main/native/include/frc/smartdashboard/SmartDashboard.h @@ -432,7 +432,7 @@ class SmartDashboard : public ErrorBase, static void UpdateValues(); private: - virtual ~SmartDashboard() = default; + ~SmartDashboard() override = default; static detail::ListenerExecutor listenerExecutor; }; diff --git a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h index 2dd2b0ea01..ca11456d43 100644 --- a/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h +++ b/wpilibcExamples/src/main/cpp/commands/subsystem2/ReplaceMeSubsystem2.h @@ -13,7 +13,7 @@ class ReplaceMeSubsystem2 : public frc2::SubsystemBase { /** * Will be called periodically whenever the CommandScheduler runs. */ - void Periodic(); + void Periodic() override; private: // Components (e.g. motor controllers and sensors) should generally be diff --git a/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp index 46e1d475c2..250f725734 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ArcadeDrive/cpp/Robot.cpp @@ -18,7 +18,7 @@ class Robot : public frc::TimedRobot { frc::Joystick m_stick{0}; public: - void TeleopPeriodic() { + void TeleopPeriodic() override { // Drive with arcade style m_robotDrive.ArcadeDrive(m_stick.GetY(), m_stick.GetX()); } diff --git a/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp index faf2f76149..0ad3e5e13c 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ArcadeDriveXboxController/cpp/Robot.cpp @@ -19,7 +19,7 @@ class Robot : public frc::TimedRobot { frc::XboxController m_driverController{0}; public: - void TeleopPeriodic() { + void TeleopPeriodic() override { // Drive with split arcade style // That means that the Y axis of the left stick moves forward // and backward, and the X of the right stick turns left and right. diff --git a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/Robot.cpp index febf77dedc..b3b880521b 100644 --- a/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ArmSimulation/cpp/Robot.cpp @@ -63,9 +63,11 @@ class Robot : public frc::TimedRobot { frc::sim::EncoderSim m_encoderSim{m_encoder}; public: - void RobotInit() { m_encoder.SetDistancePerPulse(kArmEncoderDistPerPulse); } + void RobotInit() override { + m_encoder.SetDistancePerPulse(kArmEncoderDistPerPulse); + } - void SimulationPeriodic() { + void SimulationPeriodic() override { // In this method, we update our simulation of what our arm is doing // First, we set our "inputs" (voltages) m_armSim.SetInput(frc::MakeMatrix<1, 1>( @@ -82,7 +84,7 @@ class Robot : public frc::TimedRobot { frc::sim::BatterySim::Calculate({m_armSim.GetCurrentDraw()})); } - void TeleopPeriodic() { + void TeleopPeriodic() override { if (m_joystick.GetTrigger()) { // Here, we run PID control like normal, with a constant setpoint of 30in. double pidOutput = @@ -94,7 +96,7 @@ class Robot : public frc::TimedRobot { } } - void DisabledInit() { + void DisabledInit() override { // This just makes sure that our simulation code knows that the motor's off. m_motor.Set(0.0); } diff --git a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/Robot.cpp index 7608bd59f1..a6d4a049e6 100644 --- a/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/ElevatorSimulation/cpp/Robot.cpp @@ -62,9 +62,11 @@ class Robot : public frc::TimedRobot { frc::sim::EncoderSim m_encoderSim{m_encoder}; public: - void RobotInit() { m_encoder.SetDistancePerPulse(kArmEncoderDistPerPulse); } + void RobotInit() override { + m_encoder.SetDistancePerPulse(kArmEncoderDistPerPulse); + } - void SimulationPeriodic() { + void SimulationPeriodic() override { // In this method, we update our simulation of what our elevator is doing // First, we set our "inputs" (voltages) m_elevatorSim.SetInput(frc::MakeMatrix<1, 1>( @@ -81,7 +83,7 @@ class Robot : public frc::TimedRobot { frc::sim::BatterySim::Calculate({m_elevatorSim.GetCurrentDraw()})); } - void TeleopPeriodic() { + void TeleopPeriodic() override { if (m_joystick.GetTrigger()) { // Here, we run PID control like normal, with a constant setpoint of 30in. double pidOutput = @@ -93,7 +95,7 @@ class Robot : public frc::TimedRobot { } } - void DisabledInit() { + void DisabledInit() override { // This just makes sure that our simulation code knows that the motor's off. m_motor.Set(0.0); } diff --git a/wpilibcExamples/src/main/cpp/examples/PacGoat/include/subsystems/DriveTrain.h b/wpilibcExamples/src/main/cpp/examples/PacGoat/include/subsystems/DriveTrain.h index 0f8fcd6dc1..c77b92ecdb 100644 --- a/wpilibcExamples/src/main/cpp/examples/PacGoat/include/subsystems/DriveTrain.h +++ b/wpilibcExamples/src/main/cpp/examples/PacGoat/include/subsystems/DriveTrain.h @@ -28,7 +28,7 @@ class DriveTrain : public frc::Subsystem { * with * the joystick. */ - void InitDefaultCommand(); + void InitDefaultCommand() override; /** * @param leftAxis Left sides value diff --git a/wpilibcExamples/src/main/cpp/examples/PacGoat/include/triggers/DoubleButton.h b/wpilibcExamples/src/main/cpp/examples/PacGoat/include/triggers/DoubleButton.h index bd5856b1d5..ec74abe122 100644 --- a/wpilibcExamples/src/main/cpp/examples/PacGoat/include/triggers/DoubleButton.h +++ b/wpilibcExamples/src/main/cpp/examples/PacGoat/include/triggers/DoubleButton.h @@ -14,7 +14,7 @@ class DoubleButton : public frc::Trigger { public: DoubleButton(frc::Joystick* joy, int button1, int button2); - bool Get(); + bool Get() override; private: frc::Joystick& m_joy; diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp index 87ed27a0a5..8bd0934970 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceArm/cpp/Robot.cpp @@ -93,12 +93,12 @@ class Robot : public frc::TimedRobot { frc::TrapezoidProfile::State m_lastProfiledReference; public: - void RobotInit() { + void RobotInit() override { // We go 2 pi radians per 4096 clicks. m_encoder.SetDistancePerPulse(2.0 * wpi::math::pi / 4096.0); } - void TeleopInit() { + void TeleopInit() override { m_loop.Reset( frc::MakeMatrix<2, 1>(m_encoder.GetDistance(), m_encoder.GetRate())); @@ -107,7 +107,7 @@ class Robot : public frc::TimedRobot { units::radians_per_second_t(m_encoder.GetRate())}; } - void TeleopPeriodic() { + void TeleopPeriodic() override { // Sets the target position of our arm. This is similar to setting the // setpoint of a PID controller. frc::TrapezoidProfile::State goal; diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp index 52a29bb249..d3d8954aea 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceElevator/cpp/Robot.cpp @@ -90,13 +90,13 @@ class Robot : public frc::TimedRobot { frc::TrapezoidProfile::State m_lastProfiledReference; public: - void RobotInit() { + void RobotInit() override { // Circumference = pi * d, so distance per click = pi * d / counts m_encoder.SetDistancePerPulse(2.0 * wpi::math::pi * kDrumRadius.to() / 4096.0); } - void TeleopInit() { + void TeleopInit() override { // Reset our loop to make sure it's in a known state. m_loop.Reset( frc::MakeMatrix<2, 1>(m_encoder.GetDistance(), m_encoder.GetRate())); @@ -105,7 +105,7 @@ class Robot : public frc::TimedRobot { units::meters_per_second_t(m_encoder.GetRate())}; } - void TeleopPeriodic() { + void TeleopPeriodic() override { // Sets the target height of our elevator. This is similar to setting the // setpoint of a PID controller. frc::TrapezoidProfile::State goal; diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp index f523e457df..fbe931c71f 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheel/cpp/Robot.cpp @@ -81,16 +81,16 @@ class Robot : public frc::TimedRobot { frc::XboxController m_joystick{kJoystickPort}; public: - void RobotInit() { + void RobotInit() override { // We go 2 pi radians per 4096 clicks. m_encoder.SetDistancePerPulse(2.0 * wpi::math::pi / 4096.0); } - void TeleopInit() { + void TeleopInit() override { m_loop.Reset(frc::MakeMatrix<1, 1>(m_encoder.GetRate())); } - void TeleopPeriodic() { + void TeleopPeriodic() override { // Sets the target speed of our flywheel. This is similar to setting the // setpoint of a PID controller. if (m_joystick.GetBumper(frc::GenericHID::kRightHand)) { diff --git a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp index 4ef923a0fb..355894a28a 100644 --- a/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/StateSpaceFlywheelSysId/cpp/Robot.cpp @@ -82,16 +82,16 @@ class Robot : public frc::TimedRobot { frc::XboxController m_joystick{kJoystickPort}; public: - void RobotInit() { + void RobotInit() override { // We go 2 pi radians per 4096 clicks. m_encoder.SetDistancePerPulse(2.0 * wpi::math::pi / 4096.0); } - void TeleopInit() { + void TeleopInit() override { m_loop.Reset(frc::MakeMatrix<1, 1>(m_encoder.GetRate())); } - void TeleopPeriodic() { + void TeleopPeriodic() override { // Sets the target speed of our flywheel. This is similar to setting the // setpoint of a PID controller. if (m_joystick.GetBumper(frc::GenericHID::kRightHand)) { diff --git a/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp index f9811b107c..8e469d55aa 100644 --- a/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/TankDriveXboxController/cpp/Robot.cpp @@ -19,7 +19,7 @@ class Robot : public frc::TimedRobot { frc::XboxController m_driverController{0}; public: - void TeleopPeriodic() { + void TeleopPeriodic() override { // Drive with tank style m_robotDrive.TankDrive( m_driverController.GetY(frc::GenericHID::JoystickHand::kLeftHand), diff --git a/wpimath/src/test/native/cpp/UnitsTest.cpp b/wpimath/src/test/native/cpp/UnitsTest.cpp index 2274155827..fce3ad7342 100644 --- a/wpimath/src/test/native/cpp/UnitsTest.cpp +++ b/wpimath/src/test/native/cpp/UnitsTest.cpp @@ -94,65 +94,65 @@ namespace { class TypeTraits : public ::testing::Test { protected: TypeTraits() {} - virtual ~TypeTraits() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~TypeTraits() override {} + void SetUp() override {} + void TearDown() override {} }; class UnitManipulators : public ::testing::Test { protected: UnitManipulators() {} - virtual ~UnitManipulators() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~UnitManipulators() override {} + void SetUp() override {} + void TearDown() override {} }; class UnitContainer : public ::testing::Test { protected: UnitContainer() {} - virtual ~UnitContainer() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~UnitContainer() override {} + void SetUp() override {} + void TearDown() override {} }; class UnitConversion : public ::testing::Test { protected: UnitConversion() {} - virtual ~UnitConversion() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~UnitConversion() override {} + void SetUp() override {} + void TearDown() override {} }; class UnitMath : public ::testing::Test { protected: UnitMath() {} - virtual ~UnitMath() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~UnitMath() override {} + void SetUp() override {} + void TearDown() override {} }; class CompileTimeArithmetic : public ::testing::Test { protected: CompileTimeArithmetic() {} - virtual ~CompileTimeArithmetic() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~CompileTimeArithmetic() override {} + void SetUp() override {} + void TearDown() override {} }; class Constexpr : public ::testing::Test { protected: Constexpr() {} - virtual ~Constexpr() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~Constexpr() override {} + void SetUp() override {} + void TearDown() override {} }; class CaseStudies : public ::testing::Test { protected: CaseStudies() {} - virtual ~CaseStudies() {} - virtual void SetUp() {} - virtual void TearDown() {} + ~CaseStudies() override {} + void SetUp() override {} + void TearDown() override {} struct RightTriangle { using a = unit_value_t; diff --git a/wpiutil/src/main/native/cpp/EventLoopRunner.cpp b/wpiutil/src/main/native/cpp/EventLoopRunner.cpp index 41768c19ce..dbf9c6baf1 100644 --- a/wpiutil/src/main/native/cpp/EventLoopRunner.cpp +++ b/wpiutil/src/main/native/cpp/EventLoopRunner.cpp @@ -30,7 +30,7 @@ class EventLoopRunner::Thread : public SafeThread { }); } - void Main() { + void Main() override { if (m_loop) { m_loop->Run(); } diff --git a/wpiutil/src/main/native/include/wpi/TCPAcceptor.h b/wpiutil/src/main/native/include/wpi/TCPAcceptor.h index da82a8a309..8f25a19ba6 100644 --- a/wpiutil/src/main/native/include/wpi/TCPAcceptor.h +++ b/wpiutil/src/main/native/include/wpi/TCPAcceptor.h @@ -45,7 +45,7 @@ class TCPAcceptor : public NetworkAcceptor { public: TCPAcceptor(int port, const char* address, Logger& logger); - ~TCPAcceptor(); + ~TCPAcceptor() override; int start() override; void shutdown() override; diff --git a/wpiutil/src/main/native/include/wpi/TCPStream.h b/wpiutil/src/main/native/include/wpi/TCPStream.h index 0c6e8a9117..76cfe3aee9 100644 --- a/wpiutil/src/main/native/include/wpi/TCPStream.h +++ b/wpiutil/src/main/native/include/wpi/TCPStream.h @@ -43,7 +43,7 @@ class TCPStream : public NetworkStream { friend class TCPAcceptor; friend class TCPConnector; - ~TCPStream(); + ~TCPStream() override; size_t send(const char* buffer, size_t len, Error* err) override; size_t receive(char* buffer, size_t len, Error* err, diff --git a/wpiutil/src/main/native/include/wpi/raw_socket_ostream.h b/wpiutil/src/main/native/include/wpi/raw_socket_ostream.h index f0b0034850..5cdeb41c5e 100644 --- a/wpiutil/src/main/native/include/wpi/raw_socket_ostream.h +++ b/wpiutil/src/main/native/include/wpi/raw_socket_ostream.h @@ -15,7 +15,7 @@ class raw_socket_ostream : public raw_ostream { public: raw_socket_ostream(NetworkStream& stream, bool shouldClose) : m_stream(stream), m_shouldClose(shouldClose) {} - ~raw_socket_ostream(); + ~raw_socket_ostream() override; void close(); diff --git a/wpiutil/src/test/native/cpp/WebSocketTest.h b/wpiutil/src/test/native/cpp/WebSocketTest.h index ebd723c1de..6063dc4051 100644 --- a/wpiutil/src/test/native/cpp/WebSocketTest.h +++ b/wpiutil/src/test/native/cpp/WebSocketTest.h @@ -48,7 +48,7 @@ class WebSocketTest : public ::testing::Test { failTimer->Unreference(); } - ~WebSocketTest() { Finish(); } + ~WebSocketTest() override { Finish(); } void Finish() { loop->Walk([](uv::Handle& it) { it.Close(); });