Commit f3ebfa21 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Merge remote-tracking branch 'origin/master' into clang-tidy_modernize-use-default

parents 5442c306 fa8a40d8
......@@ -106,7 +106,7 @@ public:
public:
StartedNotification(const Algorithm *const alg)
: AlgorithmNotification(alg) {} ///< Constructor
virtual std::string name() const {
std::string name() const override {
return "StartedNotification";
} ///< class name
};
......@@ -116,7 +116,7 @@ public:
public:
FinishedNotification(const Algorithm *const alg, bool res)
: AlgorithmNotification(alg), success(res) {} ///< Constructor
virtual std::string name() const {
std::string name() const override {
return "FinishedNotification";
} ///< class name
bool success; ///< true if the finished algorithm was successful or false if
......@@ -133,7 +133,7 @@ public:
int progressPrecision)
: AlgorithmNotification(alg), progress(p), message(msg),
estimatedTime(estimatedTime), progressPrecision(progressPrecision) {}
virtual std::string name() const {
std::string name() const override {
return "ProgressNotification";
} ///< class name
double progress; ///< Current progress. Value must be between 0 and 1.
......@@ -150,7 +150,7 @@ public:
/// Constructor
ErrorNotification(const Algorithm *const alg, const std::string &str)
: AlgorithmNotification(alg), what(str) {}
virtual std::string name() const {
std::string name() const override {
return "ErrorNotification";
} ///< class name
std::string what; ///< message string
......@@ -170,11 +170,9 @@ public:
: outMessage(A.outMessage) {} ///< Copy constructor
/// Assignment operator
CancelException &operator=(const CancelException &A);
/// Destructor
~CancelException() throw(){};
/// Returns the message string.
const char *what() const throw() { return outMessage.c_str(); }
const char *what() const throw() override { return outMessage.c_str(); }
private:
/// The message returned by what()
......@@ -183,99 +181,101 @@ public:
//============================================================================
Algorithm();
virtual ~Algorithm();
~Algorithm() override;
/** @name Algorithm Information */
/// function to return a name of the algorithm, must be overridden in all
/// algorithms
virtual const std::string name() const = 0;
const std::string name() const override = 0;
/// function to return a version of the algorithm, must be overridden in all
/// algorithms
virtual int version() const = 0;
int version() const override = 0;
/// function returns a summary message that will be displayed in the default
/// GUI, and in the help.
virtual const std::string summary() const = 0;
const std::string summary() const override = 0;
/// function to return a category of the algorithm. A default implementation
/// is provided
virtual const std::string category() const { return "Misc"; }
const std::string category() const override { return "Misc"; }
/// Function to return all of the categories that contain this algorithm
virtual const std::vector<std::string> categories() const;
const std::vector<std::string> categories() const override;
/// Function to return the separator token for the category string. A default
/// implementation ';' is provided
virtual const std::string categorySeparator() const { return ";"; }
const std::string categorySeparator() const override { return ";"; }
/// function to return any aliases to the algorithm; A default implementation
/// is provided
virtual const std::string alias() const { return ""; }
const std::string alias() const override { return ""; }
const std::string workspaceMethodName() const;
const std::vector<std::string> workspaceMethodOn() const;
const std::string workspaceMethodInputProperty() const;
const std::string workspaceMethodName() const override;
const std::vector<std::string> workspaceMethodOn() const override;
const std::string workspaceMethodInputProperty() const override;
/// Algorithm ID. Unmanaged algorithms return 0 (or NULL?) values. Managed
/// ones have non-zero.
AlgorithmID getAlgorithmID() const { return m_algorithmID; }
AlgorithmID getAlgorithmID() const override { return m_algorithmID; }
/** @name IAlgorithm methods */
void initialize();
bool execute();
void executeAsChildAlg();
virtual std::map<std::string, std::string> validateInputs();
virtual bool isInitialized() const;
virtual bool isExecuted() const;
bool isRunning() const;
void initialize() override;
bool execute() override;
void executeAsChildAlg() override;
std::map<std::string, std::string> validateInputs() override;
bool isInitialized() const override;
bool isExecuted() const override;
bool isRunning() const override;
using Kernel::PropertyManagerOwner::getProperty;
bool isChild() const;
void setChild(const bool isChild);
void enableHistoryRecordingForChild(const bool on);
bool isChild() const override;
void setChild(const bool isChild) override;
void enableHistoryRecordingForChild(const bool on) override;
bool isRecordingHistoryForChild() { return m_recordHistoryForChild; }
void setAlwaysStoreInADS(const bool doStore);
void setRethrows(const bool rethrow);
void setAlwaysStoreInADS(const bool doStore) override;
void setRethrows(const bool rethrow) override;
/** @name Asynchronous Execution */
Poco::ActiveResult<bool> executeAsync();
Poco::ActiveResult<bool> executeAsync() override;
/// Add an observer for a notification
void addObserver(const Poco::AbstractObserver &observer) const;
void addObserver(const Poco::AbstractObserver &observer) const override;
/// Remove an observer
void removeObserver(const Poco::AbstractObserver &observer) const;
void removeObserver(const Poco::AbstractObserver &observer) const override;
/// Raises the cancel flag.
virtual void cancel();
void cancel() override;
/// Returns the cancellation state
bool getCancel() const { return m_cancel; }
/// Returns a reference to the logger.
Kernel::Logger &getLogger() const { return g_log; }
/// Logging can be disabled by passing a value of false
void setLogging(const bool value) { g_log.setEnabled(value); }
void setLogging(const bool value) override { g_log.setEnabled(value); }
/// returns the status of logging, True = enabled
bool isLogging() const { return g_log.getEnabled(); }
bool isLogging() const override { return g_log.getEnabled(); }
/// sets the logging priority offset
void setLoggingOffset(const int value) { g_log.setLevelOffset(value); }
void setLoggingOffset(const int value) override {
g_log.setLevelOffset(value);
}
/// returns the logging priority offset
int getLoggingOffset() const { return g_log.getLevelOffset(); }
int getLoggingOffset() const override { return g_log.getLevelOffset(); }
/// disable Logging of start and end messages
void setAlgStartupLogging(const bool enabled);
void setAlgStartupLogging(const bool enabled) override;
/// get the state of Logging of start and end messages
bool getAlgStartupLogging() const;
bool getAlgStartupLogging() const override;
/// setting the child start progress
void setChildStartProgress(const double startProgress) const {
void setChildStartProgress(const double startProgress) const override {
m_startChildProgress = startProgress;
}
/// setting the child end progress
void setChildEndProgress(const double endProgress) const {
void setChildEndProgress(const double endProgress) const override {
m_endChildProgress = endProgress;
}
/** @name Serialization functions */
//@{
/// Serialize an object to a string
virtual std::string toString() const;
std::string toString() const override;
/// Serialize an object to a json object
::Json::Value toJson() const;
/// De-serialize an object from a string
......
......@@ -119,7 +119,7 @@ public:
bool exists(const std::string &algorithmName, const int version = -1);
/// Get the algorithm names and version - mangled use decodeName to separate
const std::vector<std::string> getKeys() const;
const std::vector<std::string> getKeys() const override;
const std::vector<std::string> getKeys(bool includeHidden) const;
/// Returns the highest version of the algorithm currently registered
......@@ -158,7 +158,7 @@ private:
/// Private assignment operator - NO ASSIGNMENT ALLOWED
AlgorithmFactoryImpl &operator=(const AlgorithmFactoryImpl &);
/// Private Destructor
virtual ~AlgorithmFactoryImpl();
~AlgorithmFactoryImpl() override;
/// creates an algorithm name convolved from an name and version
std::string createName(const std::string &, const int &) const;
/// fills a set with the hidden categories
......
......@@ -48,15 +48,13 @@ class MANTID_API_DLL AlgorithmHasProperty
public:
/// Constructor
AlgorithmHasProperty(const std::string &propName);
/// Destructor
~AlgorithmHasProperty() = default;
/**
* Get a string representation of the type
* @returns A string containing the validator type
*/
inline std::string getType() const { return "AlgorithmHasProperty"; }
/// Make a copy of the present type of validator
inline Kernel::IValidator_sptr clone() const {
inline Kernel::IValidator_sptr clone() const override {
return boost::make_shared<AlgorithmHasProperty>(*this);
}
......@@ -67,8 +65,8 @@ protected:
* @returns An error message to display to users or an empty string on no
* error
*/
virtual std::string
checkValidity(const boost::shared_ptr<IAlgorithm> &value) const;
std::string
checkValidity(const boost::shared_ptr<IAlgorithm> &value) const override;
private:
/// Default constructor
......
......@@ -67,24 +67,24 @@ public:
/// Copy-Assignment operator
AlgorithmProperty &operator=(const AlgorithmProperty &rhs);
/// 'Virtual copy constructor'
inline AlgorithmProperty *clone() const {
inline AlgorithmProperty *clone() const override {
return new AlgorithmProperty(*this);
}
/// Destructor
~AlgorithmProperty();
~AlgorithmProperty() override;
/// Add the value of another property. Doesn't make sense here.
virtual AlgorithmProperty &operator+=(Kernel::Property const *) {
AlgorithmProperty &operator+=(Kernel::Property const *) override {
throw Kernel::Exception::NotImplementedError(
"+= operator is not implemented for AlgorithmProperty.");
return *this;
}
/// Return the algorithm as string
virtual std::string value() const;
std::string value() const override;
/// Get the default
virtual std::string getDefault() const;
std::string getDefault() const override;
/// Sets the value of the algorithm
virtual std::string setValue(const std::string &value);
std::string setValue(const std::string &value) override;
private:
/// Default constructor
......
......@@ -67,89 +67,94 @@ class MANTID_API_DLL AlgorithmProxy : public IAlgorithm,
public Kernel::PropertyManagerOwner {
public:
AlgorithmProxy(Algorithm_sptr alg);
virtual ~AlgorithmProxy();
~AlgorithmProxy() override;
/// The name of the algorithm
const std::string name() const { return m_name; }
const std::string name() const override { return m_name; }
/// The version of the algorithm
int version() const { return m_version; }
int version() const override { return m_version; }
/// The category of the algorithm
const std::string category() const { return m_category; }
const std::string category() const override { return m_category; }
/// Function to return all of the categories that contain this algorithm
const std::vector<std::string> categories() const;
const std::vector<std::string> categories() const override;
/// Function to return the sperator token for the category string. A default
/// implementation ',' is provided
const std::string categorySeparator() const { return m_categorySeparator; }
const std::string categorySeparator() const override {
return m_categorySeparator;
}
/// Aliases to the algorithm
const std::string alias() const { return m_alias; }
const std::string alias() const override { return m_alias; }
/// function returns a summary message that will be displayed in the default
/// GUI, and in the help.
const std::string summary() const { return m_summary; }
const std::string summary() const override { return m_summary; }
/// The algorithmID
AlgorithmID getAlgorithmID() const;
void initialize();
std::map<std::string, std::string> validateInputs();
bool execute();
void executeAsChildAlg() { throw std::runtime_error("Not implemented."); }
Poco::ActiveResult<bool> executeAsync();
bool isInitialized() const;
bool isExecuted() const;
AlgorithmID getAlgorithmID() const override;
void initialize() override;
std::map<std::string, std::string> validateInputs() override;
bool execute() override;
void executeAsChildAlg() override {
throw std::runtime_error("Not implemented.");
}
Poco::ActiveResult<bool> executeAsync() override;
bool isInitialized() const override;
bool isExecuted() const override;
/// To query whether algorithm is a child. A proxy is always at top level,
/// returns false
bool isChild() const { return m_isChild; }
void setAlwaysStoreInADS(const bool) {}
void setChild(const bool val) { m_isChild = val; }
bool isChild() const override { return m_isChild; }
void setAlwaysStoreInADS(const bool) override {}
void setChild(const bool val) override { m_isChild = val; }
/// Proxies only manage parent algorithms
void enableHistoryRecordingForChild(const bool){};
void setRethrows(const bool rethrow);
void enableHistoryRecordingForChild(const bool) override{};
void setRethrows(const bool rethrow) override;
const std::string workspaceMethodName() const;
const std::vector<std::string> workspaceMethodOn() const;
const std::string workspaceMethodInputProperty() const;
const std::string workspaceMethodName() const override;
const std::vector<std::string> workspaceMethodOn() const override;
const std::string workspaceMethodInputProperty() const override;
/** @name PropertyManager methods */
//@{
/// Set the property value
void setPropertyValue(const std::string &name, const std::string &value);
void setPropertyValue(const std::string &name,
const std::string &value) override;
/// Do something after a property was set
void afterPropertySet(const std::string &);
void afterPropertySet(const std::string &) override;
/// Make m_properties point to the same PropertyManager as po.
void copyPropertiesFrom(const PropertyManagerOwner &po);
void copyPropertiesFrom(const PropertyManagerOwner &po) override;
//@}
void cancel();
bool isRunning() const;
void cancel() override;
bool isRunning() const override;
void addObserver(const Poco::AbstractObserver &observer) const;
void removeObserver(const Poco::AbstractObserver &observer) const;
void addObserver(const Poco::AbstractObserver &observer) const override;
void removeObserver(const Poco::AbstractObserver &observer) const override;
/// Set logging on or off
///@param value :: true = logging enabled
void setLogging(const bool value) { m_isLoggingEnabled = value; }
void setLogging(const bool value) override { m_isLoggingEnabled = value; }
/// Is the algorithm have logging enabled
bool isLogging() const { return m_isLoggingEnabled; }
bool isLogging() const override { return m_isLoggingEnabled; }
/// returns the logging priority offset
void setLoggingOffset(const int value) { m_loggingOffset = value; }
void setLoggingOffset(const int value) override { m_loggingOffset = value; }
/// returns the logging priority offset
int getLoggingOffset() const { return m_loggingOffset; }
int getLoggingOffset() const override { return m_loggingOffset; }
/// disable Logging of start and end messages
void setAlgStartupLogging(const bool enabled);
void setAlgStartupLogging(const bool enabled) override;
/// get the state of Logging of start and end messages
bool getAlgStartupLogging() const;
bool getAlgStartupLogging() const override;
/// setting the child start progress
void setChildStartProgress(const double startProgress) const;
void setChildStartProgress(const double startProgress) const override;
/// setting the child end progress
void setChildEndProgress(const double endProgress) const;
void setChildEndProgress(const double endProgress) const override;
/** @name String serialization */
//@{
/// Serialize an object to a string
virtual std::string toString() const;
std::string toString() const override;
//@}
private:
......
......@@ -112,12 +112,13 @@ public:
const std::string isValid(const std::string &name) const;
/// Overridden add member to attach the name to the workspace when a workspace
/// object is added to the service
virtual void add(const std::string &name,
const boost::shared_ptr<API::Workspace> &workspace);
void add(const std::string &name,
const boost::shared_ptr<API::Workspace> &workspace) override;
/// Overridden addOrReplace member to attach the name to the workspace when a
/// workspace object is added to the service
virtual void addOrReplace(const std::string &name,
const boost::shared_ptr<API::Workspace> &workspace);
void
addOrReplace(const std::string &name,
const boost::shared_ptr<API::Workspace> &workspace) override;
/// Overridden rename member to attach the new name to the workspace when a
/// workspace object is renamed
virtual void rename(const std::string &oldName, const std::string &newName);
......@@ -156,7 +157,7 @@ public:
/// Return a lookup of the top level items
std::map<std::string, Workspace_sptr> topLevelItems() const;
void shutdown();
void shutdown() override;
private:
/// Checks the name is valid, throwing if not
......@@ -170,7 +171,7 @@ private:
/// Private, unimplemented copy assignment operator
AnalysisDataServiceImpl &operator=(const AnalysisDataServiceImpl &);
/// Private destructor
virtual ~AnalysisDataServiceImpl() = default;
~AnalysisDataServiceImpl() override = default;
/// The string of illegal characters
std::string m_illegalChars;
......
......@@ -51,8 +51,7 @@ private:
ArchiveSearchFactoryImpl(const ArchiveSearchFactoryImpl &);
/// Private assignment operator - NO ASSIGNMENT ALLOWED
ArchiveSearchFactoryImpl &operator=(const ArchiveSearchFactoryImpl &);
/// Private Destructor
virtual ~ArchiveSearchFactoryImpl() = default;
~ArchiveSearchFactoryImpl() override {}
};
/// Forward declaration of a specialisation of SingletonHolder for
......
......@@ -37,15 +37,14 @@ class MANTID_API_DLL BinEdgeAxis : public NumericAxis {
public:
BinEdgeAxis(const std::size_t &length);
BinEdgeAxis(const std::vector<double> &edges);
virtual ~BinEdgeAxis() = default;
virtual Axis *clone(const MatrixWorkspace *const parentWorkspace);
virtual Axis *clone(const std::size_t length,
const MatrixWorkspace *const parentWorkspace);
Axis *clone(const MatrixWorkspace *const parentWorkspace) override;
Axis *clone(const std::size_t length,
const MatrixWorkspace *const parentWorkspace) override;
virtual std::vector<double> createBinBoundaries() const;
void setValue(const std::size_t &index, const double &value);
size_t indexOfValue(const double value) const;
std::vector<double> createBinBoundaries() const override;
void setValue(const std::size_t &index, const double &value) override;
size_t indexOfValue(const double value) const override;
private:
/// Private, undefined copy assignment operator
......
......@@ -70,7 +70,7 @@ private:
/// Private assignment operator
CatalogFactoryImpl &operator=(const CatalogFactoryImpl &);
/// Private Destructor
virtual ~CatalogFactoryImpl() = default;
~CatalogFactoryImpl() override = default;
/// Stores pointers to already created Catalog instances, with their name as
/// the key
mutable std::map<std::string, boost::shared_ptr<ICatalog>> m_createdCatalogs;
......
......@@ -50,7 +50,7 @@ class Column;
class MANTID_API_DLL ColumnFactoryImpl : public Kernel::DynamicFactory<Column> {
public:
/// Creates an instance of a column
boost::shared_ptr<Column> create(const std::string &type) const;
boost::shared_ptr<Column> create(const std::string &type) const override;
private:
friend struct Mantid::Kernel::CreateUsingNew<ColumnFactoryImpl>;
......@@ -62,7 +62,7 @@ private:
/// Private assignment operator - NO ASSIGNMENT ALLOWED
ColumnFactoryImpl &operator=(const ColumnFactoryImpl &);
/// Private Destructor
virtual ~ColumnFactoryImpl() = default;
~ColumnFactoryImpl() override = default;
};
/// Forward declaration of a specialisation of SingletonHolder for
......
......@@ -39,11 +39,11 @@ public:
/// Gets the type of the validator
std::string getType() const { return "commonbins"; }
/// Clone the current state
Kernel::IValidator_sptr clone() const;
Kernel::IValidator_sptr clone() const override;
private:
/// Check for validity
std::string checkValidity(const MatrixWorkspace_sptr &value) const;
std::string checkValidity(const MatrixWorkspace_sptr &value) const override;
};
} // namespace API
......
......@@ -42,33 +42,33 @@ public:
/// Adds a catalog to the list of catalogs (m_catalogs)
void add(const ICatalog_sptr catalog);
/// Log the user into the catalog system.
virtual CatalogSession_sptr login(const std::string &username,
const std::string &password,
const std::string &endpoint,
const std::string &facility);
CatalogSession_sptr login(const std::string &username,
const std::string &password,
const std::string &endpoint,
const std::string &facility) override;
/// Log the user out of the catalog system.
virtual void logout();
void logout() override;
/// Search the catalog for data.
virtual void search(const ICat::CatalogSearchParam &inputs,
ITableWorkspace_sptr &outputws, const int &offset,
const int &limit);
void search(const ICat::CatalogSearchParam &inputs,
ITableWorkspace_sptr &outputws, const int &offset,
const int &limit) override;
/// Obtain the number of results returned by the search method.
virtual int64_t
getNumberOfSearchResults(const ICat::CatalogSearchParam &inputs);
int64_t
getNumberOfSearchResults(const ICat::CatalogSearchParam &inputs) override;
/// Show the logged in user's investigations search results.
virtual void myData(ITableWorkspace_sptr &outputws);
void myData(ITableWorkspace_sptr &outputws) override;
/// Get datasets.
virtual void getDataSets(const std::string &investigationId,
ITableWorkspace_sptr &outputws);
void getDataSets(const std::string &investigationId,
ITableWorkspace_sptr &outputws) override;
/// Get datafiles
virtual void getDataFiles(const std::string &investigationId,
ITableWorkspace_sptr &outputws);
void getDataFiles(const std::string &investigationId,
ITableWorkspace_sptr &outputws) override;
/// Get instruments list
virtual void listInstruments(std::vector<std::string> &instruments);
void listInstruments(std::vector<std::string> &instruments) override;
/// Get investigationtypes list
virtual void listInvestigationTypes(std::vector<std::string> &invstTypes);
void listInvestigationTypes(std::vector<std::string> &invstTypes) override;
/// Keep current session alive
virtual void keepAlive();
void keepAlive() override;
private:
std::list<ICatalog_sptr> m_catalogs;
......
......@@ -44,13 +44,13 @@ class FunctionDomainMD;
class MANTID_API_DLL CompositeDomainMD : public CompositeDomain {
public:
CompositeDomainMD(IMDWorkspace_const_sptr ws, size_t maxDomainSize);
~CompositeDomainMD();
~CompositeDomainMD() override;
/// Return the total number of arguments in the domain
virtual size_t size() const { return m_totalSize; }
size_t size() const override { return m_totalSize; }
/// Return the number of parts in the domain
virtual size_t getNParts() const { return m_domains.size(); }
size_t getNParts() const override { return m_domains.size(); }
/// Return i-th domain