Commit 093c6bd4 authored by Danny Hindson's avatar Danny Hindson
Browse files

Changes to suppress Visual Studio compiler warnings

C4996. Warning that std::shared_ptr::unique() has been deprecated
Added a suppression to the MSVCSetup.cmake file. This is a bit of
a stop gap while an alternative solution is investigated

C4250. Warning that Algorithm and all the derived classes inherit
various methods "by dominance"
PropertyManagerOwner has been added to the Algorithm class by composition
instead of by inheritance which removes the diamond

Lots of instances of IAlgorithm_sptr type have been replaced with
"auto" to provide some extra flexibility around the arrangement of
the class\interface hierarchy in future

Also remove a couple of references to PropertyManagerOwner in case
its removed in future (merged into Algorithm)
parent 3db3fb35
......@@ -53,6 +53,9 @@ namespace API {
class AlgorithmHistory;
class WorkspaceHistory;
/// Typedef for a shared pointer to an Algorithm
using Algorithm_sptr = std::shared_ptr<Algorithm>;
/**
Base class from which all concrete algorithm classes should be derived.
In order for a concrete algorithm class to do anything
......@@ -75,16 +78,16 @@ Gaudi user guide).
http://proj-gaudi.web.cern.ch/proj-gaudi/)
@date 12/09/2007
*/
class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManagerOwner {
class MANTID_API_DLL Algorithm : public IAlgorithm {
public:
/// Base class for algorithm notifications
class MANTID_API_DLL AlgorithmNotification : public Poco::Notification {
public:
AlgorithmNotification(const Algorithm *const alg);
const IAlgorithm *algorithm() const;
const Algorithm *algorithm() const;
private:
const IAlgorithm *const m_algorithm; ///< The algorithm
const Algorithm *const m_algorithm; ///< The algorithm
};
/// StartedNotification is sent when the algorithm begins execution.
......@@ -216,8 +219,6 @@ public:
bool isRunning() const override;
bool isReadyForGarbageCollection() const override;
using Kernel::PropertyManagerOwner::getProperty;
bool isChild() const override;
void setChild(const bool isChild) override;
void enableHistoryRecordingForChild(const bool on) override;
......@@ -261,17 +262,17 @@ public:
/// Serialize an object to a json object
::Json::Value toJson() const override;
/// De-serialize an object from a string
static IAlgorithm_sptr fromString(const std::string &input);
static Algorithm_sptr fromString(const std::string &input);
/// De-serialize an object from a Json
static IAlgorithm_sptr fromJson(const Json::Value &input);
static Algorithm_sptr fromJson(const Json::Value &input);
/// Construct an object from a history entry
static IAlgorithm_sptr fromHistory(const AlgorithmHistory &history);
static Algorithm_sptr fromHistory(const AlgorithmHistory &history);
//@}
virtual std::shared_ptr<Algorithm> createChildAlgorithm(const std::string &name, const double startProgress = -1.,
const double endProgress = -1.,
const bool enableLogging = true, const int &version = -1);
void setupAsChildAlgorithm(const std::shared_ptr<Algorithm> &algorithm, const double startProgress = -1.,
void setupAsChildAlgorithm(const Algorithm_sptr &algorithm, const double startProgress = -1.,
const double endProgress = -1., const bool enableLogging = true);
/// set whether we wish to track the child algorithm's history and pass it the
......@@ -287,11 +288,82 @@ public:
virtual bool processGroups();
void copyNonWorkspaceProperties(IAlgorithm *alg, int periodNum);
void copyNonWorkspaceProperties(Algorithm *alg, int periodNum);
const Parallel::Communicator &communicator() const;
void setCommunicator(const Parallel::Communicator &communicator);
// Function to declare properties (i.e. store them)
void declareProperty(std::unique_ptr<Kernel::Property> p, const std::string &doc = "") override;
// Function to declare properties (i.e. store them)
void declareOrReplaceProperty(std::unique_ptr<Kernel::Property> p, const std::string &doc = "") override;
void resetProperties() override;
using IPropertyManager::declareProperty;
// Sets all the declared properties from
void setProperties(const std::string &propertiesJson,
const std::unordered_set<std::string> &ignoreProperties = std::unordered_set<std::string>(),
bool createMissing = false) override;
// Sets all the declared properties from a json object
void setProperties(const ::Json::Value &jsonValue,
const std::unordered_set<std::string> &ignoreProperties = std::unordered_set<std::string>(),
bool createMissing = false) override;
// sets all the declared properties using a simple string format
void setPropertiesWithString(
const std::string &propertiesString,
const std::unordered_set<std::string> &ignoreProperties = std::unordered_set<std::string>()) override;
void setPropertyValue(const std::string &name, const std::string &value) override;
void setPropertyValueFromJson(const std::string &name, const Json::Value &value) override;
void setPropertyOrdinal(const int &index, const std::string &value) override;
/// Make m_properties point to the same PropertyManager as alg.m_properties.
virtual void copyPropertiesFrom(const Algorithm &alg) { m_properties.copyPropertiesFrom(alg.m_properties); }
bool existsProperty(const std::string &name) const override;
bool validateProperties() const override;
size_t propertyCount() const override;
std::string getPropertyValue(const std::string &name) const override;
const std::vector<Kernel::Property *> &getProperties() const override;
/// Get the value of a property
TypedValue getProperty(const std::string &name) const override;
/// Return the property manager serialized as a string.
std::string asString(bool withDefaultValues = false) const override;
/// Return the property manager serialized as a json object.
::Json::Value asJson(bool withDefaultValues = false) const override;
bool isDefault(const std::string &name) const;
/// Removes the property from management
void removeProperty(const std::string &name, const bool delproperty = true) override;
/// Clears all properties under management
void clear() override;
/// Override this method to perform a custom action right after a property was
/// set.
/// The argument is the property name. Default - do nothing.
void afterPropertySet(const std::string &) override;
void filterByTime(const Types::Core::DateAndTime & /*start*/, const Types::Core::DateAndTime & /*stop*/) override {
throw(std::runtime_error("Not yet implmented"));
}
void splitByTime(std::vector<Kernel::SplittingInterval> & /*splitter*/,
std::vector<Kernel::PropertyManager *> /* outputs*/) const override {
throw(std::runtime_error("Not yet implmented"));
}
void filterByProperty(const Kernel::TimeSeriesProperty<bool> & /*filter*/, const std::vector<std::string> &
/* excludedFromFiltering */) override {
throw(std::runtime_error("Not yet implmented"));
}
Kernel::Property *getPointerToProperty(const std::string &name) const override;
Kernel::Property *getPointerToPropertyOrdinal(const int &index) const override;
protected:
/// Virtual method - must be overridden by concrete algorithm
virtual void init() = 0;
......@@ -475,10 +547,9 @@ private:
/// The earliest this class should be considered for garbage collection
Mantid::Types::Core::DateAndTime m_gcTime;
};
/// Typedef for a shared pointer to an Algorithm
using Algorithm_sptr = std::shared_ptr<Algorithm>;
Mantid::Kernel::PropertyManagerOwner m_properties;
};
} // namespace API
} // namespace Mantid
......
......@@ -30,7 +30,7 @@ template <class Base> class MANTID_API_DLL GenericDataProcessorAlgorithm : publi
public:
GenericDataProcessorAlgorithm();
std::string getPropertyValue(const std::string &name) const override;
Kernel::PropertyManagerOwner::TypedValue getProperty(const std::string &name) const override;
Kernel::IPropertyManager::TypedValue getProperty(const std::string &name) const override;
protected:
std::shared_ptr<Algorithm> createChildAlgorithm(const std::string &name, const double startProgress = -1.,
......
......@@ -105,13 +105,13 @@ size_t Algorithm::g_execCount = 0;
/// Constructor
Algorithm::Algorithm()
: PropertyManagerOwner(), m_cancel(false), m_parallelException(false), m_log("Algorithm"), g_log(m_log),
m_groupSize(0), m_executeAsync(nullptr), m_notificationCenter(nullptr), m_progressObserver(nullptr),
: m_cancel(false), m_parallelException(false), m_log("Algorithm"), g_log(m_log), m_groupSize(0),
m_executeAsync(nullptr), m_notificationCenter(nullptr), m_progressObserver(nullptr),
m_executionState(ExecutionState::Uninitialized), m_resultState(ResultState::NotFinished),
m_isChildAlgorithm(false), m_recordHistoryForChild(false), m_alwaysStoreInADS(true), m_runningAsync(false),
m_rethrow(false), m_isAlgStartupLoggingEnabled(true), m_startChildProgress(0.), m_endChildProgress(0.),
m_algorithmID(this), m_singleGroup(-1), m_groupsHaveSimilarNames(false), m_inputWorkspaceHistories(),
m_communicator(std::make_unique<Parallel::Communicator>()) {}
m_communicator(std::make_unique<Parallel::Communicator>()), m_properties() {}
/// Virtual destructor
Algorithm::~Algorithm() {}
......@@ -905,7 +905,7 @@ std::string Algorithm::toString() const {
root["name"] = name();
root["version"] = this->version();
root["properties"] = Kernel::PropertyManagerOwner::asJson(false);
root["properties"] = m_properties.asJson(false);
return root;
}
......@@ -918,7 +918,7 @@ std::string Algorithm::toString() const {
* @param history :: AlgorithmHistory object
* @return a shared pointer to the created algorithm.
*/
IAlgorithm_sptr Algorithm::fromHistory(const AlgorithmHistory &history) {
Algorithm_sptr Algorithm::fromHistory(const AlgorithmHistory &history) {
::Json::Value root;
::Json::Value jsonMap;
::Json::FastWriter writer;
......@@ -937,7 +937,7 @@ IAlgorithm_sptr Algorithm::fromHistory(const AlgorithmHistory &history) {
root["properties"] = jsonMap;
const std::string output = writer.write(root);
IAlgorithm_sptr alg;
Algorithm_sptr alg;
try {
alg = Algorithm::fromString(output);
......@@ -957,7 +957,7 @@ IAlgorithm_sptr Algorithm::fromHistory(const AlgorithmHistory &history) {
* @return A pointer to a managed algorithm object
* @throws std::runtime_error if the algorithm cannot be created
*/
IAlgorithm_sptr Algorithm::fromString(const std::string &input) {
Algorithm_sptr Algorithm::fromString(const std::string &input) {
::Json::Value root;
::Json::Reader reader;
if (reader.parse(input, root)) {
......@@ -974,7 +974,7 @@ IAlgorithm_sptr Algorithm::fromString(const std::string &input) {
* @return A new algorithm object
* @throws std::runtime_error if the algorithm cannot be created
*/
IAlgorithm_sptr Algorithm::fromJson(const Json::Value &serialized) {
Algorithm_sptr Algorithm::fromJson(const Json::Value &serialized) {
const std::string algName = serialized["name"].asString();
const int version = serialized.get("version", -1).asInt();
auto alg = AlgorithmManager::Instance().createUnmanaged(algName, version);
......@@ -1387,7 +1387,7 @@ bool Algorithm::processGroups() {
alg_sptr->enableHistoryRecordingForChild(false);
alg_sptr->setRethrows(true);
IAlgorithm *alg = alg_sptr.get();
Algorithm *alg = alg_sptr.get();
// Set all non-workspace properties
this->copyNonWorkspaceProperties(alg, int(entry) + 1);
......@@ -1514,7 +1514,7 @@ bool Algorithm::processGroups() {
* @param alg :: other IAlgorithm
* @param periodNum :: number of the "period" = the entry in the group + 1
*/
void Algorithm::copyNonWorkspaceProperties(IAlgorithm *alg, int periodNum) {
void Algorithm::copyNonWorkspaceProperties(Algorithm *alg, int periodNum) {
if (!alg)
throw std::runtime_error("Algorithm not created!");
const auto &props = this->getProperties();
......@@ -1875,7 +1875,7 @@ void Algorithm::setCommunicator(const Parallel::Communicator &communicator) {
Algorithm::AlgorithmNotification::AlgorithmNotification(const Algorithm *const alg)
: Poco::Notification(), m_algorithm(alg) {}
const IAlgorithm *Algorithm::AlgorithmNotification::algorithm() const { return m_algorithm; }
const Algorithm *Algorithm::AlgorithmNotification::algorithm() const { return m_algorithm; }
Algorithm::StartedNotification::StartedNotification(const Algorithm *const alg) : AlgorithmNotification(alg) {}
std::string Algorithm::StartedNotification::name() const { return "StartedNotification"; } ///< class name
......@@ -1898,6 +1898,217 @@ std::string Algorithm::ErrorNotification::name() const { return "ErrorNotificati
const char *Algorithm::CancelException::what() const noexcept { return "Algorithm terminated"; }
/** Add a property to the list of managed properties
* @param p :: The property object to add
* @param doc :: A description of the property that may be displayed to users
* @throw Exception::ExistsError if a property with the given name already
* exists
*/
void Algorithm::declareProperty(std::unique_ptr<Property> p, const std::string &doc) {
m_properties.declareProperty(std::move(p), doc);
}
/** Add or replace property in the list of managed properties
* @param p :: The property object to add
* @param doc :: A description of the property that may be displayed to users
*/
void Algorithm::declareOrReplaceProperty(std::unique_ptr<Property> p, const std::string &doc) {
m_properties.declareOrReplaceProperty(std::move(p), doc);
}
/** Reset property values back to initial values (blank or default values)
*/
void Algorithm::resetProperties() { m_properties.resetProperties(); }
/** Set the ordered list of properties by one string of values, separated by
*semicolons.
*
* The string should be a json formatted collection of name value pairs
*
* @param propertiesJson :: The string of property values
* @param ignoreProperties :: A set of names of any properties NOT to set
* from the propertiesArray
* @param createMissing :: If the property does not exist then create it
* @throw invalid_argument if error in parameters
*/
void Algorithm::setProperties(const std::string &propertiesJson,
const std::unordered_set<std::string> &ignoreProperties, bool createMissing) {
m_properties.setProperties(propertiesJson, ignoreProperties, createMissing);
}
/** Sets all the declared properties from a json object
@param jsonValue :: A json name value pair collection
@param ignoreProperties :: A set of names of any properties NOT to set
from the propertiesArray
@param createMissing :: If the property does not exist then create it
*/
void Algorithm::setProperties(const ::Json::Value &jsonValue, const std::unordered_set<std::string> &ignoreProperties,
bool createMissing) {
m_properties.setProperties(jsonValue, ignoreProperties, createMissing);
}
/** Sets all the declared properties from a string.
@param propertiesString :: A list of name = value pairs separated by a
semicolon
@param ignoreProperties :: A set of names of any properties NOT to set
from the propertiesArray
*/
void Algorithm::setPropertiesWithString(const std::string &propertiesString,
const std::unordered_set<std::string> &ignoreProperties) {
m_properties.setPropertiesWithString(propertiesString, ignoreProperties);
}
/** Set the value of a property by string
* N.B. bool properties must be set using 1/0 rather than true/false
* @param name :: The name of the property (case insensitive)
* @param value :: The value to assign to the property
* @throw Exception::NotFoundError if the named property is unknown
* @throw std::invalid_argument If the value is not valid for the property
* given
*/
void Algorithm::setPropertyValue(const std::string &name, const std::string &value) {
m_properties.setPropertyValue(name, value);
this->afterPropertySet(name);
}
/** Set the value of a property by Json::Value object
* @param name :: The name of the property (case insensitive)
* @param value :: The value to assign to the property
* @throw Exception::NotFoundError if the named property is unknown
* @throw std::invalid_argument If the value is not valid for the property
* given
*/
void Algorithm::setPropertyValueFromJson(const std::string &name, const Json::Value &value) {
m_properties.setPropertyValueFromJson(name, value);
this->afterPropertySet(name);
}
/** Set the value of a property by an index
* N.B. bool properties must be set using 1/0 rather than true/false
* @param index :: The index of the property to assign
* @param value :: The value to assign to the property
* @throw std::runtime_error if the property index is too high
*/
void Algorithm::setPropertyOrdinal(const int &index, const std::string &value) {
m_properties.setPropertyOrdinal(index, value);
this->afterPropertySet(m_properties.getPointerToPropertyOrdinal(index)->name());
}
/** Checks whether the named property is already in the list of managed
* property.
* @param name :: The name of the property (case insensitive)
* @return True if the property is already stored
*/
bool Algorithm::existsProperty(const std::string &name) const { return m_properties.existsProperty(name); }
/** Validates all the properties in the collection
* @return True if all properties have a valid value
*/
bool Algorithm::validateProperties() const { return m_properties.validateProperties(); }
/**
* Count the number of properties under management
* @returns The number of properties being managed
*/
size_t Algorithm::propertyCount() const { return m_properties.propertyCount(); }
/** Get the value of a property as a string
* @param name :: The name of the property (case insensitive)
* @return The value of the named property
* @throw Exception::NotFoundError if the named property is unknown
*/
std::string Algorithm::getPropertyValue(const std::string &name) const { return m_properties.getPropertyValue(name); }
/** Get a property by name
* @param name :: The name of the property (case insensitive)
* @return A pointer to the named property
* @throw Exception::NotFoundError if the named property is unknown
*/
Property *Algorithm::getPointerToProperty(const std::string &name) const {
return m_properties.getPointerToProperty(name);
}
/** Get a property by an index
* @param index :: The name of the property (case insensitive)
* @return A pointer to the named property
* @throw std::runtime_error if the property index is too high
*/
Property *Algorithm::getPointerToPropertyOrdinal(const int &index) const {
return m_properties.getPointerToPropertyOrdinal(index);
}
/** Get the list of managed properties.
* The properties will be stored in the order that they were declared.
* @return A vector holding pointers to the list of properties
*/
const std::vector<Property *> &Algorithm::getProperties() const { return m_properties.getProperties(); }
/** Get the value of a property. Allows you to assign directly to a variable of
*the property's type
* (if a supported type).
*
* *** This method does NOT work for assigning to an existing std::string.
* In this case you have to use getPropertyValue() instead.
* Note that you can, though, construct a local string variable by writing,
* e.g. std::string s = getProperty("myProperty"). ***
*
* @param name :: The name of the property
* @return The value of the property. Will be cast to the desired type (if a
*supported type).
* @throw std::runtime_error If an attempt is made to assign a property to a
*different type
* @throw Exception::NotFoundError If the property requested does not exist
*/
IPropertyManager::TypedValue Algorithm::getProperty(const std::string &name) const {
return m_properties.getProperty(name);
}
/**
* @param name
* @return True if the property is its default value.
*/
bool Algorithm::isDefault(const std::string &name) const {
return m_properties.getPointerToProperty(name)->isDefault();
}
/**
* Return the property manager serialized as a string.
* The format is propName=value,propName=value,propName=value
* @param withDefaultValues :: If true then the value of default parameters will
* be included
* @returns A stringized version of the manager
*/
std::string Algorithm::asString(bool withDefaultValues) const { return m_properties.asString(withDefaultValues); }
/**
* Return the property manager serialized as a json object.
* @param withDefaultValues :: If true then the value of default parameters will
* be included
* @returns A jsonValue of the manager
*/
::Json::Value Algorithm::asJson(bool withDefaultValues) const { return m_properties.asJson(withDefaultValues); }
/**
* Removes the property from properties map.
* @param name :: Name of the property to be removed.
* @param delproperty :: if true, delete the named property
*/
void Algorithm::removeProperty(const std::string &name, const bool delproperty) {
m_properties.removeProperty(name, delproperty);
}
/**
* Clears all properties under management
*/
void Algorithm::clear() { m_properties.clear(); }
/**
* Override this method to perform a custom action right after a property was
* set.
* The argument is the property name. Default - do nothing.
* @param name :: A property name.
*/
void Algorithm::afterPropertySet(const std::string &name) { m_properties.afterPropertySet(name); }
} // namespace API
//---------------------------------------------------------------------------
......@@ -1939,6 +2150,7 @@ IPropertyManager::getValue<API::IAlgorithm_const_sptr>(const std::string &name)
throw std::runtime_error(message);
}
}
} // namespace Kernel
} // namespace Mantid
......@@ -131,7 +131,7 @@ void AlgorithmManagerImpl::removeById(AlgorithmID id) {
* @param id :: ID of the algorithm being started
*/
void AlgorithmManagerImpl::notifyAlgorithmStarting(AlgorithmID id) {
IAlgorithm_sptr alg = this->getAlgorithm(id);
auto alg = this->getAlgorithm(id);
if (!alg)
return;
notificationCenter.postNotification(new AlgorithmStartingNotification(alg));
......
......@@ -212,7 +212,7 @@ template <class Base> MatrixWorkspace_sptr GenericDataProcessorAlgorithm<Base>::
template <class Base> Workspace_sptr GenericDataProcessorAlgorithm<Base>::assemble(Workspace_sptr partialWS) {
Workspace_sptr outputWS = std::move(partialWS);
#ifdef MPI_BUILD
IAlgorithm_sptr gatherAlg = createChildAlgorithm("GatherWorkspaces");
auto gatherAlg = createChildAlgorithm("GatherWorkspaces");
gatherAlg->setLogging(true);
gatherAlg->setAlwaysStoreInADS(true);
gatherAlg->setProperty("InputWorkspace", partialWS);
......@@ -240,7 +240,7 @@ Workspace_sptr GenericDataProcessorAlgorithm<Base>::assemble(const std::string &
#ifdef MPI_BUILD
std::string threadOutput = partialWSName;
Workspace_sptr partialWS = AnalysisDataService::Instance().retrieve(partialWSName);
IAlgorithm_sptr gatherAlg = createChildAlgorithm("GatherWorkspaces");
auto gatherAlg = createChildAlgorithm("GatherWorkspaces");
gatherAlg->setLogging(true);
gatherAlg->setAlwaysStoreInADS(true);
gatherAlg->setProperty("InputWorkspace", partialWS);
......@@ -271,7 +271,7 @@ void GenericDataProcessorAlgorithm<Base>::saveNexus(const std::string &outputWSN
#else
if (!outputFile.empty()) {
#endif
IAlgorithm_sptr saveAlg = createChildAlgorithm("SaveNexus");
auto saveAlg = createChildAlgorithm("SaveNexus");
saveAlg->setPropertyValue("Filename", outputFile);
saveAlg->setPropertyValue("InputWorkspace", outputWSName);
saveAlg->execute();
......@@ -323,7 +323,7 @@ Workspace_sptr GenericDataProcessorAlgorithm<Base>::load(const std::string &inpu
Poco::Path p(foundFile);
const std::string outputWSName = p.getBaseName();
IAlgorithm_sptr loadAlg = createChildAlgorithm(m_loadAlg);
auto loadAlg = createChildAlgorithm(m_loadAlg);
loadAlg->setProperty(m_loadAlgFileProp, foundFile);
if (!loadQuiet) {
loadAlg->setAlwaysStoreInADS(true);
......
......@@ -261,7 +261,7 @@ IAlgorithm_sptr FrameworkManagerImpl::exec(const std::string &algorithmName, int
}
// Create the algorithm
IAlgorithm_sptr alg = AlgorithmManager::Instance().createUnmanaged(algorithmName, -1);
auto alg = AlgorithmManager::Instance().createUnmanaged(algorithmName, -1);
alg->initialize();
if (!alg->isInitialized())
throw std::runtime_error(algorithmName + " was not initialized.");
......
......@@ -36,7 +36,7 @@ namespace OperatorOverloads {
template <typename LHSType, typename RHSType, typename ResultType>
ResultType executeBinaryOperation(const std::string &algorithmName, const LHSType lhs, const RHSType rhs,
bool lhsAsOutput, bool child, const std::string &name, bool rethrow) {
IAlgorithm_sptr alg = AlgorithmManager::Instance().createUnmanaged(algorithmName);
auto alg = AlgorithmManager::Instance().createUnmanaged(algorithmName);
alg->setChild(child);
alg->setRethrows(rethrow);
alg->initialize();
......@@ -137,7 +137,7 @@ template MANTID_API_DLL IMDHistoWorkspace_sptr executeBinaryOperation(const std:
* @return bool, true if workspaces match
*/
bool equals(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs, double tolerance) {
IAlgorithm_sptr alg = AlgorithmManager::Instance().createUnmanaged("CompareWorkspaces");
auto alg = AlgorithmManager::Instance().createUnmanaged("CompareWorkspaces");
alg->setChild(true);
alg->setRethrows(false);
alg->initialize();
......
......@@ -73,7 +73,7 @@ public:
testInput->setPropertyValue("arg2_param", "5");
AlgorithmHistory history(testInput);
IAlgorithm_sptr compareAlg = history.createAlgorithm();
auto compareAlg = history.createAlgorithm();
TS_ASSERT_EQUALS(compareAlg->name(), testInput->name());
TS_ASSERT_EQUALS(compareAlg->version(), testInput->version());
TS_ASSERT_EQUALS(compareAlg->category(), testInput->category());
......@@ -127,7 +127,7 @@ public:
int i = 1;
AlgorithmHistories::iterator it;
for (it = children.begin(); it != children.end(); ++it, ++i) {
IAlgorithm_sptr childAlg = (*it)->createAlgorithm();
auto childAlg = (*it)->createAlgorithm();
std::string index = boost::lexical_cast<std::string>(i);
TS_ASSERT_EQUALS(childAlg->getPropertyValue("arg1_param"), "child" + index);
......@@ -136,7 +136,7 @@ public:
int j = 1;
AlgorithmHistories::iterator jt;
for (jt = subchildren.begin(); jt != subchildren.end(); ++j, ++jt) {
IAlgorithm_sptr subChildAlg = (*jt)->createAlgorithm();
auto subChildAlg = (*jt)->createAlgorithm();
std::string subindex = boost::lexical_cast<std::string>(j);
TS_ASSERT_EQUALS(subChildAlg->getPropertyValue("arg1_param"), "subChild" + index + subindex);
}
......@@ -168,7 +168,7 @@ public:
algHist.addChildHistory(std::make_shared<AlgorithmHistory>(child2));
algHist.addChildHistory(std::make_shared<AlgorithmHistory>(child3));
IAlgorithm_sptr alg = algHist.getChildAlgorithm(0);
auto alg = algHist.getChildAlgorithm(0);
TS_ASSERT_EQUALS(alg->name(), testInput->name());
TS_ASSERT_EQUALS(alg->version(), testInput->version());
TS_ASSERT_EQUALS(alg->category(), testInput->category());
......
......@@ -360,30 +360,30 @@ public:
}
void test_Construction_Via_Valid_String_With_No_Properties() {
IAlgorithm_sptr testAlg = runFromString(R"({"name":"ToyAlgorithm"})");
auto testAlg = runFromString(R"({"name":"ToyAlgorithm"})");
TS_ASSERT_EQUALS(testAlg->name(), "ToyAlgorithm");