mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
clang-tidy: modernize-use-equals-default
This commit is contained in:
@@ -491,7 +491,7 @@ CameraServer::Impl::Impl() : m_nextPort(kBasePort) {
|
||||
|
||||
CameraServer::CameraServer() : m_impl(new Impl) {}
|
||||
|
||||
CameraServer::~CameraServer() {}
|
||||
CameraServer::~CameraServer() = default;
|
||||
|
||||
cs::UsbCamera CameraServer::StartAutomaticCapture() {
|
||||
cs::UsbCamera camera = StartAutomaticCapture(m_impl->m_defaultUsbDevice++);
|
||||
|
||||
@@ -20,7 +20,7 @@ VisionRunnerBase::VisionRunnerBase(cs::VideoSource videoSource)
|
||||
}
|
||||
|
||||
// Located here and not in header due to cv::Mat forward declaration.
|
||||
VisionRunnerBase::~VisionRunnerBase() {}
|
||||
VisionRunnerBase::~VisionRunnerBase() = default;
|
||||
|
||||
void VisionRunnerBase::RunOnce() {
|
||||
auto csShared = frc::GetCameraServerShared();
|
||||
|
||||
@@ -23,7 +23,7 @@ ConfigurableSourceImpl::ConfigurableSourceImpl(const wpi::Twine& name,
|
||||
m_videoModes.push_back(m_mode);
|
||||
}
|
||||
|
||||
ConfigurableSourceImpl::~ConfigurableSourceImpl() {}
|
||||
ConfigurableSourceImpl::~ConfigurableSourceImpl() = default;
|
||||
|
||||
void ConfigurableSourceImpl::Start() {
|
||||
m_notifier.NotifySource(*this, CS_SOURCE_CONNECTED);
|
||||
|
||||
@@ -24,7 +24,7 @@ CvSourceImpl::CvSourceImpl(const wpi::Twine& name, wpi::Logger& logger,
|
||||
const VideoMode& mode)
|
||||
: ConfigurableSourceImpl{name, logger, notifier, telemetry, mode} {}
|
||||
|
||||
CvSourceImpl::~CvSourceImpl() {}
|
||||
CvSourceImpl::~CvSourceImpl() = default;
|
||||
|
||||
void CvSourceImpl::PutFrame(cv::Mat& image) {
|
||||
// We only support 8-bit images; convert if necessary.
|
||||
|
||||
@@ -42,7 +42,7 @@ class Frame {
|
||||
};
|
||||
|
||||
public:
|
||||
Frame() noexcept {}
|
||||
Frame() noexcept = default;
|
||||
|
||||
Frame(SourceImpl& source, const wpi::Twine& error, Time time);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Instance::Instance() : telemetry(notifier), networkListener(logger, notifier) {
|
||||
SetDefaultLogger();
|
||||
}
|
||||
|
||||
Instance::~Instance() {}
|
||||
Instance::~Instance() = default;
|
||||
|
||||
Instance& Instance::GetInstance() {
|
||||
static Instance* inst = new Instance;
|
||||
|
||||
@@ -19,7 +19,7 @@ RawSourceImpl::RawSourceImpl(const wpi::Twine& name, wpi::Logger& logger,
|
||||
const VideoMode& mode)
|
||||
: ConfigurableSourceImpl{name, logger, notifier, telemetry, mode} {}
|
||||
|
||||
RawSourceImpl::~RawSourceImpl() {}
|
||||
RawSourceImpl::~RawSourceImpl() = default;
|
||||
|
||||
void RawSourceImpl::PutFrame(const CS_RawFrame& image) {
|
||||
int type;
|
||||
|
||||
@@ -43,7 +43,7 @@ int64_t Telemetry::Thread::GetValue(CS_Handle handle, CS_TelemetryKind kind,
|
||||
return it->getSecond();
|
||||
}
|
||||
|
||||
Telemetry::~Telemetry() {}
|
||||
Telemetry::~Telemetry() = default;
|
||||
|
||||
void Telemetry::Start() {
|
||||
m_owner.Start(m_notifier);
|
||||
|
||||
@@ -48,7 +48,7 @@ class VideoProperty {
|
||||
kEnum = CS_PROP_ENUM
|
||||
};
|
||||
|
||||
VideoProperty() {}
|
||||
VideoProperty() = default;
|
||||
|
||||
std::string GetName() const;
|
||||
|
||||
@@ -124,7 +124,7 @@ class VideoSource {
|
||||
kConnectionForceClose = CS_CONNECTION_FORCE_CLOSE
|
||||
};
|
||||
|
||||
VideoSource() noexcept {}
|
||||
VideoSource() noexcept = default;
|
||||
VideoSource(const VideoSource& source);
|
||||
VideoSource(VideoSource&& other) noexcept;
|
||||
VideoSource& operator=(VideoSource other) noexcept;
|
||||
@@ -733,7 +733,7 @@ class VideoSink {
|
||||
kCv = CS_SINK_CV
|
||||
};
|
||||
|
||||
VideoSink() noexcept {}
|
||||
VideoSink() noexcept = default;
|
||||
VideoSink(const VideoSink& sink);
|
||||
VideoSink(VideoSink&& sink) noexcept;
|
||||
VideoSink& operator=(VideoSink other) noexcept;
|
||||
@@ -1008,7 +1008,7 @@ class VideoEvent : public RawEvent {
|
||||
*/
|
||||
class VideoListener {
|
||||
public:
|
||||
VideoListener() {}
|
||||
VideoListener() = default;
|
||||
|
||||
/**
|
||||
* Create an event listener.
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace cs {
|
||||
|
||||
class UsbCameraBuffer {
|
||||
public:
|
||||
UsbCameraBuffer() noexcept {}
|
||||
UsbCameraBuffer() noexcept = default;
|
||||
UsbCameraBuffer(UsbCameraBuffer&& other) noexcept : UsbCameraBuffer() {
|
||||
swap(*this, other);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class NetworkListener::Impl {};
|
||||
|
||||
NetworkListener::NetworkListener(wpi::Logger& logger, Notifier& notifier) {}
|
||||
|
||||
NetworkListener::~NetworkListener() {}
|
||||
NetworkListener::~NetworkListener() = default;
|
||||
|
||||
void NetworkListener::Start() {}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class SourceReaderCB : public IMFSourceReaderCallback {
|
||||
|
||||
private:
|
||||
// Destructor is private. Caller should call Release.
|
||||
virtual ~SourceReaderCB() {}
|
||||
virtual ~SourceReaderCB() = default;
|
||||
void NotifyError(HRESULT hr);
|
||||
|
||||
ULONG m_nRefCount;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace cs {
|
||||
|
||||
class CameraSourceTest : public ::testing::Test {
|
||||
protected:
|
||||
CameraSourceTest() {}
|
||||
CameraSourceTest() = default;
|
||||
};
|
||||
|
||||
TEST_F(CameraSourceTest, HTTPCamera) {
|
||||
|
||||
@@ -889,7 +889,7 @@ PlotProvider::PlotProvider(const wpi::Twine& iniName)
|
||||
m_plotSaver{iniName, this, false},
|
||||
m_seriesSaver{iniName + "Series", this, true} {}
|
||||
|
||||
PlotProvider::~PlotProvider() {}
|
||||
PlotProvider::~PlotProvider() = default;
|
||||
|
||||
void PlotProvider::GlobalInit() {
|
||||
WindowManager::GlobalInit();
|
||||
|
||||
@@ -184,7 +184,7 @@ NTField2DModel::NTField2DModel(NT_Inst inst, wpi::StringRef path)
|
||||
NT_NOTIFY_UPDATE | NT_NOTIFY_IMMEDIATE);
|
||||
}
|
||||
|
||||
NTField2DModel::~NTField2DModel() {}
|
||||
NTField2DModel::~NTField2DModel() = default;
|
||||
|
||||
void NTField2DModel::Update() {
|
||||
for (auto&& event : m_nt.PollListener()) {
|
||||
|
||||
@@ -38,7 +38,7 @@ class Message {
|
||||
};
|
||||
typedef std::function<NT_Type(unsigned int id)> GetEntryTypeFunc;
|
||||
|
||||
Message() {}
|
||||
Message() = default;
|
||||
Message(MsgType type, const private_init&) : m_type(type) {}
|
||||
|
||||
MsgType type() const { return m_type; }
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace nt {
|
||||
/* A sequence number per RFC 1982 */
|
||||
class SequenceNumber {
|
||||
public:
|
||||
SequenceNumber() {}
|
||||
SequenceNumber() = default;
|
||||
explicit SequenceNumber(unsigned int value) : m_value(value) {}
|
||||
unsigned int value() const { return m_value; }
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ class RpcCall final {
|
||||
/**
|
||||
* Construct invalid instance.
|
||||
*/
|
||||
RpcCall() {}
|
||||
RpcCall() = default;
|
||||
|
||||
/**
|
||||
* Construct from native handles.
|
||||
|
||||
@@ -130,7 +130,7 @@ struct RpcDefinition {
|
||||
/** NetworkTables Remote Procedure Call (Server Side) */
|
||||
class RpcAnswer {
|
||||
public:
|
||||
RpcAnswer() {}
|
||||
RpcAnswer() = default;
|
||||
RpcAnswer(NT_Entry entry_, NT_RpcCall call_, StringRef name_,
|
||||
StringRef params_, const ConnectionInfo& conn_)
|
||||
: entry(entry_), call(call_), name(name_), params(params_), conn(conn_) {}
|
||||
@@ -176,7 +176,7 @@ class RpcAnswer {
|
||||
/** NetworkTables Entry Notification */
|
||||
class EntryNotification {
|
||||
public:
|
||||
EntryNotification() {}
|
||||
EntryNotification() = default;
|
||||
EntryNotification(NT_EntryListener listener_, NT_Entry entry_,
|
||||
StringRef name_, std::shared_ptr<Value> value_,
|
||||
unsigned int flags_)
|
||||
@@ -217,7 +217,7 @@ class EntryNotification {
|
||||
/** NetworkTables Connection Notification */
|
||||
class ConnectionNotification {
|
||||
public:
|
||||
ConnectionNotification() {}
|
||||
ConnectionNotification() = default;
|
||||
ConnectionNotification(NT_ConnectionListener listener_, bool connected_,
|
||||
const ConnectionInfo& conn_)
|
||||
: listener(listener_), connected(connected_), conn(conn_) {}
|
||||
@@ -243,7 +243,7 @@ class ConnectionNotification {
|
||||
/** NetworkTables log message. */
|
||||
class LogMessage {
|
||||
public:
|
||||
LogMessage() {}
|
||||
LogMessage() = default;
|
||||
LogMessage(NT_Logger logger_, unsigned int level_, const char* filename_,
|
||||
unsigned int line_, StringRef message_)
|
||||
: logger(logger_),
|
||||
|
||||
@@ -18,7 +18,7 @@ class HALSimWSBaseProvider {
|
||||
public:
|
||||
explicit HALSimWSBaseProvider(const std::string& key,
|
||||
const std::string& type = "");
|
||||
virtual ~HALSimWSBaseProvider() {}
|
||||
virtual ~HALSimWSBaseProvider() = default;
|
||||
|
||||
HALSimWSBaseProvider(const HALSimWSBaseProvider&) = delete;
|
||||
HALSimWSBaseProvider& operator=(const HALSimWSBaseProvider&) = delete;
|
||||
|
||||
@@ -19,7 +19,7 @@ class ProviderContainer {
|
||||
using ProviderPtr = std::shared_ptr<HALSimWSBaseProvider>;
|
||||
using IterFn = std::function<void(ProviderPtr)>;
|
||||
|
||||
ProviderContainer() {}
|
||||
ProviderContainer() = default;
|
||||
|
||||
ProviderContainer(const ProviderContainer&) = delete;
|
||||
ProviderContainer& operator=(const ProviderContainer&) = delete;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace frc2;
|
||||
|
||||
Trigger::Trigger(const Trigger& other) : m_isActive(other.m_isActive) {}
|
||||
Trigger::Trigger(const Trigger& other) = default;
|
||||
|
||||
Trigger Trigger::WhenActive(Command* command, bool interruptible) {
|
||||
CommandScheduler::GetInstance().AddButton(
|
||||
|
||||
@@ -29,7 +29,7 @@ ShuffleboardInstance::ShuffleboardInstance(nt::NetworkTableInstance ntInstance)
|
||||
HAL_Report(HALUsageReporting::kResourceType_Shuffleboard, 0);
|
||||
}
|
||||
|
||||
ShuffleboardInstance::~ShuffleboardInstance() {}
|
||||
ShuffleboardInstance::~ShuffleboardInstance() = default;
|
||||
|
||||
frc::ShuffleboardTab& ShuffleboardInstance::GetTab(wpi::StringRef title) {
|
||||
if (m_impl->tabs.find(title) == m_impl->tabs.end()) {
|
||||
|
||||
@@ -220,7 +220,7 @@ RobotBase::RobotBase() : m_ds(DriverStation::GetInstance()) {
|
||||
RobotBase::RobotBase(RobotBase&&) noexcept
|
||||
: m_ds(DriverStation::GetInstance()) {}
|
||||
|
||||
RobotBase::~RobotBase() {}
|
||||
RobotBase::~RobotBase() = default;
|
||||
|
||||
RobotBase& RobotBase::operator=(RobotBase&&) noexcept {
|
||||
return *this;
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
|
||||
#include "ReplaceMeEmptyClass.h"
|
||||
|
||||
ReplaceMeEmptyClass::ReplaceMeEmptyClass() {}
|
||||
ReplaceMeEmptyClass::ReplaceMeEmptyClass() = default;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "ReplaceMeSubsystem2.h"
|
||||
|
||||
ReplaceMeSubsystem2::ReplaceMeSubsystem2() {}
|
||||
ReplaceMeSubsystem2::ReplaceMeSubsystem2() = default;
|
||||
|
||||
// This method will be called once per scheduler run
|
||||
void ReplaceMeSubsystem2::Periodic() {}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "ReplaceMeTrigger.h"
|
||||
|
||||
ReplaceMeTrigger::ReplaceMeTrigger() {}
|
||||
ReplaceMeTrigger::ReplaceMeTrigger() = default;
|
||||
|
||||
bool ReplaceMeTrigger::Get() {
|
||||
return false;
|
||||
|
||||
@@ -93,64 +93,64 @@ namespace {
|
||||
|
||||
class TypeTraits : public ::testing::Test {
|
||||
protected:
|
||||
TypeTraits() {}
|
||||
~TypeTraits() override {}
|
||||
TypeTraits() = default;
|
||||
~TypeTraits() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class UnitManipulators : public ::testing::Test {
|
||||
protected:
|
||||
UnitManipulators() {}
|
||||
~UnitManipulators() override {}
|
||||
UnitManipulators() = default;
|
||||
~UnitManipulators() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class UnitContainer : public ::testing::Test {
|
||||
protected:
|
||||
UnitContainer() {}
|
||||
~UnitContainer() override {}
|
||||
UnitContainer() = default;
|
||||
~UnitContainer() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class UnitConversion : public ::testing::Test {
|
||||
protected:
|
||||
UnitConversion() {}
|
||||
~UnitConversion() override {}
|
||||
UnitConversion() = default;
|
||||
~UnitConversion() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class UnitMath : public ::testing::Test {
|
||||
protected:
|
||||
UnitMath() {}
|
||||
~UnitMath() override {}
|
||||
UnitMath() = default;
|
||||
~UnitMath() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class CompileTimeArithmetic : public ::testing::Test {
|
||||
protected:
|
||||
CompileTimeArithmetic() {}
|
||||
~CompileTimeArithmetic() override {}
|
||||
CompileTimeArithmetic() = default;
|
||||
~CompileTimeArithmetic() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class Constexpr : public ::testing::Test {
|
||||
protected:
|
||||
Constexpr() {}
|
||||
~Constexpr() override {}
|
||||
Constexpr() = default;
|
||||
~Constexpr() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
};
|
||||
|
||||
class CaseStudies : public ::testing::Test {
|
||||
protected:
|
||||
CaseStudies() {}
|
||||
~CaseStudies() override {}
|
||||
CaseStudies() = default;
|
||||
~CaseStudies() override = default;
|
||||
void SetUp() override {}
|
||||
void TearDown() override {}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ WebSocket::WebSocket(uv::Stream& stream, bool server, const private_init&)
|
||||
[this]() { Terminate(1006, "remote end closed connection"); });
|
||||
}
|
||||
|
||||
WebSocket::~WebSocket() {}
|
||||
WebSocket::~WebSocket() = default;
|
||||
|
||||
std::shared_ptr<WebSocket> WebSocket::CreateClient(
|
||||
uv::Stream& stream, const Twine& uri, const Twine& host,
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace uv {
|
||||
*/
|
||||
class Error {
|
||||
public:
|
||||
Error() {}
|
||||
Error() = default;
|
||||
explicit Error(int err) : m_err(err) {}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user