Skip to content
Snippets Groups Projects
Commit 2a2c3180 authored by Nick Draper's avatar Nick Draper
Browse files

apply clang format patch

re #13925
parent d55a0ef4
No related branches found
No related tags found
No related merge requests found
...@@ -223,14 +223,13 @@ void AlgorithmProxy::afterPropertySet(const std::string &name) { ...@@ -223,14 +223,13 @@ void AlgorithmProxy::afterPropertySet(const std::string &name) {
* Making sure that the concrete alg is kept in sync * Making sure that the concrete alg is kept in sync
* @param po :: The property manager to copy * @param po :: The property manager to copy
*/ */
void AlgorithmProxy::copyPropertiesFrom(const PropertyManagerOwner& po) void AlgorithmProxy::copyPropertiesFrom(const PropertyManagerOwner &po) {
{
PropertyManagerOwner::copyPropertiesFrom(po); PropertyManagerOwner::copyPropertiesFrom(po);
createConcreteAlg(true); createConcreteAlg(true);
m_alg->copyPropertiesFrom(*this); m_alg->copyPropertiesFrom(*this);
} }
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// Private methods // Private methods
//---------------------------------------------------------------------- //----------------------------------------------------------------------
......
...@@ -214,27 +214,27 @@ public: ...@@ -214,27 +214,27 @@ public:
} }
void test_copyPropertiesFrom() { void test_copyPropertiesFrom() {
IAlgorithm_sptr alg = IAlgorithm_sptr alg =
AlgorithmManager::Instance().create("ToyAlgorithmProxy"); AlgorithmManager::Instance().create("ToyAlgorithmProxy");
alg->initialize(); alg->initialize();
alg->setPropertyValue( "prop1", "string" ); alg->setPropertyValue("prop1", "string");
alg->setPropertyValue("prop2","1"); alg->setPropertyValue("prop2", "1");
IAlgorithm_sptr algCopy = IAlgorithm_sptr algCopy =
AlgorithmManager::Instance().create("ToyAlgorithmProxy"); AlgorithmManager::Instance().create("ToyAlgorithmProxy");
auto algProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(alg); auto algProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(alg);
auto algCopyProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(algCopy); auto algCopyProxy = boost::dynamic_pointer_cast<AlgorithmProxy>(algCopy);
algCopyProxy->copyPropertiesFrom(*algProxy); algCopyProxy->copyPropertiesFrom(*algProxy);
int val = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2")); int val = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2"));
TS_ASSERT_EQUALS(val,1); TS_ASSERT_EQUALS(val, 1);
//set another value and check the other value is unaffected // set another value and check the other value is unaffected
algCopy->setPropertyValue( "prop1", "A difference" ); algCopy->setPropertyValue("prop1", "A difference");
int val2 = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2")); int val2 = boost::lexical_cast<int>(algCopy->getPropertyValue("prop2"));
TS_ASSERT_EQUALS(val,val2); TS_ASSERT_EQUALS(val, val2);
} }
}; };
......
...@@ -65,7 +65,9 @@ public: ...@@ -65,7 +65,9 @@ public:
void setPropertyOrdinal(const int &index, const std::string &value); void setPropertyOrdinal(const int &index, const std::string &value);
/// Make m_properties point to the same PropertyManager as po. /// Make m_properties point to the same PropertyManager as po.
virtual void copyPropertiesFrom(const PropertyManagerOwner &po) { *this = po; } virtual void copyPropertiesFrom(const PropertyManagerOwner &po) {
*this = po;
}
bool existsProperty(const std::string &name) const; bool existsProperty(const std::string &name) const;
bool validateProperties() const; bool validateProperties() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment