Skip to content

Commit

Permalink
Fix non-virtual destructor and other warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
robertapplin authored and GuiMacielPereira committed May 16, 2024
1 parent a2b0974 commit 2ebd4d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ FitPlotModel::FitPlotModel(std::vector<FitData> *fittingData, IFitOutput *fitOut
: m_fittingData(fittingData), m_fitOutput(fitOutput), m_activeWorkspaceID{0}, m_activeWorkspaceIndex{0},
m_activeFunction() {}

FitPlotModel::~FitPlotModel() {}

void FitPlotModel::setActiveIndex(WorkspaceID workspaceID) { m_activeWorkspaceID = workspaceID; }

void FitPlotModel::setActiveSpectrum(WorkspaceIndex spectrum) { m_activeWorkspaceIndex = spectrum; }
Expand Down
5 changes: 3 additions & 2 deletions qt/scientific_interfaces/Inelastic/QENSFitting/FitPlotModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ using namespace MantidWidgets;

class MANTIDQT_INELASTIC_DLL IFitPlotModel {
public:
virtual ~IFitPlotModel() = default;

virtual Mantid::API::MatrixWorkspace_sptr getWorkspace() const = 0;
virtual Mantid::API::MatrixWorkspace_sptr getResultWorkspace() const = 0;
virtual Mantid::API::MatrixWorkspace_sptr getGuessWorkspace() const = 0;
Expand All @@ -50,10 +52,9 @@ class MANTIDQT_INELASTIC_DLL IFitPlotModel {
virtual void setFitFunction(Mantid::API::MultiDomainFunction_sptr function) = 0;
};

class MANTIDQT_INELASTIC_DLL FitPlotModel : public IFitPlotModel {
class MANTIDQT_INELASTIC_DLL FitPlotModel final : public IFitPlotModel {
public:
FitPlotModel(std::vector<FitData> *fittingData, IFitOutput *fitOutput);
~FitPlotModel();

Mantid::API::MatrixWorkspace_sptr getWorkspace() const override;
Mantid::API::MatrixWorkspace_sptr getResultWorkspace() const override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,9 @@ std::unordered_map<FittingMode, std::string> fitModeToName = std::unordered_map<
{{FittingMode::SEQUENTIAL, "Seq"}, {FittingMode::SIMULTANEOUS, "Sim"}});

FittingModel::FittingModel()
: m_fitDataModel(std::make_unique<FitDataModel>()), m_fitPlotModel(), m_fitOutput(std::make_unique<FitOutput>()),
m_previousModelSelected(false), m_fittingMode(FittingMode::SEQUENTIAL) {
: m_fitType("FitType"), m_fitString("FitString"), m_fitDataModel(std::make_unique<FitDataModel>()),
m_fitPlotModel(), m_previousModelSelected(false), m_fittingMode(FittingMode::SEQUENTIAL),
m_fitOutput(std::make_unique<FitOutput>()), m_activeFunction(), m_fitFunction(), m_defaultParameters() {
m_fitPlotModel = std::make_unique<FitPlotModel>(m_fitDataModel->getFittingData(), m_fitOutput.get());
}

Expand Down
4 changes: 2 additions & 2 deletions qt/scientific_interfaces/Inelastic/QENSFitting/FittingModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class MANTIDQT_INELASTIC_DLL FittingModel : public IFittingModel {
Mantid::API::IAlgorithm_sptr createSimultaneousFit(const Mantid::API::MultiDomainFunction_sptr &function) const;
virtual Mantid::API::MultiDomainFunction_sptr getMultiDomainFunction() const;
virtual std::unordered_map<std::string, std::string> mapDefaultParameterNames() const;
std::string m_fitType = "FitType";
std::string m_fitString = "FitString";
std::string m_fitType;
std::string m_fitString;

std::unique_ptr<IFitDataModel> m_fitDataModel;
std::unique_ptr<IFitPlotModel> m_fitPlotModel;
Expand Down

0 comments on commit 2ebd4d4

Please sign in to comment.