modernize-use-nullptr,modernize-use-emplace,
modernize-make-unique,modernize-make-shared,
modernize-avoid-bind,
+ modernize-use-override,
modernize-redundant-void-arg,modernize-use-bool-literals,
cppcoreguidelines-*,-cppcoreguidelines-pro-*,-cppcoreguidelines-owning-memory,
-cppcoreguidelines-no-malloc,-cppcoreguidelines-special-member-functions,
modernize-use-nullptr,modernize-use-emplace,
modernize-make-unique,modernize-make-shared,
modernize-avoid-bind,
+ modernize-use-override,
modernize-redundant-void-arg,modernize-use-bool-literals,
cppcoreguidelines-*,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-pro-type-const-cast,
-cppcoreguidelines-pro-type-static-cast-downcast,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* \throws std::bad_alloc if out of memory.
*/
AnalysisData();
- virtual ~AnalysisData();
+ ~AnalysisData() override;
/*! \brief
* Sets the number of data sets.
*/
void setMultipoint(bool bMultipoint);
- virtual int frameCount() const;
+ int frameCount() const override;
/*! \brief
* Creates a handle for adding data.
void finishData(AnalysisDataHandle handle);
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
class Impl;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
class AbstractAnalysisArrayData : public AbstractAnalysisData
{
public:
- virtual ~AbstractAnalysisArrayData();
+ ~AbstractAnalysisArrayData() override;
- virtual int frameCount() const
+ int frameCount() const override
{
return bReady_ ? rowCount_ : 0;
}
AbstractAnalysisArrayData *dest);
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
int rowCount_;
AnalysisDataPointSetInfo pointSetInfo_;
class AnalysisDataModuleSerial : public IAnalysisDataModule
{
public:
- virtual ~AnalysisDataModuleSerial() {}
+ ~AnalysisDataModuleSerial() override {}
- virtual int flags() const = 0;
+ int flags() const override = 0;
- virtual void dataStarted(AbstractAnalysisData *data) = 0;
- virtual void frameStarted(const AnalysisDataFrameHeader &frame) = 0;
- virtual void pointsAdded(const AnalysisDataPointSetRef &points) = 0;
- virtual void frameFinished(const AnalysisDataFrameHeader &header) = 0;
- virtual void dataFinished() = 0;
+ void dataStarted(AbstractAnalysisData *data) override = 0;
+ void frameStarted(const AnalysisDataFrameHeader &frame) override = 0;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override = 0;
+ void frameFinished(const AnalysisDataFrameHeader &header) override = 0;
+ void dataFinished() override = 0;
private:
- virtual bool parallelDataStarted(
+ bool parallelDataStarted(
AbstractAnalysisData *data,
- const AnalysisDataParallelOptions &options);
- virtual void frameFinishedSerial(int /*frameIndex*/) {}
+ const AnalysisDataParallelOptions &options) override;
+ void frameFinishedSerial(int /*frameIndex*/) override {}
};
/*! \brief
class AnalysisDataModuleParallel : public IAnalysisDataModule
{
public:
- virtual ~AnalysisDataModuleParallel() {}
+ ~AnalysisDataModuleParallel() override {}
- virtual int flags() const = 0;
+ int flags() const override = 0;
- virtual bool parallelDataStarted(
+ bool parallelDataStarted(
AbstractAnalysisData *data,
- const AnalysisDataParallelOptions &options) = 0;
- virtual void frameStarted(const AnalysisDataFrameHeader &frame) = 0;
- virtual void pointsAdded(const AnalysisDataPointSetRef &points) = 0;
- virtual void frameFinished(const AnalysisDataFrameHeader &header) = 0;
- virtual void frameFinishedSerial(int index) = 0;
- virtual void dataFinished() = 0;
+ const AnalysisDataParallelOptions &options) override = 0;
+ void frameStarted(const AnalysisDataFrameHeader &frame) override = 0;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override = 0;
+ void frameFinished(const AnalysisDataFrameHeader &header) override = 0;
+ void frameFinishedSerial(int index) override = 0;
+ void dataFinished() override = 0;
private:
- virtual void dataStarted(AbstractAnalysisData *data);
+ void dataStarted(AbstractAnalysisData *data) override;
};
} // namespace gmx
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
AnalysisDataProxy(int firstColumn, int columnSpan,
AbstractAnalysisData *data);
- virtual int frameCount() const;
+ int frameCount() const override;
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual bool parallelDataStarted(
+ void dataStarted(AbstractAnalysisData *data) override;
+ bool parallelDataStarted(
AbstractAnalysisData *data,
- const AnalysisDataParallelOptions &options);
- virtual void frameStarted(const AnalysisDataFrameHeader &frame);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void frameFinishedSerial(int frameIndex);
- virtual void dataFinished();
+ const AnalysisDataParallelOptions &options) override;
+ void frameStarted(const AnalysisDataFrameHeader &frame) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void frameFinishedSerial(int frameIndex) override;
+ void dataFinished() override;
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
AbstractAnalysisData &source_;
int firstColumn_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
AnalysisDataAverageModule();
- virtual ~AnalysisDataAverageModule();
+ ~AnalysisDataAverageModule() override;
using AbstractAnalysisArrayData::setXAxis;
using AbstractAnalysisArrayData::setXAxisValue;
*/
void setAverageDataSets(bool bDataSets);
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
/*! \brief
* Convenience access to the average of a data column.
{
public:
AnalysisDataFrameAverageModule();
- virtual ~AnalysisDataFrameAverageModule();
+ ~AnalysisDataFrameAverageModule() override;
- virtual int frameCount() const;
+ int frameCount() const override;
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
class Impl;
{
public:
AnalysisDataDisplacementModule();
- virtual ~AnalysisDataDisplacementModule();
+ ~AnalysisDataDisplacementModule() override;
/*! \brief
* Sets the largest displacement time to be calculated.
*/
void setMSDHistogram(const std::shared_ptr<AnalysisDataBinAverageModule> &histm);
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
class Impl;
using AbstractAverageHistogram::init;
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
private:
//! Averaging helper objects for each input data set.
class AbstractAverageHistogram : public AbstractAnalysisArrayData
{
public:
- virtual ~AbstractAverageHistogram();
+ ~AbstractAverageHistogram() override;
//! Returns bin properties for the histogram.
const AnalysisHistogramSettings &settings() const { return settings_; }
AnalysisDataSimpleHistogramModule();
//! Creates a histogram module with defined bin parameters.
explicit AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &settings);
- virtual ~AnalysisDataSimpleHistogramModule();
+ ~AnalysisDataSimpleHistogramModule() override;
/*! \brief
* (Re)initializes the histogram from settings.
//! Returns bin properties for the histogram.
const AnalysisHistogramSettings &settings() const;
- virtual int frameCount() const;
+ int frameCount() const override;
- virtual int flags() const;
+ int flags() const override;
- virtual bool parallelDataStarted(
+ bool parallelDataStarted(
AbstractAnalysisData *data,
- const AnalysisDataParallelOptions &options);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void frameFinishedSerial(int frameIndex);
- virtual void dataFinished();
+ const AnalysisDataParallelOptions &options) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void frameFinishedSerial(int frameIndex) override;
+ void dataFinished() override;
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
class Impl;
AnalysisDataWeightedHistogramModule();
//! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &)
explicit AnalysisDataWeightedHistogramModule(const AnalysisHistogramSettings &settings);
- virtual ~AnalysisDataWeightedHistogramModule();
+ ~AnalysisDataWeightedHistogramModule() override;
//! \copydoc AnalysisDataSimpleHistogramModule::init()
void init(const AnalysisHistogramSettings &settings);
//! \copydoc AnalysisDataSimpleHistogramModule::settings()
const AnalysisHistogramSettings &settings() const;
- virtual int frameCount() const;
+ int frameCount() const override;
- virtual int flags() const;
+ int flags() const override;
- virtual bool parallelDataStarted(
+ bool parallelDataStarted(
AbstractAnalysisData *data,
- const AnalysisDataParallelOptions &options);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void frameFinishedSerial(int frameIndex);
- virtual void dataFinished();
+ const AnalysisDataParallelOptions &options) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void frameFinishedSerial(int frameIndex) override;
+ void dataFinished() override;
private:
- virtual AnalysisDataFrameRef tryGetDataFrameInternal(int index) const;
- virtual bool requestStorageInternal(int nframes);
+ AnalysisDataFrameRef tryGetDataFrameInternal(int index) const override;
+ bool requestStorageInternal(int nframes) override;
class Impl;
AnalysisDataBinAverageModule();
//! \copydoc AnalysisDataSimpleHistogramModule::AnalysisDataSimpleHistogramModule(const AnalysisHistogramSettings &)
explicit AnalysisDataBinAverageModule(const AnalysisHistogramSettings &settings);
- virtual ~AnalysisDataBinAverageModule();
+ ~AnalysisDataBinAverageModule() override;
//! \copydoc AnalysisDataSimpleHistogramModule::init()
void init(const AnalysisHistogramSettings &settings);
//! \copydoc AnalysisDataSimpleHistogramModule::settings()
const AnalysisHistogramSettings &settings() const;
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
private:
class Impl;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
AnalysisDataLifetimeModule();
- virtual ~AnalysisDataLifetimeModule();
+ ~AnalysisDataLifetimeModule() override;
/*! \brief
* Sets a cumulative histogram mode.
*/
void setCumulative(bool bCumulative);
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
private:
class Impl;
class AbstractPlotModule : public AnalysisDataModuleSerial
{
public:
- virtual ~AbstractPlotModule();
+ ~AbstractPlotModule() override;
/*! \brief
* Set common settings for the plotting.
*/
void setYFormat(int width, int precision, char format = 'f');
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points) = 0;
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override = 0;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
protected:
/*! \cond libapi */
//! Creates AnalysisDataPlotModule and assign common settings.
explicit AnalysisDataPlotModule(const AnalysisDataPlotSettings &settings);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
// Copy and assign disallowed by base.
};
*/
void setWriteMask(const bool bWrite[4]);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
private:
bool bWrite_[4];
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
}
- void SetUp()
+ void SetUp() override
{
ASSERT_NO_THROW_GMX(setupDataObject(input_, &data_));
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
explicit MockAnalysisDataModule(int flags);
- virtual ~MockAnalysisDataModule();
+ ~MockAnalysisDataModule() override;
- virtual int flags() const;
+ int flags() const override;
MOCK_METHOD2(parallelDataStarted,
bool(AbstractAnalysisData *data,
{
}
- virtual const char *name() const;
- virtual const char *title() const { return title_.c_str(); }
+ const char *name() const override;
+ const char *title() const override { return title_.c_str(); }
//! Adds a top-level topic and optionally marks it as exported.
void addTopic(HelpTopicPointer topic, bool bExported)
//! Exports all the top-level topics with the given exporter.
void exportHelp(IHelpExport *exporter);
- virtual void writeHelp(const HelpWriterContext &context) const;
+ void writeHelp(const HelpWriterContext &context) const override;
private:
// unused because of the writeHelp() override
- virtual std::string helpText() const { return ""; }
+ std::string helpText() const override { return ""; }
CommandLineHelpContext createContext(const HelpWriterContext &context) const;
{
}
- virtual const char *name() const { return "commands"; }
- virtual const char *title() const { return "List of available commands"; }
- virtual bool hasSubTopics() const { return false; }
- virtual const IHelpTopic *findSubTopic(const char * /*name*/) const
+ const char *name() const override { return "commands"; }
+ const char *title() const override { return "List of available commands"; }
+ bool hasSubTopics() const override { return false; }
+ const IHelpTopic *findSubTopic(const char * /*name*/) const override
{
return nullptr;
}
- virtual void writeHelp(const HelpWriterContext &context) const;
+ void writeHelp(const HelpWriterContext &context) const override;
private:
const CommandLineHelpModuleImpl &helpModule_;
{
}
- virtual const char *name() const { return module_.name(); }
- virtual const char *title() const { return nullptr; }
- virtual bool hasSubTopics() const { return false; }
- virtual const IHelpTopic *findSubTopic(const char * /*name*/) const
+ const char *name() const override { return module_.name(); }
+ const char *title() const override { return nullptr; }
+ bool hasSubTopics() const override { return false; }
+ const IHelpTopic *findSubTopic(const char * /*name*/) const override
{
return nullptr;
}
- virtual void writeHelp(const HelpWriterContext &context) const;
+ void writeHelp(const HelpWriterContext &context) const override;
private:
const ICommandLineModule &module_;
const CommandLineHelpModuleImpl &helpModule,
IFileOutputRedirector *outputRedirector);
- virtual void startModuleExport();
- virtual void exportModuleHelp(
+ void startModuleExport() override;
+ void exportModuleHelp(
const ICommandLineModule &module,
const std::string &tag,
- const std::string &displayName);
- virtual void finishModuleExport();
+ const std::string &displayName) override;
+ void finishModuleExport() override;
- virtual void startModuleGroupExport();
- virtual void exportModuleGroup(const char *title,
- const ModuleGroupContents &modules);
- virtual void finishModuleGroupExport();
+ void startModuleGroupExport() override;
+ void exportModuleGroup(const char *title,
+ const ModuleGroupContents &modules) override;
+ void finishModuleGroupExport() override;
- virtual void exportTopic(const IHelpTopic &topic);
+ void exportTopic(const IHelpTopic &topic) override;
private:
IFileOutputRedirector *outputRedirector_;
//! Initializes completion exporter.
explicit HelpExportCompletion(const CommandLineHelpModuleImpl &helpModule);
- virtual void startModuleExport();
- virtual void exportModuleHelp(
+ void startModuleExport() override;
+ void exportModuleHelp(
const ICommandLineModule &module,
const std::string &tag,
- const std::string &displayName);
- virtual void finishModuleExport();
+ const std::string &displayName) override;
+ void finishModuleExport() override;
- virtual void startModuleGroupExport() {}
- virtual void exportModuleGroup(const char * /*title*/,
- const ModuleGroupContents & /*modules*/) {}
- virtual void finishModuleGroupExport() {}
+ void startModuleGroupExport() override {}
+ void exportModuleGroup(const char * /*title*/,
+ const ModuleGroupContents & /*modules*/) override {}
+ void finishModuleGroupExport() override {}
- virtual void exportTopic(const IHelpTopic & /*topic*/) {}
+ void exportTopic(const IHelpTopic & /*topic*/) override {}
private:
ShellCompletionWriter bashWriter_;
{
}
- virtual void write(const char *str) { contents_.write(str); }
- virtual void close()
+ void write(const char *str) override { contents_.write(str); }
+ void close() override
{
const std::string &newContents = contents_.toString();
// TODO: Redirect these for unit tests.
{
}
- virtual TextOutputStream &standardOutput()
+ TextOutputStream &standardOutput() override
{
return redirector_->standardOutput();
}
- virtual TextOutputStreamPointer openTextOutputFile(const char *filename)
+ TextOutputStreamPointer openTextOutputFile(const char *filename) override
{
return TextOutputStreamPointer(
new ModificationCheckingFileOutputStream(filename, redirector_));
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
const std::string &binaryName,
const CommandLineModuleMap &modules,
const CommandLineModuleGroupList &groups);
- ~CommandLineHelpModule();
+ ~CommandLineHelpModule() override;
/*! \brief
* Creates a help topic for a command-line module.
*/
void setOutputRedirector(IFileOutputRedirector *output);
- virtual const char *name() const { return "help"; }
- virtual const char *shortDescription() const
+ const char *name() const override { return "help"; }
+ const char *shortDescription() const override
{
return "Print help information";
}
- virtual void init(CommandLineModuleSettings *settings)
+ void init(CommandLineModuleSettings *settings) override
{
settings->setDefaultNiceLevel(0);
}
- virtual int run(int argc, char *argv[]);
- virtual void writeHelp(const CommandLineHelpContext &context) const;
+ int run(int argc, char *argv[]) override;
+ void writeHelp(const CommandLineHelpContext &context) const override;
private:
typedef CommandLineHelpModuleImpl Impl;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
IOptionsFormatter *formatter,
const Options &options);
- virtual void visitSection(const OptionSectionInfo §ion);
- virtual void visitOption(const OptionInfo &option);
+ void visitSection(const OptionSectionInfo §ion) override;
+ void visitOption(const OptionInfo &option) override;
private:
IOptionsFormatter *formatter_;
//! Finishes formatting the synopsis.
void finish();
- virtual void formatOption(const OptionInfo &option);
+ void formatOption(const OptionInfo &option) override;
private:
const HelpWriterContext &context_;
}
}
- virtual void formatOption(const OptionInfo &option);
+ void formatOption(const OptionInfo &option) override;
private:
void writeSectionStartIfNecessary()
{
}
- virtual const char *name() const
+ const char *name() const override
{
return name_;
}
- virtual const char *shortDescription() const
+ const char *shortDescription() const override
{
return shortDescription_;
}
- virtual void init(CommandLineModuleSettings *settings)
+ void init(CommandLineModuleSettings *settings) override
{
if (settingsFunction_ != nullptr)
{
settingsFunction_(settings);
}
}
- virtual int run(int argc, char *argv[])
+ int run(int argc, char *argv[]) override
{
return mainFunction_(argc, argv);
}
- virtual void writeHelp(const CommandLineHelpContext &context) const
+ void writeHelp(const CommandLineHelpContext &context) const override
{
writeCommandLineHelpCMain(context, name_, mainFunction_);
}
const std::string &helpText() const { return helpText_; }
- virtual void setHelpText(const ArrayRef<const char *const> &help)
+ void setHelpText(const ArrayRef<const char *const> &help) override
{
helpText_ = joinStrings(help, "\n");
}
- virtual void addOptionsBehavior(const OptionsBehaviorPointer &behavior)
+ void addOptionsBehavior(const OptionsBehaviorPointer &behavior) override
{
behaviors_.addBehavior(behavior);
}
: name_(name), description_(description), module_(std::move(module))
{
}
- virtual const char *name() const { return name_; }
- virtual const char *shortDescription() const { return description_; }
+ const char *name() const override { return name_; }
+ const char *shortDescription() const override { return description_; }
- virtual void init(CommandLineModuleSettings *settings);
- virtual int run(int argc, char *argv[]);
- virtual void writeHelp(const CommandLineHelpContext &context) const;
+ void init(CommandLineModuleSettings *settings) override;
+ int run(int argc, char *argv[]) override;
+ void writeHelp(const CommandLineHelpContext &context) const override;
private:
void parseOptions(int argc, char *argv[]);
{
}
- virtual std::string getWorkingDirectory() const
+ std::string getWorkingDirectory() const override
{
return initialWorkingDirectory_;
}
- virtual std::vector<std::string> getExecutablePaths() const
+ std::vector<std::string> getExecutablePaths() const override
{
return Path::getExecutablePaths();
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
CommandLineProgramContext(int argc, const char *const argv[],
ExecutableEnvironmentPointer env);
- virtual ~CommandLineProgramContext();
+ ~CommandLineProgramContext() override;
/*! \brief
* Sets a display name for the binary.
*
* Does not throw.
*/
- virtual const char *programName() const;
+ const char *programName() const override;
/*! \brief
* Returns a display name of the current module.
*
*
* Does not throw.
*/
- virtual const char *displayName() const;
+ const char *displayName() const override;
/*! \brief
* Returns the full path of the running binary.
*
*
* Returns argv[0] if there was an error in finding the absolute path.
*/
- virtual const char *fullBinaryPath() const;
+ const char *fullBinaryPath() const override;
/*! \brief
* Returns the installation prefix (for finding \Gromacs data files).
*
* Returns a hardcoded path set during configuration time if there is
* an error in finding the library data files.
*/
- virtual InstallationPrefixInfo installationPrefix() const;
+ InstallationPrefixInfo installationPrefix() const override;
/*! \brief
* Returns the full command line used to invoke the binary.
*
* Does not throw.
*/
- virtual const char *commandLine() const;
+ const char *commandLine() const override;
private:
class Impl;
public:
const std::string &optionList() const { return optionList_; }
- virtual void visitSection(const OptionSectionInfo §ion)
+ void visitSection(const OptionSectionInfo §ion) override
{
OptionsIterator iterator(section);
iterator.acceptSections(this);
iterator.acceptOptions(this);
}
- virtual void visitOption(const OptionInfo &option)
+ void visitOption(const OptionInfo &option) override
{
if (option.isHidden())
{
public:
explicit OptionCompletionWriter(TextWriter *out) : out_(*out) {}
- virtual void visitSection(const OptionSectionInfo §ion)
+ void visitSection(const OptionSectionInfo §ion) override
{
OptionsIterator iterator(section);
iterator.acceptSections(this);
iterator.acceptOptions(this);
}
- virtual void visitOption(const OptionInfo &option);
+ void visitOption(const OptionInfo &option) override;
private:
void writeOptionCompletion(const OptionInfo &option,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
public:
//! Creates a mock module with the given name and description.
MockModule(const char *name, const char *description);
- ~MockModule();
+ ~MockModule() override;
- virtual const char *name() const { return name_; }
- virtual const char *shortDescription() const { return descr_; }
+ const char *name() const override { return name_; }
+ const char *shortDescription() const override { return descr_; }
MOCK_METHOD1(init, void(gmx::CommandLineModuleSettings *settings));
MOCK_METHOD2(run, int(int argc, char *argv[]));
{
public:
MockOptionsModule();
- ~MockOptionsModule();
+ ~MockOptionsModule() override;
MOCK_METHOD1(init, void(gmx::CommandLineModuleSettings *settings));
MOCK_METHOD2(initOptions, void(gmx::IOptionsContainer *options, gmx::ICommandLineOptionsModuleSettings *settings));
{
public:
CommandLineModuleManagerTestBase();
- ~CommandLineModuleManagerTestBase();
+ ~CommandLineModuleManagerTestBase() override;
//! Creates the manager to run the given command line.
void initManager(const CommandLine &args, const char *realBinaryName);
{
}
- virtual std::string getWorkingDirectory() const
+ std::string getWorkingDirectory() const override
{
return workingDirectory_;
}
- virtual std::vector<std::string> getExecutablePaths() const
+ std::vector<std::string> getExecutablePaths() const override
{
return path_;
}
: oenv_(nullptr), fileCount_(0)
{
}
- virtual ~ParseCommonArgsTest()
+ ~ParseCommonArgsTest() override
{
output_env_done(oenv_);
}
public:
//! This is called by GTest framework once to query the hardware
- virtual void SetUp();
+ void SetUp() override;
//! This is called by GTest framework once to clean up
- virtual void TearDown();
+ void TearDown() override;
//! Get available hardware contexts.
const TestHardwareContexts &getHardwareContexts() const {return hardwareContexts_; }
};
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
checker_.setDefaultTolerance(
gmx::test::relativeToleranceAsPrecisionDependentUlp(10.0, 64, 512));
}
- ~BaseFFTTest()
+ ~BaseFFTTest() override
{
gmx_fft_cleanup();
}
FFTTest() : fft_(nullptr)
{
}
- ~FFTTest()
+ ~FFTTest() override
{
if (fft_)
{
ManyFFTTest() : fft_(nullptr)
{
}
- ~ManyFFTTest()
+ ~ManyFFTTest() override
{
if (fft_)
{
FFFTest3D() : fft_(nullptr)
{
}
- ~FFFTest3D()
+ ~FFFTest3D() override
{
if (fft_)
{
public:
explicit FileIOXdrSerializer(t_fileio *fio) : fio_(fio) {}
- virtual bool reading() const;
-
- virtual void doBool(bool *value);
- virtual void doUChar(unsigned char *value);
- virtual void doInt(int *value);
- virtual void doInt64(int64_t *value);
- virtual void doFloat(float *value);
- virtual void doDouble(double *value);
- virtual void doString(std::string *value);
+ bool reading() const override;
+
+ void doBool(bool *value) override;
+ void doUChar(unsigned char *value) override;
+ void doInt(int *value) override;
+ void doInt64(int64_t *value) override;
+ void doFloat(float *value) override;
+ void doDouble(double *value) override;
+ void doString(std::string *value) override;
private:
t_fileio *fio_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
testFilename_ =
fileManager_.getTemporaryFilePath(getFileSuffix("test"));
}
- ~StructureIORoundtripTest()
+ ~StructureIORoundtripTest() override
{
if (testTop_ != nullptr)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
// From ITopologyProvider
- virtual gmx_mtop_t *getTopology(bool /*required*/) { return &top_; }
- virtual int getAtomCount() { return 0; }
+ gmx_mtop_t *getTopology(bool /*required*/) override { return &top_; }
+ int getAtomCount() override { return 0; }
// From ICommandLineOptionsModule
- virtual void init(CommandLineModuleSettings * /*settings*/)
+ void init(CommandLineModuleSettings * /*settings*/) override
{
}
- virtual void initOptions(IOptionsContainer *options,
- ICommandLineOptionsModuleSettings *settings);
- virtual void optionsFinished();
- virtual int run();
+ void initOptions(IOptionsContainer *options,
+ ICommandLineOptionsModuleSettings *settings) override;
+ void optionsFinished() override;
+ int run() override;
private:
SelectionCollection selections_;
mapping_ = &mapping;
}
- virtual bool onError(gmx::UserInputError *ex, const gmx::KeyValueTreePath &context)
+ bool onError(gmx::UserInputError *ex, const gmx::KeyValueTreePath &context) override
{
ex->prependContext(gmx::formatString("Error in mdp option \"%s\":",
getOptionName(context).c_str()));
snew(opts_.include, STRLEN);
snew(opts_.define, STRLEN);
}
- ~GetIrTest()
+ ~GetIrTest() override
{
done_inputrec_strings();
sfree(opts_.include);
//! Constructor
GpuTest();
//! Destructor
- ~GpuTest();
+ ~GpuTest() override;
//! Getter for convenience in testing
bool haveValidGpus() const;
};
public:
/*! \brief Set up data for test cases to use when constructing
their input */
- void SetUp()
+ void SetUp() override
{
inverseMassesDatabase_.push_back(2.0);
inverseMassesDatabase_.push_back(3.0);
}
// From IMDOutputProvider
- virtual void initOutput(FILE *fplog, int nfile, const t_filenm fnm[],
- bool bAppendFiles, const gmx_output_env_t *oenv)
+ void initOutput(FILE *fplog, int nfile, const t_filenm fnm[],
+ bool bAppendFiles, const gmx_output_env_t *oenv) override
{
field_->outputProvider()->initOutput(fplog, nfile, fnm, bAppendFiles, oenv);
}
- virtual void finishOutput()
+ void finishOutput() override
{
field_->outputProvider()->finishOutput();
}
{
public:
MockThreadAffinityAccess();
- ~MockThreadAffinityAccess();
+ ~MockThreadAffinityAccess() override;
void setSupported(bool supported) { supported_ = supported; }
- virtual bool isThreadAffinitySupported() const { return supported_; }
+ bool isThreadAffinitySupported() const override { return supported_; }
MOCK_METHOD1(setCurrentThreadAffinityToCore, bool(int core));
private:
class DefaultThreadAffinityAccess : public gmx::IThreadAffinityAccess
{
public:
- virtual bool isThreadAffinitySupported() const
+ bool isThreadAffinitySupported() const override
{
return tMPI_Thread_setaffinity_support() == TMPI_SETAFFINITY_SUPPORT_YES;
}
- virtual bool setCurrentThreadAffinityToCore(int core)
+ bool setCurrentThreadAffinityToCore(int core) override
{
const int ret = tMPI_Thread_setaffinity_single(tMPI_Thread_self(), core);
return ret == 0;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
class AbstractSimpleHelpTopic : public IHelpTopic
{
public:
- virtual const char *name() const = 0;
- virtual const char *title() const = 0;
+ const char *name() const override = 0;
+ const char *title() const override = 0;
- virtual bool hasSubTopics() const;
- virtual const IHelpTopic *findSubTopic(const char *name) const;
+ bool hasSubTopics() const override;
+ const IHelpTopic *findSubTopic(const char *name) const override;
- virtual void writeHelp(const HelpWriterContext &context) const;
+ void writeHelp(const HelpWriterContext &context) const override;
protected:
/*! \brief
{
public:
AbstractCompositeHelpTopic();
- virtual ~AbstractCompositeHelpTopic();
+ ~AbstractCompositeHelpTopic() override;
- virtual const char *name() const = 0;
- virtual const char *title() const = 0;
+ const char *name() const override = 0;
+ const char *title() const override = 0;
- virtual bool hasSubTopics() const;
- virtual const IHelpTopic *findSubTopic(const char *name) const;
+ bool hasSubTopics() const override;
+ const IHelpTopic *findSubTopic(const char *name) const override;
- virtual void writeHelp(const HelpWriterContext &context) const;
+ void writeHelp(const HelpWriterContext &context) const override;
/*! \brief
* Adds a given topic as a subtopic of this topic.
class SimpleHelpTopic : public AbstractSimpleHelpTopic
{
public:
- virtual const char *name() const
+ const char *name() const override
{
return HelpText::name;
}
- virtual const char *title() const
+ const char *title() const override
{
return HelpText::title;
}
protected:
- virtual std::string helpText() const
+ std::string helpText() const override
{
return joinStrings(HelpText::text, "\n");
}
public:
// copydocs are needed with Doxygen 1.8.10, but not 1.8.5...
//! \copydoc gmx::AbstractCompositeHelpTopic::name()
- virtual const char *name() const
+ const char *name() const override
{
return HelpText::name;
}
//! \copydoc gmx::AbstractCompositeHelpTopic::title()
- virtual const char *title() const
+ const char *title() const override
{
return HelpText::title;
}
protected:
//! \copydoc gmx::AbstractCompositeHelpTopic::helpText()
- virtual std::string helpText() const
+ std::string helpText() const override
{
return joinStrings(HelpText::text, "\n");
}
{
}
- virtual TextLineWrapperSettings &settings()
+ TextLineWrapperSettings &settings() override
{
return wrapper_.settings();
}
- virtual void wrap(const std::string &text)
+ void wrap(const std::string &text) override
{
result_.append(wrapper_.wrapToString(text));
}
{
}
- virtual TextLineWrapperSettings &settings()
+ TextLineWrapperSettings &settings() override
{
return wrapper_.settings();
}
- virtual void wrap(const std::string &text)
+ void wrap(const std::string &text) override
{
const std::vector<std::string> &lines = wrapper_.wrapToVector(text);
result_.insert(result_.end(), lines.begin(), lines.end());
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
const char *name, const char *title, const char *text);
MockHelpTopic(const char *name, const char *title, const char *text);
- virtual ~MockHelpTopic();
+ ~MockHelpTopic() override;
- virtual const char *name() const;
- virtual const char *title() const;
+ const char *name() const override;
+ const char *title() const override;
MOCK_CONST_METHOD1(writeHelp, void(const HelpWriterContext &context));
}
private:
- virtual std::string helpText() const;
+ std::string helpText() const override;
const char *name_;
const char *title_;
public:
// From IOptionsContainer
//! \copydoc IOptionsContainer::addGroup()
- virtual IOptionsContainer &addGroup();
+ IOptionsContainer &addGroup() override;
protected:
//! \cond libapi
private:
// From IOptionsContainerWithSections
- virtual internal::OptionSectionImpl *
- addSectionImpl(const AbstractOptionSection §ion);
+ internal::OptionSectionImpl *
+ addSectionImpl(const AbstractOptionSection §ion) override;
// From IOptionsContainer
- virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+ OptionInfo *addOptionImpl(const AbstractOption &settings) override;
/*! \brief
* Implementation helper for the template method.
private:
//! Creates a BooleanOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
};
/*! \brief
private:
//! Creates an IntegerOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
/*! \brief
* Needed to initialize IntegerOptionStorage from this class without
private:
//! Creates an Int64OptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
/*! \brief
* Needed to initialize Int64OptionStorage from this class without
private:
//! Creates a DoubleOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
bool bTime_;
private:
//! Creates a FloatOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
bool bTime_;
private:
//! Creates a StringOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
const char *const *enumValues_;
int enumValuesCount_;
}
}
- virtual int valueCount() { return static_cast<int>(intStore_.size()); }
- virtual ArrayRef<int> values() { return intStore_; }
- virtual void clear()
+ int valueCount() override { return static_cast<int>(intStore_.size()); }
+ ArrayRef<int> values() override { return intStore_; }
+ void clear() override
{
intStore_.clear();
if (storeVector_ != nullptr)
storeVector_->clear();
}
}
- virtual void reserve(size_t count)
+ void reserve(size_t count) override
{
intStore_.reserve(intStore_.size() + count);
if (storeVector_ != nullptr)
storeVector_->reserve(storeVector_->size() + count);
}
}
- virtual void append(const int &value)
+ void append(const int &value) override
{
const size_t count = intStore_.size();
intStore_.push_back(value);
}
//! Creates a EnumOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer & /*managers*/) const
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer & /*managers*/) const override
{
// TODO: Implement storeCount() if necessary.
return internal::createEnumOptionStorage(
{
}
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const { return "bool"; }
- virtual std::string formatSingleValue(const bool &value) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override { return "bool"; }
+ std::string formatSingleValue(const bool &value) const override;
//! \copydoc BooleanOptionInfo::defaultValue()
bool defaultValue() const { return valueCount() > 0 && values()[0]; }
private:
- virtual void initConverter(ConverterType *converter);
+ void initConverter(ConverterType *converter) override;
BooleanOptionInfo info_;
};
{
}
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override
{ return isVector() ? "vector" : "int"; }
- virtual std::string formatSingleValue(const int &value) const;
+ std::string formatSingleValue(const int &value) const override;
private:
- virtual void initConverter(ConverterType *converter);
- virtual void processSetValues(ValueList *values);
+ void initConverter(ConverterType *converter) override;
+ void processSetValues(ValueList *values) override;
IntegerOptionInfo info_;
};
{
}
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const { return "int"; }
- virtual std::string formatSingleValue(const int64_t &value) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override { return "int"; }
+ std::string formatSingleValue(const int64_t &value) const override;
private:
- virtual void initConverter(ConverterType *converter);
+ void initConverter(ConverterType *converter) override;
Int64OptionInfo info_;
};
//! \copydoc IntegerOptionStorage::IntegerOptionStorage()
explicit DoubleOptionStorage(const DoubleOption &settings);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const;
- virtual std::string formatSingleValue(const double &value) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override;
+ std::string formatSingleValue(const double &value) const override;
//! \copydoc DoubleOptionInfo::isTime()
bool isTime() const { return bTime_; }
void setScaleFactor(double factor);
private:
- virtual void initConverter(ConverterType *converter);
- virtual double processValue(const double &value) const;
- virtual void processSetValues(ValueList *values);
+ void initConverter(ConverterType *converter) override;
+ double processValue(const double &value) const override;
+ void processSetValues(ValueList *values) override;
DoubleOptionInfo info_;
bool bTime_;
//! \copydoc IntegerOptionStorage::IntegerOptionStorage()
explicit FloatOptionStorage(const FloatOption &settings);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const;
- virtual std::string formatSingleValue(const float &value) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override;
+ std::string formatSingleValue(const float &value) const override;
//! \copydoc DoubleOptionStorage::isTime()
bool isTime() const { return bTime_; }
void setScaleFactor(double factor);
private:
- virtual void initConverter(ConverterType *converter);
- virtual float processValue(const float &value) const;
- virtual void processSetValues(ValueList *values);
+ void initConverter(ConverterType *converter) override;
+ float processValue(const float &value) const override;
+ void processSetValues(ValueList *values) override;
FloatOptionInfo info_;
bool bTime_;
//! \copydoc DoubleOptionStorage::DoubleOptionStorage()
explicit StringOptionStorage(const StringOption &settings);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override
{ return allowed_.empty() ? "string" : "enum"; }
- virtual std::string formatExtraDescription() const;
- virtual std::string formatSingleValue(const std::string &value) const;
+ std::string formatExtraDescription() const override;
+ std::string formatSingleValue(const std::string &value) const override;
//! \copydoc StringOptionInfo::allowedValues()
const ValueList &allowedValues() const { return allowed_; }
private:
- virtual void initConverter(ConverterType *converter);
- virtual std::string processValue(const std::string &value) const;
+ void initConverter(ConverterType *converter) override;
+ std::string processValue(const std::string &value) const override;
StringOptionInfo info_;
ValueList allowed_;
int defaultValue, int defaultValueIfSet,
StorePointer store);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const { return "enum"; }
- virtual std::string formatExtraDescription() const;
- virtual std::string formatSingleValue(const int &value) const;
- virtual Variant normalizeValue(const int &value) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override { return "enum"; }
+ std::string formatExtraDescription() const override;
+ std::string formatSingleValue(const int &value) const override;
+ Variant normalizeValue(const int &value) const override;
//! \copydoc EnumOptionInfo::allowedValues()
const std::vector<std::string> &allowedValues() const { return allowed_; }
private:
- virtual void initConverter(ConverterType *converter);
+ void initConverter(ConverterType *converter) override;
EnumOptionInfo info_;
std::vector<std::string> allowed_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
using MyBase::defaultValueIfSet;
//! Creates a FileNameOptionStorage object.
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
OptionFileType optionType_;
int legacyType_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
FileNameOptionManager();
- virtual ~FileNameOptionManager();
+ ~FileNameOptionManager() override;
/*! \brief
* Redirects file existence checks.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
FileNameOptionStorage(const FileNameOption &settings,
FileNameOptionManager *manager);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const;
- virtual std::string formatExtraDescription() const;
- virtual std::string formatSingleValue(const std::string &value) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override;
+ std::string formatExtraDescription() const override;
+ std::string formatSingleValue(const std::string &value) const override;
//! \copydoc FileNameOptionInfo::isInputFile()
bool isInputFile() const { return bRead_ && !bWrite_; }
ArrayRef<const int> fileTypes() const;
private:
- virtual void initConverter(ConverterType *converter);
- virtual std::string processValue(const std::string &value) const;
- virtual void processAll();
+ void initConverter(ConverterType *converter) override;
+ std::string processValue(const std::string &value) const override;
+ void processAll() override;
FileNameOptionInfo info_;
FileNameOptionManager *manager_;
protected:
// Disallow deletion through the interface.
// (no need for the virtual, but some compilers warn otherwise)
- virtual ~IOptionsContainerWithSections();
+ ~IOptionsContainerWithSections() override;
/*! \brief
* Adds a section to this container.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
explicit Group(OptionSectionImpl *parent) : parent_(parent) {}
// From IOptionsContainer
- virtual IOptionsContainer &addGroup();
- virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+ IOptionsContainer &addGroup() override;
+ OptionInfo *addOptionImpl(const AbstractOption &settings) override;
//! Containing options object.
OptionSectionImpl *parent_;
}
// From IOptionsContainerWithSections
- virtual OptionSectionImpl *addSectionImpl(const AbstractOptionSection §ion);
+ OptionSectionImpl *addSectionImpl(const AbstractOptionSection §ion) override;
// From IOptionsContainer
- virtual IOptionsContainer &addGroup();
- virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+ IOptionsContainer &addGroup() override;
+ OptionInfo *addOptionImpl(const AbstractOption &settings) override;
//! Returns section info object for this section.
OptionSectionInfo &info() { return info_; }
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
public:
//! Initializes an empty options root container.
Options();
- ~Options();
+ ~Options() override;
/*! \brief
* Adds an option manager.
void addManager(IOptionManager *manager);
// From IOptionsContainer
- virtual IOptionsContainer &addGroup();
+ IOptionsContainer &addGroup() override;
//! Returns a handle to the root section.
OptionSectionInfo &rootSection();
private:
// From IOptionsContainerWithSections
- virtual internal::OptionSectionImpl *
- addSectionImpl(const AbstractOptionSection §ion);
+ internal::OptionSectionImpl *
+ addSectionImpl(const AbstractOptionSection §ion) override;
// From IOptionsContainer
- virtual OptionInfo *addOptionImpl(const AbstractOption &settings);
+ OptionInfo *addOptionImpl(const AbstractOption &settings) override;
PrivateImplPointer<internal::OptionsImpl> impl_;
class OptionSectionStorage : public IOptionSectionStorage
{
public:
- virtual void initStorage() {}
- virtual void startSection() {}
- virtual void finishSection() {}
+ void initStorage() override {}
+ void startSection() override {}
+ void finishSection() override {}
};
} // namespace
explicit OptionSection(const char *name) : AbstractOptionSection(name) {}
private:
- virtual std::unique_ptr<IOptionSectionStorage> createStorage() const;
+ std::unique_ptr<IOptionSectionStorage> createStorage() const override;
};
/*! \brief
// the declarations are still included for clarity.
// The various copydoc calls are needed with Doxygen 1.8.10, although
// things work without with 1.8.5...
- virtual std::string typeString() const = 0;
+ std::string typeString() const override = 0;
//! \copydoc gmx::AbstractOptionStorage::valueCount()
- virtual int valueCount() const { return store_->valueCount(); }
+ int valueCount() const override { return store_->valueCount(); }
//! \copydoc gmx::AbstractOptionStorage::defaultValues()
- virtual std::vector<Variant> defaultValues() const;
+ std::vector<Variant> defaultValues() const override;
/*! \copydoc gmx::AbstractOptionStorage::defaultValuesAsStrings()
*
* OptionStorageTemplate implements handling of defaultValueIfSet()
* Derived classes must implement formatSingleValue() to provide the
* actual formatting for a value of type \p T.
*/
- virtual std::vector<std::string> defaultValuesAsStrings() const;
+ std::vector<std::string> defaultValuesAsStrings() const override;
protected:
//! Smart pointer for managing the final storage interface.
StorePointer store);
//! \copydoc gmx::AbstractOptionStorage::clearSet()
- virtual void clearSet();
+ void clearSet() override;
/*! \copydoc gmx::AbstractOptionStorage::convertValue()
*
* Derived classes should call addValue() after they have converted
* should be considered whether the implementation can be made strongly
* exception safe.
*/
- virtual void convertValue(const Variant &value) = 0;
+ void convertValue(const Variant &value) override = 0;
/*! \brief
* Processes values for a set after all have been converted.
*
* override that method instead of this one if set value processing is
* necessary.
*/
- virtual void processSet();
+ void processSet() override;
/*! \copydoc gmx::AbstractOptionStorage::processAll()
*
* The implementation in OptionStorageTemplate does nothing.
*/
- virtual void processAll()
+ void processAll() override
{
}
/*! \brief
{
}
- virtual std::vector<Variant>
- normalizeValues(const std::vector<Variant> &values) const
+ std::vector<Variant>
+ normalizeValues(const std::vector<Variant> &values) const override
{
const_cast<MyBase *>(this)->ensureConverterInitialized();
std::vector<Variant> result;
}
private:
- virtual void convertValue(const Variant &variant)
+ void convertValue(const Variant &variant) override
{
ensureConverterInitialized();
this->addValue(processValue(converter_.convert(variant)));
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2014,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
class OptionsTypeVisitor : public OptionsVisitor
{
public:
- virtual ~OptionsTypeVisitor() {}
+ ~OptionsTypeVisitor() override {}
- virtual void visitSection(const OptionSectionInfo §ion) = 0;
+ void visitSection(const OptionSectionInfo §ion) override = 0;
/*! \brief
* Called for each option of type \p InfoType.
*/
virtual void visitOptionType(const InfoType &option) = 0;
private:
- virtual void visitOption(const OptionInfo &option)
+ void visitOption(const OptionInfo &option) override
{
const InfoType *subtype = option.toType<InfoType>();
if (subtype != NULL)
class OptionsModifyingTypeVisitor : public OptionsModifyingVisitor
{
public:
- virtual ~OptionsModifyingTypeVisitor() {}
+ ~OptionsModifyingTypeVisitor() override {}
- virtual void visitSection(OptionSectionInfo *section) = 0;
+ void visitSection(OptionSectionInfo *section) override = 0;
/*! \brief
* Called for each option of type \p InfoType.
*/
virtual void visitOptionType(InfoType *option) = 0;
private:
- virtual void visitOption(OptionInfo *option)
+ void visitOption(OptionInfo *option) override
{
InfoType *subtype = option->toType<InfoType>();
if (subtype != nullptr)
}
private:
- virtual std::unique_ptr<IOptionSectionStorage> createStorage() const;
+ std::unique_ptr<IOptionSectionStorage> createStorage() const override;
std::vector<T> *values_;
{
}
- virtual void initStorage()
+ void initStorage() override
{
defaultValues_ = currentData_;
}
- virtual void startSection()
+ void startSection() override
{
resetSection();
}
- virtual void finishSection()
+ void finishSection() override
{
store_->append(currentData_);
resetSection();
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
using MyBase::addValue;
using MyBase::commitValues;
- virtual gmx::OptionInfo &optionInfo() { return info_; }
+ gmx::OptionInfo &optionInfo() override { return info_; }
// These are not used.
- virtual std::string typeString() const { return "mock"; }
- virtual std::string formatSingleValue(const std::string & /*value*/) const
+ std::string typeString() const override { return "mock"; }
+ std::string formatSingleValue(const std::string & /*value*/) const override
{
return "";
}
- virtual std::vector<gmx::Variant>
- normalizeValues(const std::vector<gmx::Variant> &values) const
+ std::vector<gmx::Variant>
+ normalizeValues(const std::vector<gmx::Variant> &values) const override
{
return values;
}
- virtual void convertValue(const gmx::Variant &value)
+ void convertValue(const gmx::Variant &value) override
{
convertValue(value.cast<std::string>());
}
}
private:
- virtual gmx::AbstractOptionStorage *createStorage(
- const gmx::OptionManagerContainer & /*managers*/) const
+ gmx::AbstractOptionStorage *createStorage(
+ const gmx::OptionManagerContainer & /*managers*/) const override
{
return new MockOptionStorage(*this);
}
//! Initializes a scaler with the given factor.
explicit TimeOptionScaler(double factor) : factor_(factor) {}
- void visitSection(OptionSectionInfo *section)
+ void visitSection(OptionSectionInfo *section) override
{
OptionsModifyingIterator iterator(section);
iterator.acceptSections(this);
iterator.acceptOptions(this);
}
- void visitOptionType(FloatingPointOptionInfo *option)
+ void visitOptionType(FloatingPointOptionInfo *option) override
{
if (option->isTime())
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void addTimeUnitOption(IOptionsContainer *options, const char *name);
// From IOptionsBehavior
- virtual void initBehavior(Options * /*options*/) {}
- virtual void optionsFinishing(Options *options);
- virtual void optionsFinished() {}
+ void initBehavior(Options * /*options*/) override {}
+ void optionsFinishing(Options *options) override;
+ void optionsFinished() override {}
private:
TimeUnit timeUnit_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
}
private:
- virtual void visitSection(const OptionSectionInfo §ion)
+ void visitSection(const OptionSectionInfo §ion) override
{
const std::string &name = section.name();
if (currentObject_->keyExists(name))
currentKnownNames_ = parentKnownNames;
}
}
- virtual void visitOption(const OptionInfo &option)
+ void visitOption(const OptionInfo &option) override
{
const std::string &name = option.name();
if (currentObject_->keyExists(name))
}
private:
- virtual void visitSection(const OptionSectionInfo §ion)
+ void visitSection(const OptionSectionInfo §ion) override
{
const std::string &name = section.name();
auto parentBuilder = currentObjectBuilder_;
currentSourceObject_ = parentObject;
currentObjectBuilder_ = parentBuilder;
}
- virtual void visitOption(const OptionInfo &option)
+ void visitOption(const OptionInfo &option) override
{
const std::string &name = option.name();
if (currentSourceObject_ == nullptr || !currentSourceObject_->keyExists(name))
{
}
- virtual int valueCount() { return count_; }
- virtual ArrayRef<T> values() { return arrayRefFromArray(store_, count_); }
- virtual void clear()
+ int valueCount() override { return count_; }
+ ArrayRef<T> values() override { return arrayRefFromArray(store_, count_); }
+ void clear() override
{
count_ = 0;
if (storeCount_ != nullptr)
*storeCount_ = count_;
}
}
- virtual void reserve(size_t /*count*/)
+ void reserve(size_t /*count*/) override
{
}
- virtual void append(const T &value)
+ void append(const T &value) override
{
store_[count_] = value;
++count_;
public:
explicit OptionValueStoreVector(std::vector<T> *store) : store_(store) {}
- virtual int valueCount() { return static_cast<int>(store_->size()); }
- virtual ArrayRef<T> values() { return *store_; }
- virtual void clear() { store_->clear(); }
- virtual void reserve(size_t count)
+ int valueCount() override { return static_cast<int>(store_->size()); }
+ ArrayRef<T> values() override { return *store_; }
+ void clear() override { store_->clear(); }
+ void reserve(size_t count) override
{
store_->reserve(store_->size() + count);
}
- virtual void append(const T &value)
+ void append(const T &value) override
{
store_->push_back(value);
}
{
}
- virtual int valueCount() { return static_cast<int>(store_->size()); }
- virtual ArrayRef<bool> values()
+ int valueCount() override { return static_cast<int>(store_->size()); }
+ ArrayRef<bool> values() override
{
return arrayRefFromArray(reinterpret_cast<bool *>(boolStore_.data()),
boolStore_.size());
}
- virtual void clear()
+ void clear() override
{
boolStore_.clear();
store_->clear();
}
- virtual void reserve(size_t count)
+ void reserve(size_t count) override
{
boolStore_.reserve(boolStore_.size() + count);
store_->reserve(store_->size() + count);
}
- virtual void append(const bool &value)
+ void append(const bool &value) override
{
boolStore_.push_back({value});
store_->push_back(value);
public:
OptionValueStoreNull() : store_(&vector_) {}
- virtual int valueCount() { return store_.valueCount(); }
- virtual ArrayRef<T> values() { return store_.values(); }
- virtual void clear() { store_.clear(); }
- virtual void reserve(size_t count) { store_.reserve(count); }
- virtual void append(const T &value) { store_.append(value); }
+ int valueCount() override { return store_.valueCount(); }
+ ArrayRef<T> values() override { return store_.values(); }
+ void clear() override { store_.clear(); }
+ void reserve(size_t count) override { store_.reserve(count); }
+ void append(const T &value) override { store_.append(value); }
private:
std::vector<T> vector_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
explicit SelectionFileOption(const char *name);
private:
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
};
/*! \libinternal \brief
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
SelectionFileOptionStorage(const SelectionFileOption &settings,
SelectionOptionManager *manager);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const { return "file"; }
- virtual int valueCount() const { return 0; }
- virtual std::vector<Variant> defaultValues() const { return {}; }
- virtual std::vector<std::string> defaultValuesAsStrings() const { return {}; }
- virtual std::vector<Variant>
- normalizeValues(const std::vector<Variant> &values) const { return values; }
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override { return "file"; }
+ int valueCount() const override { return 0; }
+ std::vector<Variant> defaultValues() const override { return {}; }
+ std::vector<std::string> defaultValuesAsStrings() const override { return {}; }
+ std::vector<Variant>
+ normalizeValues(const std::vector<Variant> &values) const override { return values; }
private:
- virtual void clearSet();
- virtual void convertValue(const Variant &value);
- virtual void processSet();
- virtual void processAll() {}
+ void clearSet() override;
+ void convertValue(const Variant &value) override;
+ void processSet() override;
+ void processAll() override {}
SelectionFileOptionInfo info_;
SelectionOptionManager &manager_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
using MyBase::defaultValue;
using MyBase::defaultValueIfSet;
- virtual AbstractOptionStorage *createStorage(
- const OptionManagerContainer &managers) const;
+ AbstractOptionStorage *createStorage(
+ const OptionManagerContainer &managers) const override;
const char *defaultText_;
SelectionFlags selectionFlags_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*/
SelectionOptionBehavior(SelectionCollection *selections,
ITopologyProvider *topologyProvider);
- ~SelectionOptionBehavior();
+ ~SelectionOptionBehavior() override;
/*! \brief
* Add common options for controlling selections.
void initOptions(IOptionsContainer *options);
// From IOptionsBehavior
- virtual void initBehavior(Options *options);
- virtual void optionsFinishing(Options * /*options*/) {}
- virtual void optionsFinished();
+ void initBehavior(Options *options) override;
+ void optionsFinishing(Options * /*options*/) override {}
+ void optionsFinished() override;
private:
class Impl;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* \throws std::bad_alloc if out of memory.
*/
explicit SelectionOptionManager(SelectionCollection *selections);
- virtual ~SelectionOptionManager();
+ ~SelectionOptionManager() override;
/*! \brief
* Adds a selection option to be managed.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
SelectionOptionStorage(const SelectionOption &settings,
SelectionOptionManager *manager);
- virtual OptionInfo &optionInfo() { return info_; }
- virtual std::string typeString() const { return "selection"; }
- virtual std::string formatSingleValue(const Selection &value) const;
- virtual std::vector<Variant>
- normalizeValues(const std::vector<Variant> &values) const;
+ OptionInfo &optionInfo() override { return info_; }
+ std::string typeString() const override { return "selection"; }
+ std::string formatSingleValue(const Selection &value) const override;
+ std::vector<Variant>
+ normalizeValues(const std::vector<Variant> &values) const override;
/*! \brief
* Adds selections to the storage.
void setSelectionFlag(SelectionFlag flag, bool bSet);
private:
- virtual void convertValue(const Variant &value);
- virtual void processSetValues(ValueList *values);
- virtual void processAll();
+ void convertValue(const Variant &value) override;
+ void processSetValues(ValueList *values) override;
+ void processAll() override;
SelectionOptionInfo info_;
SelectionOptionManager &manager_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
}
- virtual const char *name() const
+ const char *name() const override
{
return name_.c_str();
}
- virtual const char *title() const
+ const char *title() const override
{
return method_.help.helpTitle;
}
protected:
- virtual std::string helpText() const
+ std::string helpText() const override
{
return joinStrings(method_.help.help,
method_.help.help + method_.help.nlhelp, "\n");
public:
KeywordsHelpTopic();
- virtual void writeHelp(const HelpWriterContext &context) const;
+ void writeHelp(const HelpWriterContext &context) const override;
private:
/*! \brief
{
public:
IndexBlockTest();
- ~IndexBlockTest();
+ ~IndexBlockTest() override;
void setGroup(int count, const int atoms[]);
template <int count>
{
public:
IndexMapTest();
- ~IndexMapTest();
+ ~IndexMapTest() override;
void testInit(int atomCount, const int atoms[], e_index_t type);
void testUpdate(int atomCount, const int atoms[], bool bMaskOnly,
{
public:
PositionCalculationTest();
- ~PositionCalculationTest();
+ ~PositionCalculationTest() override;
void generateCoordinates();
static int s_debugLevel;
SelectionCollectionTest();
- ~SelectionCollectionTest();
+ ~SelectionCollectionTest() override;
void setAtomCount(int natoms)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
const AnalysisDataParallelOptions &opt,
const SelectionCollection &selections);
- virtual void finish();
+ void finish() override;
};
TrajectoryAnalysisModuleDataBasic::TrajectoryAnalysisModuleDataBasic(
{
}
- virtual void init(CommandLineModuleSettings * /*settings*/) {}
- virtual void initOptions(IOptionsContainer *options,
- ICommandLineOptionsModuleSettings *settings);
- virtual void optionsFinished();
- virtual int run();
+ void init(CommandLineModuleSettings * /*settings*/) override {}
+ void initOptions(IOptionsContainer *options,
+ ICommandLineOptionsModuleSettings *settings) override;
+ void optionsFinished() override;
+ int run() override;
TrajectoryAnalysisModulePointer module_;
TrajectoryAnalysisSettings settings_;
public:
Angle();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void optionsFinished(TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void optionsFinished(TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
void initFromSelections(const SelectionList &sel1,
public:
Distance();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
SelectionList sel_;
{
public:
FreeVolume();
- virtual ~FreeVolume() {}
-
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ ~FreeVolume() override {}
+
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
std::string fnFreevol_;
public:
PairDistance();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual TrajectoryAnalysisModuleDataPointer startFrames(
+ TrajectoryAnalysisModuleDataPointer startFrames(
const AnalysisDataParallelOptions &opt,
- const SelectionCollection &selections);
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ const SelectionCollection &selections) override;
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
/*! \brief
}
}
- virtual void finish() { finishDataHandles(); }
+ void finish() override { finishDataHandles(); }
/*! \brief
* Computes the number of positions in each group in \p refSel
public:
Rdf();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void optionsFinished(TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
- virtual void initAfterFirstFrame(const TrajectoryAnalysisSettings &settings,
- const t_trxframe &fr);
-
- virtual TrajectoryAnalysisModuleDataPointer startFrames(
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void optionsFinished(TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
+ void initAfterFirstFrame(const TrajectoryAnalysisSettings &settings,
+ const t_trxframe &fr) override;
+
+ TrajectoryAnalysisModuleDataPointer startFrames(
const AnalysisDataParallelOptions &opt,
- const SelectionCollection &selections);
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ const SelectionCollection &selections) override;
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
std::string fnRdf_;
surfaceDist2_.resize(surfaceGroupCount);
}
- virtual void finish() { finishDataHandles(); }
+ void finish() override { finishDataHandles(); }
/*! \brief
* Minimum distance to each surface group.
public:
Sasa();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual TrajectoryAnalysisModuleDataPointer startFrames(
+ TrajectoryAnalysisModuleDataPointer startFrames(
const AnalysisDataParallelOptions &opt,
- const SelectionCollection &selections);
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ const SelectionCollection &selections) override;
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
/*! \brief
res_a_.resize(residueCount);
}
- virtual void finish() { finishDataHandles(); }
+ void finish() override { finishDataHandles(); }
//! Indices of the calculation selection positions selected for the frame.
std::vector<int> index_;
{
public:
IndexFileWriterModule();
- virtual ~IndexFileWriterModule();
+ ~IndexFileWriterModule() override;
//! Sets the file name to write the index file to.
void setFileName(const std::string &fnm);
*/
void addGroup(const std::string &name, bool bDynamic);
- virtual int flags() const;
+ int flags() const override;
- virtual void dataStarted(AbstractAnalysisData *data);
- virtual void frameStarted(const AnalysisDataFrameHeader &header);
- virtual void pointsAdded(const AnalysisDataPointSetRef &points);
- virtual void frameFinished(const AnalysisDataFrameHeader &header);
- virtual void dataFinished();
+ void dataStarted(AbstractAnalysisData *data) override;
+ void frameStarted(const AnalysisDataFrameHeader &header) override;
+ void pointsAdded(const AnalysisDataPointSetRef &points) override;
+ void frameFinished(const AnalysisDataFrameHeader &header) override;
+ void dataFinished() override;
private:
void closeFile();
public:
Select();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void optionsFinished(TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void optionsFinished(TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
SelectionList sel_;
public:
Trajectory();
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void optionsFinished(TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void optionsFinished(TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
SelectionList sel_;
{
public:
explicit Impl(TrajectoryAnalysisSettings *settings);
- ~Impl();
+ ~Impl() override;
bool hasTrajectory() const { return !trjfile_.empty(); }
void finishTrajectory();
// From ITopologyProvider
- virtual gmx_mtop_t *getTopology(bool required)
+ gmx_mtop_t *getTopology(bool required) override
{
initTopology(required);
return topInfo_.mtop_.get();
}
- virtual int getAtomCount()
+ int getAtomCount() override
{
if (!topInfo_.hasTopology())
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
AbstractTrajectoryAnalysisModuleTestFixture();
- virtual ~AbstractTrajectoryAnalysisModuleTestFixture();
+ ~AbstractTrajectoryAnalysisModuleTestFixture() override;
/*! \brief
* Sets the topology file to use for the test.
: public AbstractTrajectoryAnalysisModuleTestFixture
{
protected:
- virtual TrajectoryAnalysisModulePointer createModule()
+ TrajectoryAnalysisModulePointer createModule() override
{
return ModuleInfo::create();
}
atomArea_(nullptr), dotCount_(0), dots_(nullptr)
{
}
- ~SurfaceAreaTest()
+ ~SurfaceAreaTest() override
{
sfree(atomArea_);
sfree(dots_);
{
public:
SelectionTester();
- virtual ~SelectionTester();
+ ~SelectionTester() override;
- virtual void initOptions(IOptionsContainer *options,
- TrajectoryAnalysisSettings *settings);
- virtual void initAnalysis(const TrajectoryAnalysisSettings &settings,
- const TopologyInformation &top);
+ void initOptions(IOptionsContainer *options,
+ TrajectoryAnalysisSettings *settings) override;
+ void initAnalysis(const TrajectoryAnalysisSettings &settings,
+ const TopologyInformation &top) override;
- virtual void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
- TrajectoryAnalysisModuleData *pdata);
+ void analyzeFrame(int frnr, const t_trxframe &fr, t_pbc *pbc,
+ TrajectoryAnalysisModuleData *pdata) override;
- virtual void finishAnalysis(int nframes);
- virtual void writeOutput();
+ void finishAnalysis(int nframes) override;
+ void writeOutput() override;
private:
void printSelections();
//! Initializes a writer that writes to the given file handle.
explicit MessageWriterFileNoThrow(FILE *fp) : fp_(fp) {}
- virtual void writeLine(const char *text, int indent)
+ void writeLine(const char *text, int indent) override
{
internal::printFatalErrorMessageLine(fp_, text, indent);
}
- virtual void writeErrNoInfo(int errorNumber, const char *funcName,
- int indent)
+ void writeErrNoInfo(int errorNumber, const char *funcName,
+ int indent) override
{
std::fprintf(fp_, "%*sReason: %s\n", indent, "",
std::strerror(errorNumber));
{
}
- virtual void writeLine(const char *text, int indent)
+ void writeLine(const char *text, int indent) override
{
writer_->wrapperSettings().setIndent(indent);
writer_->writeLine(text);
}
- virtual void writeErrNoInfo(int errorNumber, const char *funcName,
- int indent)
+ void writeErrNoInfo(int errorNumber, const char *funcName,
+ int indent) override
{
writer_->wrapperSettings().setIndent(indent);
writer_->writeLine(formatString("Reason: %s", std::strerror(errorNumber)));
//! Returns the constructed string.
const std::string &result() const { return result_; }
- virtual void writeLine(const char *text, int indent)
+ void writeLine(const char *text, int indent) override
{
result_.append(indent, ' ');
result_.append(text);
result_.append("\n");
}
- virtual void writeErrNoInfo(int errorNumber, const char *funcName,
- int indent)
+ void writeErrNoInfo(int errorNumber, const char *funcName,
+ int indent) override
{
writeLine(formatString("Reason: %s", std::strerror(errorNumber)).c_str(),
indent);
public:
// Explicitly declared because some compiler/library combinations warn
// about missing noexcept otherwise.
- virtual ~GromacsException() noexcept {}
+ ~GromacsException() noexcept override {}
GMX_DEFAULT_CONSTRUCTORS(GromacsException);
*
* The return value is the string that was passed to the constructor.
*/
- virtual const char *what() const noexcept;
+ const char *what() const noexcept override;
/*! \brief
* Returns the error code corresponding to the exception type.
*/
explicit FileIOError(const ExceptionInitializer &details)
: GromacsException(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit InvalidInputError(const ExceptionInitializer &details)
: UserInputError(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit InconsistentInputError(const ExceptionInitializer &details)
: UserInputError(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit ToleranceError(const ExceptionInitializer &details)
: GromacsException(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit SimulationInstabilityError(const ExceptionInitializer &details)
: GromacsException(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit InternalError(const ExceptionInitializer &details)
: GromacsException(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit APIError(const ExceptionInitializer &details)
: GromacsException(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit RangeError(const ExceptionInitializer &details)
: GromacsException(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
explicit NotImplementedError(const ExceptionInitializer &details)
: APIError(details) {}
- virtual int errorCode() const;
+ int errorCode() const override;
};
/*! \brief
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
class DefaultInputRedirector : public IFileInputRedirector
{
public:
- virtual bool fileExists(const char *filename,
- File::NotFoundHandler onNotFound) const
+ bool fileExists(const char *filename,
+ File::NotFoundHandler onNotFound) const override
{
return File::exists(filename, onNotFound);
}
class DefaultOutputRedirector : public IFileOutputRedirector
{
public:
- virtual TextOutputStream &standardOutput()
+ TextOutputStream &standardOutput() override
{
return TextOutputFile::standardOutput();
}
- virtual TextOutputStreamPointer openTextOutputFile(const char *filename)
+ TextOutputStreamPointer openTextOutputFile(const char *filename) override
{
return TextOutputStreamPointer(new TextOutputFile(filename));
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
bool isInteractive() const;
// From TextInputStream
- virtual bool readLine(std::string *line);
- virtual void close() {}
+ bool readLine(std::string *line) override;
+ void close() override {}
/*! \brief
* Returns a stream for accessing `stdin`.
* for an object constructed this way.
*/
explicit TextInputFile(FILE *fp);
- virtual ~TextInputFile();
+ ~TextInputFile() override;
/*! \brief
* Returns a raw handle to the input file.
FILE *handle();
// From TextInputStream
- virtual bool readLine(std::string *line);
- virtual void close();
+ bool readLine(std::string *line) override;
+ void close() override;
private:
PrivateImplPointer<internal::FileStreamImpl> impl_;
explicit TextOutputFile(const std::string &filename);
//! \copydoc TextInputFile::TextInputFile(FILE *)
explicit TextOutputFile(FILE *fp);
- virtual ~TextOutputFile();
+ ~TextOutputFile() override;
// From TextOutputStream
- virtual void write(const char *text);
- virtual void close();
+ void write(const char *text) override;
+ void close() override;
/*! \brief
* Returns a stream for accessing `stdout`.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
class DefaultKeyValueTreeErrorHandler : public IKeyValueTreeErrorHandler
{
public:
- virtual bool onError(UserInputError *ex, const KeyValueTreePath &context)
+ bool onError(UserInputError *ex, const KeyValueTreePath &context) override
{
std::string message
= formatString("While processing '%s':", context.toString().c_str());
{
public:
InMemorySerializer();
- virtual ~InMemorySerializer();
+ ~InMemorySerializer() override;
std::vector<char> finishAndGetBuffer();
// From ISerializer
- virtual bool reading() const { return false; }
- virtual void doBool(bool *value);
- virtual void doUChar(unsigned char *value);
- virtual void doInt(int *value);
- virtual void doInt64(int64_t *value);
- virtual void doFloat(float *value);
- virtual void doDouble(double *value);
- virtual void doString(std::string *value);
+ bool reading() const override { return false; }
+ void doBool(bool *value) override;
+ void doUChar(unsigned char *value) override;
+ void doInt(int *value) override;
+ void doInt64(int64_t *value) override;
+ void doFloat(float *value) override;
+ void doDouble(double *value) override;
+ void doString(std::string *value) override;
private:
class Impl;
{
public:
explicit InMemoryDeserializer(const std::vector<char> &buffer);
- virtual ~InMemoryDeserializer();
+ ~InMemoryDeserializer() override;
// From ISerializer
- virtual bool reading() const { return true; }
- virtual void doBool(bool *value);
- virtual void doUChar(unsigned char *value);
- virtual void doInt(int *value);
- virtual void doInt64(int64_t *value);
- virtual void doFloat(float *value);
- virtual void doDouble(double *value);
- virtual void doString(std::string *value);
+ bool reading() const override { return true; }
+ void doBool(bool *value) override;
+ void doUChar(unsigned char *value) override;
+ void doInt(int *value) override;
+ void doInt64(int64_t *value) override;
+ void doFloat(float *value) override;
+ void doDouble(double *value) override;
+ void doString(std::string *value) override;
private:
class Impl;
std::map<std::string, Entry> childEntries_;
};
- virtual KeyValueTreePath
- originalPath(const KeyValueTreePath &path) const
+ KeyValueTreePath
+ originalPath(const KeyValueTreePath &path) const override
{
const Entry *entry = &rootEntry_;
for (const auto &element : path.elements())
targets_.push_back(target);
}
- virtual void writeEntry(const LogEntry &entry)
+ void writeEntry(const LogEntry &entry) override
{
for (ILogTarget *target : targets_)
{
public:
explicit LogTargetFormatter(TextOutputStream *stream) : writer_(stream) {}
- virtual void writeEntry(const LogEntry &entry);
+ void writeEntry(const LogEntry &entry) override;
private:
TextWriter writer_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
public:
DefaultProgramContext() {}
- virtual const char *programName() const { return "GROMACS"; }
- virtual const char *displayName() const { return "GROMACS"; }
- virtual const char *fullBinaryPath() const { return ""; }
- virtual InstallationPrefixInfo installationPrefix() const
+ const char *programName() const override { return "GROMACS"; }
+ const char *displayName() const override { return "GROMACS"; }
+ const char *fullBinaryPath() const override { return ""; }
+ InstallationPrefixInfo installationPrefix() const override
{
return InstallationPrefixInfo("", false);
}
- virtual const char *commandLine() const { return ""; }
+ const char *commandLine() const override { return ""; }
};
//! Global program info; stores the object set with setProgramContext().
const std::string &toString() const { return str_; }
// From TextOutputStream
- virtual void write(const char *text);
- virtual void close();
+ void write(const char *text) override;
+ void close() override;
private:
std::string str_;
explicit StringInputStream(ArrayRef<const char *const> const &input);
// From TextInputStream
- virtual bool readLine(std::string *line);
- virtual void close() {}
+ bool readLine(std::string *line) override;
+ void close() override {}
private:
std::string input_;
size_t pos_;
{
}
- virtual bool reading() const { return false; }
+ bool reading() const override { return false; }
- virtual void doBool(bool *value)
+ void doBool(bool *value) override
{
checker_.checkBoolean(*value, nullptr);
}
- virtual void doUChar(unsigned char *value)
+ void doUChar(unsigned char *value) override
{
checker_.checkUChar(*value, nullptr);
}
- virtual void doInt(int *value)
+ void doInt(int *value) override
{
checker_.checkInteger(*value, nullptr);
}
- virtual void doInt64(int64_t *value)
+ void doInt64(int64_t *value) override
{
checker_.checkInt64(*value, nullptr);
}
- virtual void doFloat(float *value)
+ void doFloat(float *value) override
{
checker_.checkFloat(*value, nullptr);
}
- virtual void doDouble(double *value)
+ void doDouble(double *value) override
{
checker_.checkDouble(*value, nullptr);
}
- virtual void doString(std::string *value)
+ void doString(std::string *value) override
{
checker_.checkString(*value, nullptr);
}
explicit Content(const T &value) : value_(value) {}
explicit Content(T &&value) : value_(std::move(value)) {}
- virtual const std::type_info &typeInfo() const { return typeid(T); }
- virtual std::unique_ptr<IContent> clone() const { return compat::make_unique<Content>(value_); }
+ const std::type_info &typeInfo() const override { return typeid(T); }
+ std::unique_ptr<IContent> clone() const override { return compat::make_unique<Content>(value_); }
T value_;
};
{
}
- virtual const char *name() const
+ const char *name() const override
{
return name_;
}
- virtual const char *shortDescription() const
+ const char *shortDescription() const override
{
return nullptr;
}
- virtual void init(gmx::CommandLineModuleSettings * /*settings*/)
+ void init(gmx::CommandLineModuleSettings * /*settings*/) override
{
}
- virtual int run(int /*argc*/, char * /*argv*/[])
+ int run(int /*argc*/, char * /*argv*/[]) override
{
printMessage();
return 0;
}
- virtual void writeHelp(const gmx::CommandLineHelpContext & /*context*/) const
+ void writeHelp(const gmx::CommandLineHelpContext & /*context*/) const override
{
printMessage();
}
{
protected:
ImdTestFixture();
- ~ImdTestFixture();
+ ~ImdTestFixture() override;
};
{
public:
MdrunTestFixtureBase();
- virtual ~MdrunTestFixtureBase();
+ ~MdrunTestFixtureBase() override;
};
/*! \internal
{
public:
MdrunTestFixture();
- virtual ~MdrunTestFixture();
+ ~MdrunTestFixture() override;
//! Manages temporary files during the test.
TestFileManager fileManager_;
{
protected:
SwapTestFixture();
- ~SwapTestFixture();
+ ~SwapTestFixture() override;
};
{
public:
CommandLineTestBase();
- ~CommandLineTestBase();
+ ~CommandLineTestBase() override;
/*! \brief
* Sets an input file.
{
}
- virtual void checkStream(TextInputStream *stream,
- TestReferenceChecker *checker)
+ void checkStream(TextInputStream *stream,
+ TestReferenceChecker *checker) override
{
checkConfFile(stream, checker, settings_);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
return *this;
}
- virtual TextBlockMatcherPointer createMatcher() const;
+ TextBlockMatcherPointer createMatcher() const override;
private:
ConfMatchSettings settings_;
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
}
- virtual void checkFile(const std::string &path,
- TestReferenceChecker *checker)
+ void checkFile(const std::string &path,
+ TestReferenceChecker *checker) override
{
TextInputFile stream(path);
matcher_->checkStream(&stream, checker);
{
}
- virtual FileMatcherPointer createFileMatcher() const;
+ FileMatcherPointer createFileMatcher() const override;
private:
const ITextBlockMatcherSettings &streamSettings_;
class NoContentsMatch : public IFileMatcherSettings
{
public:
- virtual FileMatcherPointer createFileMatcher() const;
+ FileMatcherPointer createFileMatcher() const override;
};
} // namespace test
class NullChecker : public IReferenceDataEntryChecker
{
public:
- virtual void fillEntry(ReferenceDataEntry * /*entry*/) const {}
- virtual ::testing::AssertionResult
- checkEntry(const ReferenceDataEntry & /*entry*/, const std::string & /*fullId*/) const
+ void fillEntry(ReferenceDataEntry * /*entry*/) const override {}
+ ::testing::AssertionResult
+ checkEntry(const ReferenceDataEntry & /*entry*/, const std::string & /*fullId*/) const override
{
return ::testing::AssertionSuccess();
}
{
}
- virtual void fillEntry(ReferenceDataEntry *entry) const
+ void fillEntry(ReferenceDataEntry *entry) const override
{
entry->setValue(value_);
}
- virtual ::testing::AssertionResult
- checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const
+ ::testing::AssertionResult
+ checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const override
{
if (entry.value() == value_)
{
{
}
- virtual void fillEntry(ReferenceDataEntry *entry) const
+ void fillEntry(ReferenceDataEntry *entry) const override
{
entry->setTextBlockValue(value_);
}
- virtual ::testing::AssertionResult
- checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const
+ ::testing::AssertionResult
+ checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const override
{
if (entry.value() == value_)
{
{
}
- virtual void fillEntry(ReferenceDataEntry *entry) const
+ void fillEntry(ReferenceDataEntry *entry) const override
{
const int prec = std::numeric_limits<FloatType>::digits10 + 2;
entry->setValue(formatString("%.*g", prec, value_));
}
- virtual ::testing::AssertionResult
- checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const
+ ::testing::AssertionResult
+ checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const override
{
FloatType refValue = static_cast<FloatType>(convertDoubleReferenceValue(entry.value()));
FloatingPointDifference diff(refValue, value_);
{
}
- virtual void fillEntry(ReferenceDataEntry *entry) const
+ void fillEntry(ReferenceDataEntry *entry) const override
{
entry->setValue(value_);
}
- virtual ::testing::AssertionResult
- checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const
+ ::testing::AssertionResult
+ checkEntry(const ReferenceDataEntry &entry, const std::string &fullId) const override
{
FloatType value = fromString<FloatType>(value_);
FloatType refValue = static_cast<FloatType>(convertDoubleReferenceValue(entry.value()));
{
}
- virtual void fillEntry(ReferenceDataEntry * /*entry*/) const
+ void fillEntry(ReferenceDataEntry * /*entry*/) const override
{
GMX_THROW(TestException("Extracting value from non-existent reference data entry"));
}
- virtual ::testing::AssertionResult
- checkEntry(const ReferenceDataEntry &entry, const std::string & /*fullId*/) const
+ ::testing::AssertionResult
+ checkEntry(const ReferenceDataEntry &entry, const std::string & /*fullId*/) const override
{
extractValue(entry.value());
return ::testing::AssertionSuccess();
class ReferenceDataTestEventListener : public ::testing::EmptyTestEventListener
{
public:
- virtual void OnTestEnd(const ::testing::TestInfo &test_info)
+ void OnTestEnd(const ::testing::TestInfo &test_info) override
{
if (g_referenceData)
{
}
}
- virtual void OnTestProgramEnd(const ::testing::UnitTest & /*unused*/)
+ void OnTestProgramEnd(const ::testing::UnitTest & /*unused*/) override
{
// Could be used e.g. to free internal buffers allocated by an XML parsing library
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
const std::string &text, const char *id);
StringTestBase();
- ~StringTestBase();
+ ~StringTestBase() override;
/*! \brief
* Returns the root checker for this test's reference data.
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
explicit TestException(const GromacsException &base)
: GromacsException(base) {}
- virtual int errorCode() const { return -1; }
+ int errorCode() const override { return -1; }
};
/*! \brief
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
public:
TestFileInputRedirector();
- virtual ~TestFileInputRedirector();
+ ~TestFileInputRedirector() override;
/*! \brief
* Marks the provided path as an existing file.
void addExistingFile(const char *filename);
// From IFileInputRedirector
- virtual bool fileExists(const char *filename,
- File::NotFoundHandler onNotFound) const;
+ bool fileExists(const char *filename,
+ File::NotFoundHandler onNotFound) const override;
private:
std::set<std::string> existingFiles_;
{
public:
TestFileOutputRedirector();
- virtual ~TestFileOutputRedirector();
+ ~TestFileOutputRedirector() override;
/*! \brief
* Checks contents of all redirected files (including stdout).
void checkRedirectedFiles(TestReferenceChecker *checker);
// From IFileOutputRedirector
- virtual TextOutputStream &standardOutput();
- virtual TextOutputStreamPointer openTextOutputFile(const char *filename);
+ TextOutputStream &standardOutput() override;
+ TextOutputStreamPointer openTextOutputFile(const char *filename) override;
private:
class Impl;
dataPath_ = sourceRoot;
}
- virtual const char *programName() const
+ const char *programName() const override
{
return context_.programName();
}
- virtual const char *displayName() const
+ const char *displayName() const override
{
return context_.displayName();
}
- virtual const char *fullBinaryPath() const
+ const char *fullBinaryPath() const override
{
return context_.fullBinaryPath();
}
- virtual InstallationPrefixInfo installationPrefix() const
+ InstallationPrefixInfo installationPrefix() const override
{
return InstallationPrefixInfo(dataPath_.c_str(), true);
}
- virtual const char *commandLine() const
+ const char *commandLine() const override
{
return context_.commandLine();
}
FloatTypeMatcher(const FloatingPointTolerance &tolerance)
: tolerance_(tolerance) {}
//! Compare the two elements of \c arg, return whether they are equal, and comment on \c listener when they are not.
- virtual bool MatchAndExplain(std::tuple<FloatType, FloatType> arg,
- testing::MatchResultListener* listener) const
+ bool MatchAndExplain(std::tuple<FloatType, FloatType> arg,
+ testing::MatchResultListener* listener) const override
{
const FloatType &value1 = std::get<0>(arg);
const FloatType &value2 = std::get<1>(arg);
return false;
}
//! Describe to a human what matching means.
- virtual void DescribeTo(::std::ostream* os) const
+ void DescribeTo(::std::ostream* os) const override
{
*os << "matches within tolerance";
}
//! Describe to a human what failing to match means.
- virtual void DescribeNegationTo(::std::ostream* os) const
+ void DescribeNegationTo(::std::ostream* os) const override
{
*os << "does not match within tolerance";
}
RVecMatcher(const FloatingPointTolerance &tolerance)
: tolerance_(tolerance) {}
//! Compare the two elements of \c arg, return whether they are equal, and comment on \c listener when they are not.
- virtual bool MatchAndExplain(std::tuple<VectorType, VectorType> arg,
- testing::MatchResultListener* listener) const
+ bool MatchAndExplain(std::tuple<VectorType, VectorType> arg,
+ testing::MatchResultListener* listener) const override
{
const VectorType &lhs = std::get<0>(arg);
const VectorType &rhs = std::get<1>(arg);
return matches;
}
//! Describe to a human what matching means.
- virtual void DescribeTo(::std::ostream* os) const
+ void DescribeTo(::std::ostream* os) const override
{
*os << "matches all elements within tolerance";
}
//! Describe to a human what failing to match means.
- virtual void DescribeNegationTo(::std::ostream* os) const
+ void DescribeNegationTo(::std::ostream* os) const override
{
*os << "does not match all elements within tolerance";
}
class ExactTextMatcher : public ITextBlockMatcher
{
public:
- virtual void checkStream(TextInputStream *stream,
- TestReferenceChecker *checker)
+ void checkStream(TextInputStream *stream,
+ TestReferenceChecker *checker) override
{
TextReader reader(stream);
checker->checkTextBlock(reader.readAll(), "Contents");
class NoTextMatcher : public ITextBlockMatcher
{
public:
- virtual void checkStream(TextInputStream * /*stream*/,
- TestReferenceChecker * /*checker*/)
+ void checkStream(TextInputStream * /*stream*/,
+ TestReferenceChecker * /*checker*/) override
{
}
};
public:
FilteringExactTextMatcher(const std::vector<std::string> &linesToSkip)
: linesToSkip_(linesToSkip) {}
- virtual void checkStream(TextInputStream *stream,
- TestReferenceChecker *checker)
+ void checkStream(TextInputStream *stream,
+ TestReferenceChecker *checker) override
{
StringOutputStream filteredStream;
{
class ExactTextMatch : public ITextBlockMatcherSettings
{
public:
- virtual TextBlockMatcherPointer createMatcher() const;
+ TextBlockMatcherPointer createMatcher() const override;
};
/*! \libinternal \brief
class NoTextMatch : public ITextBlockMatcherSettings
{
public:
- virtual TextBlockMatcherPointer createMatcher() const;
+ TextBlockMatcherPointer createMatcher() const override;
};
/*! \libinternal \brief
{
public:
//! Factory method.
- virtual TextBlockMatcherPointer createMatcher() const;
+ TextBlockMatcherPointer createMatcher() const override;
//! Add a regular expression for which a matching line should be skipped.
void addRegexToSkip(const std::string &lineToSkip);
private:
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
{
}
- virtual void checkStream(TextInputStream *stream,
- TestReferenceChecker *checker)
+ void checkStream(TextInputStream *stream,
+ TestReferenceChecker *checker) override
{
checkXvgFile(stream, checker, settings_);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015, by the GROMACS development team, led by
+ * Copyright (c) 2015,2018, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
return *this;
}
- virtual TextBlockMatcherPointer createMatcher() const;
+ TextBlockMatcherPointer createMatcher() const override;
private:
XvgMatchSettings settings_;