Commit 726c813b authored by Roman Tolchenov's avatar Roman Tolchenov
Browse files

Re #19909. Fix clang format.

parent 47f69465
......@@ -67,7 +67,8 @@ public:
/// Returns the function's name
std::string name() const override { return "CompositeFunction"; }
/// Writes itself into a string
std::string asString(const std::string &parentLocalAttributesStr = "") const override;
std::string
asString(const std::string &parentLocalAttributesStr = "") const override;
/// Sets the workspace for each member function
void setWorkspace(boost::shared_ptr<const Workspace> ws) override;
/// Set matrix workspace
......
......@@ -324,7 +324,8 @@ public:
/// Returns the function's name
virtual std::string name() const = 0;
/// Writes itself into a string
virtual std::string asString(const std::string &localAttributesStr = "") const;
virtual std::string
asString(const std::string &localAttributesStr = "") const;
/// Virtual copy constructor
virtual boost::shared_ptr<IFunction> clone() const;
/// Set the workspace.
......
......@@ -46,7 +46,8 @@ public:
/// Returns the function's name
std::string name() const override { return "ImmutableCompositeFunction"; }
/// Writes itself into a string
std::string asString(const std::string &parentLocalAttributesStr = "") const override;
std::string
asString(const std::string &parentLocalAttributesStr = "") const override;
/// Set i-th parameter
void setParameter(size_t i, const double &value,
bool explicitlySet = true) override {
......
......@@ -46,11 +46,13 @@ void CompositeFunction::init() {}
* // write NewFunction's own ties and constraints
* // ostr << ";constraints=(" << ... <<")";
* }
* @param parentLocalAttributesStr :: A preformatted string with parent's local attributes.
* @param parentLocalAttributesStr :: A preformatted string with parent's local
* attributes.
* Can be passed in by a CompositeFunction (eg MultiDomainFunction).
* @return the string representation of the composite function
*/
std::string CompositeFunction::asString(const std::string &parentLocalAttributesStr) const {
std::string
CompositeFunction::asString(const std::string &parentLocalAttributesStr) const {
std::ostringstream ostr;
// if empty just return function name
......@@ -83,7 +85,8 @@ std::string CompositeFunction::asString(const std::string &parentLocalAttributes
this->getLocalAttribute(i, localAttName).value();
if (!localAttValue.empty()) {
// local attribute names are prefixed by dollar sign
localAttributesStr << ',' << '$' << localAttName << '=' << localAttValue;
localAttributesStr << ',' << '$' << localAttName << '='
<< localAttValue;
}
}
ostr << fun->asString(localAttributesStr.str());
......
......@@ -16,7 +16,8 @@ using std::size_t;
* Overridden method creates an initialization string which makes it look like a
* siple function.
*/
std::string ImmutableCompositeFunction::asString(const std::string &parentLocalAttributesStr) const {
std::string ImmutableCompositeFunction::asString(
const std::string &parentLocalAttributesStr) const {
return IFunction::asString(parentLocalAttributesStr);
}
......
......@@ -478,8 +478,8 @@ public:
"name=MultiDomainFunctionTest_Function; "
"(name=MultiDomainFunctionTest_Function;name="
"MultiDomainFunctionTest_Function))";
auto f = FunctionFactory::Instance().createInitialized(ini);
auto g = FunctionFactory::Instance().createInitialized(f->asString());
auto f = FunctionFactory::Instance().createInitialized(ini);
auto g = FunctionFactory::Instance().createInitialized(f->asString());
TS_ASSERT_EQUALS(g->asString(),
"composite=MultiDomainFunction,NumDeriv=false;(composite="
"CompositeFunction,NumDeriv=false,$domains=i;name="
......
......@@ -36,7 +36,8 @@ public:
std::string name() const override { return "CrystalFieldSpectrum"; }
const std::string category() const override { return "General"; }
void buildTargetFunction() const override;
std::string asString(const std::string &parentLocalAttributesStr = "") const override;
std::string
asString(const std::string &parentLocalAttributesStr = "") const override;
protected:
void updateTargetFunction() const override;
......
......@@ -97,7 +97,8 @@ void CrystalFieldSpectrum::updateTargetFunction() const {
}
/// Custom string conversion method
std::string CrystalFieldSpectrum::asString(const std::string &parentLocalAttributesStr) const {
std::string CrystalFieldSpectrum::asString(
const std::string &parentLocalAttributesStr) const {
std::ostringstream ostr;
ostr << "name=" << this->name();
// Print the attributes
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment