From b793bd36929350b1d7ebee4a731ca611553ab821 Mon Sep 17 00:00:00 2001 From: Steven Hahn <hahnse@ornl.gov> Date: Mon, 10 Apr 2017 10:20:49 -0400 Subject: [PATCH] Make changes suggested by clang-tidy check modernize-use-equals-delete --- .../ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.h | 10 +++++----- .../ParaViewFilters/SplatterPlot/vtkSplatterPlot.h | 9 ++++----- .../ParaViewSources/MDEWSource/vtkMDEWSource.h | 9 ++++----- .../SinglePeakMarkerSource/vtkSinglePeakMarkerSource.h | 10 ++++------ .../VatesAPI/inc/MantidVatesAPI/ADSWorkspaceProvider.h | 7 +++---- .../inc/MantidVatesAPI/FilteringUpdateProgressAction.h | 5 ++--- .../inc/MantidVatesAPI/IMDDimensionComparitor.h | 4 ++-- .../inc/MantidVatesAPI/vtkDataSetToImplicitFunction.h | 10 +++++----- .../inc/MantidVatesAPI/vtkDataSetToScaledDataSet.h | 4 +++- .../inc/MantidVatesAPI/vtkDataSetToWsLocation.h | 5 +++-- Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsName.h | 6 +++--- Vates/VatesAPI/src/ADSWorkspaceProvider.cpp | 5 ----- Vates/VatesAPI/src/vtkDataSetToImplicitFunction.cpp | 2 +- Vates/VatesAPI/src/vtkDataSetToScaledDataSet.cpp | 5 ++--- Vates/VatesAPI/src/vtkDataSetToWsName.cpp | 2 +- 15 files changed, 42 insertions(+), 51 deletions(-) diff --git a/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.h b/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.h index 1eb46d03436..5237cfd7c4e 100644 --- a/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.h +++ b/Vates/ParaviewPlugins/ParaViewFilters/ScaleWorkspace/vtkScaleWorkspace.h @@ -9,9 +9,11 @@ class VTK_EXPORT vtkScaleWorkspace : public vtkPointSetAlgorithm { public: static vtkScaleWorkspace *New(); - vtkTypeMacro(vtkScaleWorkspace, - vtkPointSetAlgorithm) void PrintSelf(ostream &os, - vtkIndent indent) override; + vtkScaleWorkspace(const vtkScaleWorkspace &) = delete; + void operator=(const vtkScaleWorkspace &) = delete; + vtkTypeMacro(vtkScaleWorkspace, vtkPointSetAlgorithm); + void PrintSelf(ostream &os, vtkIndent indent) override; + void SetXScaling(double xScaling); void SetYScaling(double yScaling); void SetZScaling(double zScaling); @@ -28,8 +30,6 @@ protected: int FillInputPortInformation(int port, vtkInformation *info) override; private: - vtkScaleWorkspace(const vtkScaleWorkspace &); - void operator=(const vtkScaleWorkspace &); void updateMetaData(vtkPointSet *inputDataSet); double m_xScaling; double m_yScaling; diff --git a/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.h b/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.h index 8fbb51d17e2..f3183f5f3dd 100644 --- a/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.h +++ b/Vates/ParaviewPlugins/ParaViewFilters/SplatterPlot/vtkSplatterPlot.h @@ -15,8 +15,10 @@ class vtkSplatterPlotFactory; class VTK_EXPORT vtkSplatterPlot : public vtkUnstructuredGridAlgorithm { public: static vtkSplatterPlot *New(); - vtkTypeMacro(vtkSplatterPlot, - vtkUnstructuredGridAlgorithm) double getTime() const; + vtkSplatterPlot(const vtkSplatterPlot &) = delete; + void operator=(const vtkSplatterPlot &) = delete; + vtkTypeMacro(vtkSplatterPlot, vtkUnstructuredGridAlgorithm); + double getTime() const; void PrintSelf(ostream &os, vtkIndent indent) override; void SetNumberOfPoints(int nPoints); void SetTopPercentile(double topPercentile); @@ -43,8 +45,5 @@ private: std::string m_wsName; /// Time. double m_time; - - vtkSplatterPlot(const vtkSplatterPlot &); - void operator=(const vtkSplatterPlot &); }; #endif diff --git a/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h b/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h index 8d7fcf208eb..92bb5bb2ed4 100644 --- a/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h +++ b/Vates/ParaviewPlugins/ParaViewSources/MDEWSource/vtkMDEWSource.h @@ -47,8 +47,10 @@ class MDLoadingPresenter; class VTK_EXPORT vtkMDEWSource : public vtkUnstructuredGridAlgorithm { public: static vtkMDEWSource *New(); - vtkTypeMacro(vtkMDEWSource, vtkUnstructuredGridAlgorithm) void PrintSelf( - ostream &os, vtkIndent indent) override; + vtkMDEWSource(const vtkMDEWSource &) = delete; + void operator=(const vtkMDEWSource &) = delete; + vtkTypeMacro(vtkMDEWSource, vtkUnstructuredGridAlgorithm); + void PrintSelf(ostream &os, vtkIndent indent) override; void SetWsName(const std::string &wsName); void SetDepth(int depth); @@ -96,9 +98,6 @@ private: /// Normalization option Mantid::VATES::VisualNormalization m_normalization; - - vtkMDEWSource(const vtkMDEWSource &); - void operator=(const vtkMDEWSource &); void setTimeRange(vtkInformationVector *outputVector); }; #endif diff --git a/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.h b/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.h index b7bb417ced0..556f9e339ba 100644 --- a/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.h +++ b/Vates/ParaviewPlugins/ParaViewSources/SinglePeakMarkerSource/vtkSinglePeakMarkerSource.h @@ -34,9 +34,10 @@ class VTK_EXPORT vtkSinglePeakMarkerSource : public vtkPolyDataAlgorithm { public: static vtkSinglePeakMarkerSource *New(); - vtkTypeMacro(vtkSinglePeakMarkerSource, - vtkPolyDataAlgorithm) void PrintSelf(ostream &os, - vtkIndent indent) override; + vtkSinglePeakMarkerSource(const vtkSinglePeakMarkerSource &); + void operator=(const vtkSinglePeakMarkerSource &); + vtkTypeMacro(vtkSinglePeakMarkerSource, vtkPolyDataAlgorithm); + void PrintSelf(ostream &os, vtkIndent indent) override; void SetRadiusMarker(double radius); void SetPosition1(double position1); void SetPosition2(double position2); @@ -56,8 +57,5 @@ private: double m_position2; double m_position3; double m_radius; - - vtkSinglePeakMarkerSource(const vtkSinglePeakMarkerSource &); - void operator=(const vtkSinglePeakMarkerSource &); }; #endif diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/ADSWorkspaceProvider.h b/Vates/VatesAPI/inc/MantidVatesAPI/ADSWorkspaceProvider.h index 0aaebab0e57..a01479eebef 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/ADSWorkspaceProvider.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/ADSWorkspaceProvider.h @@ -37,8 +37,9 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> template <typename Workspace_Type> class DLLExport ADSWorkspaceProvider : public WorkspaceProvider { public: - ADSWorkspaceProvider(); - ~ADSWorkspaceProvider() override; + ADSWorkspaceProvider() = default; + ADSWorkspaceProvider &operator=(const ADSWorkspaceProvider &) = delete; + ADSWorkspaceProvider(const ADSWorkspaceProvider &) = delete; //-------WorkspaceProivder Implementations ------------ bool canProvideWorkspace(std::string wsName) const override; @@ -46,8 +47,6 @@ public: void disposeWorkspace(std::string wsName) const override; private: - ADSWorkspaceProvider &operator=(const ADSWorkspaceProvider &); - ADSWorkspaceProvider(const ADSWorkspaceProvider &); }; } } diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/FilteringUpdateProgressAction.h b/Vates/VatesAPI/inc/MantidVatesAPI/FilteringUpdateProgressAction.h index af6bf79cba6..e76288b0cb8 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/FilteringUpdateProgressAction.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/FilteringUpdateProgressAction.h @@ -43,7 +43,8 @@ class DLLExport FilterUpdateProgressAction : public ProgressAction { public: FilterUpdateProgressAction(Filter *filter, const std::string &message) : m_filter(filter), m_message(message) {} - + FilterUpdateProgressAction &operator=(FilterUpdateProgressAction &) = delete; + FilterUpdateProgressAction(FilterUpdateProgressAction &) = delete; void eventRaised(double progress) override { m_filter->updateAlgorithmProgress(progress, m_message); } @@ -51,9 +52,7 @@ public: ~FilterUpdateProgressAction() {} private: - FilterUpdateProgressAction &operator=(FilterUpdateProgressAction &); - FilterUpdateProgressAction(FilterUpdateProgressAction &); Filter *m_filter; diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h b/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h index b22ab7dd6c1..2dddea68b71 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/IMDDimensionComparitor.h @@ -41,6 +41,8 @@ class IMDDimensionComparitor { public: /// Constructor IMDDimensionComparitor(Mantid::API::IMDWorkspace_sptr workspace); + IMDDimensionComparitor operator=(IMDDimensionComparitor &) = delete; + IMDDimensionComparitor(IMDDimensionComparitor &) = delete; /// Destructor ~IMDDimensionComparitor(); @@ -57,9 +59,7 @@ private: /// imd workspace shared ptr. Mantid::API::IMDWorkspace_sptr m_workspace; - IMDDimensionComparitor operator=(IMDDimensionComparitor &); - IMDDimensionComparitor(IMDDimensionComparitor &); }; } } diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToImplicitFunction.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToImplicitFunction.h index 541836cd542..d41d352c46d 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToImplicitFunction.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToImplicitFunction.h @@ -42,15 +42,15 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> */ class DLLExport vtkDataSetToImplicitFunction { public: - static Mantid::Geometry::MDImplicitFunction *exec(vtkDataSet *dataSet); vtkDataSetToImplicitFunction(vtkDataSet *dataSet); + vtkDataSetToImplicitFunction & + operator=(const vtkDataSetToImplicitFunction &other) = delete; + vtkDataSetToImplicitFunction(const vtkDataSetToImplicitFunction &other) = + delete; + static Mantid::Geometry::MDImplicitFunction *exec(vtkDataSet *dataSet); Mantid::Geometry::MDImplicitFunction *execute(); ~vtkDataSetToImplicitFunction(); - private: - vtkDataSetToImplicitFunction & - operator=(const vtkDataSetToImplicitFunction &other); - vtkDataSetToImplicitFunction(const vtkDataSetToImplicitFunction &other); vtkDataSet *m_dataset; }; } diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToScaledDataSet.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToScaledDataSet.h index 5c0b38494cf..117c1ecbd54 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToScaledDataSet.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToScaledDataSet.h @@ -39,6 +39,9 @@ class DLLExport vtkDataSetToScaledDataSet { public: /// Constructor vtkDataSetToScaledDataSet(); + vtkDataSetToScaledDataSet(const vtkDataSetToScaledDataSet &) = delete; + vtkDataSetToScaledDataSet & + operator=(const vtkDataSetToScaledDataSet &) = delete; /// Destructor virtual ~vtkDataSetToScaledDataSet(); /// Apply the scaling and add metadata @@ -50,7 +53,6 @@ public: vtkPointSet *outputData = nullptr); private: - vtkDataSetToScaledDataSet &operator=(const vtkDataSetToScaledDataSet &other); /// Set metadata on the dataset to handle scaling void updateMetaData(double xScale, double yScale, double zScale, vtkPointSet *inputData, vtkPointSet *outputData); diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsLocation.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsLocation.h index b5399483cec..74009819633 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsLocation.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsLocation.h @@ -39,14 +39,15 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> */ class DLLExport vtkDataSetToWsLocation { public: + vtkDataSetToWsLocation & + operator=(const vtkDataSetToWsLocation &other) = delete; + vtkDataSetToWsLocation(const vtkDataSetToWsLocation &other) = delete; static std::string exec(vtkDataSet *dataSet); vtkDataSetToWsLocation(vtkDataSet *dataSet); std::string execute(); ~vtkDataSetToWsLocation(); private: - vtkDataSetToWsLocation &operator=(const vtkDataSetToWsLocation &other); - vtkDataSetToWsLocation(const vtkDataSetToWsLocation &other); vtkDataSet *m_dataset; }; } diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsName.h b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsName.h index 8dffc74d03e..a4a6ee2f634 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsName.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/vtkDataSetToWsName.h @@ -39,14 +39,14 @@ Code Documentation is available at: <http://doxygen.mantidproject.org> */ class DLLExport vtkDataSetToWsName { public: - static std::string exec(vtkDataSet *dataSet); vtkDataSetToWsName(vtkDataSet *dataSet); + vtkDataSetToWsName &operator=(const vtkDataSetToWsName &other) = delete; + vtkDataSetToWsName(const vtkDataSetToWsName &other) = delete; + static std::string exec(vtkDataSet *dataSet); std::string execute(); ~vtkDataSetToWsName(); private: - vtkDataSetToWsName &operator=(const vtkDataSetToWsName &other); - vtkDataSetToWsName(const vtkDataSetToWsName &other); vtkDataSet *m_dataset; }; } diff --git a/Vates/VatesAPI/src/ADSWorkspaceProvider.cpp b/Vates/VatesAPI/src/ADSWorkspaceProvider.cpp index 476f9c28c2f..bb17975ab3f 100644 --- a/Vates/VatesAPI/src/ADSWorkspaceProvider.cpp +++ b/Vates/VatesAPI/src/ADSWorkspaceProvider.cpp @@ -9,11 +9,6 @@ using namespace Mantid::API; namespace Mantid { namespace VATES { -template <typename Workspace_Type> -ADSWorkspaceProvider<Workspace_Type>::ADSWorkspaceProvider() {} - -template <typename Workspace_Type> -ADSWorkspaceProvider<Workspace_Type>::~ADSWorkspaceProvider() {} template <typename Workspace_Type> bool ADSWorkspaceProvider<Workspace_Type>::canProvideWorkspace( diff --git a/Vates/VatesAPI/src/vtkDataSetToImplicitFunction.cpp b/Vates/VatesAPI/src/vtkDataSetToImplicitFunction.cpp index 415eda9a6e4..fb622d3396e 100644 --- a/Vates/VatesAPI/src/vtkDataSetToImplicitFunction.cpp +++ b/Vates/VatesAPI/src/vtkDataSetToImplicitFunction.cpp @@ -63,6 +63,6 @@ Mantid::Geometry::MDImplicitFunction *vtkDataSetToImplicitFunction::execute() { } /// Destructor. -vtkDataSetToImplicitFunction::~vtkDataSetToImplicitFunction() {} +vtkDataSetToImplicitFunction::~vtkDataSetToImplicitFunction() = default; } } diff --git a/Vates/VatesAPI/src/vtkDataSetToScaledDataSet.cpp b/Vates/VatesAPI/src/vtkDataSetToScaledDataSet.cpp index b6631234d7f..a43bcc5672f 100644 --- a/Vates/VatesAPI/src/vtkDataSetToScaledDataSet.cpp +++ b/Vates/VatesAPI/src/vtkDataSetToScaledDataSet.cpp @@ -23,9 +23,8 @@ namespace VATES { /** * Standard constructor for object. */ -vtkDataSetToScaledDataSet::vtkDataSetToScaledDataSet() {} - -vtkDataSetToScaledDataSet::~vtkDataSetToScaledDataSet() {} +vtkDataSetToScaledDataSet::vtkDataSetToScaledDataSet() = + default vtkDataSetToScaledDataSet::~vtkDataSetToScaledDataSet() = default; /** * Process the input data. First, scale a copy of the points and apply diff --git a/Vates/VatesAPI/src/vtkDataSetToWsName.cpp b/Vates/VatesAPI/src/vtkDataSetToWsName.cpp index f4a88bc8efa..4754805d1e5 100644 --- a/Vates/VatesAPI/src/vtkDataSetToWsName.cpp +++ b/Vates/VatesAPI/src/vtkDataSetToWsName.cpp @@ -55,6 +55,6 @@ std::string vtkDataSetToWsName::execute() { } /// Destructor. -vtkDataSetToWsName::~vtkDataSetToWsName() {} +vtkDataSetToWsName::~vtkDataSetToWsName() = default; } } -- GitLab