Unverified Commit 1f484b7f authored by Felix Schindler's avatar Felix Schindler Committed by GitHub

Merge pull request #203 from dune-community/update-parameters

[parameter] add extend_parameter_type() to ParametricInterface
parents cd86d219 f4cdc6af
......@@ -257,6 +257,16 @@ Parameter ParametricInterface::parse_parameter(const Parameter& mu) const
} // ... parse_parameter(...)
void ParametricInterface::extend_parameter_type(const ParameterType& additional_parameter_type)
{
try {
this->parameter_type_ = this->parameter_type() + additional_parameter_type;
} catch (Exceptions::parameter_error& ee) {
DUNE_THROW(Exceptions::parameter_error, "Error extending parameter type:\n " << ee.what());
}
} // ... extend_parameter_type(...)
} // namespace Common
} // namespace XT
} // namespace Dune
......@@ -31,6 +31,8 @@ template <class ValueType>
class SimpleDict
{
public:
using ThisType = SimpleDict<ValueType>;
SimpleDict() {}
SimpleDict(const std::string& key, const ValueType& value)
......@@ -46,6 +48,12 @@ public:
update_keys();
}
SimpleDict(const ThisType& other) = default;
SimpleDict(ThisType&& source) = default;
ThisType& operator=(const ThisType& other) = default;
ThisType& operator=(ThisType&& source) = default;
const std::vector<std::string>& keys() const
{
return keys_;
......@@ -178,6 +186,12 @@ private:
ParameterType(BaseType&& source);
public:
ParameterType(const ParameterType& other) = default;
ParameterType(ParameterType&& source) = default;
ParameterType& operator=(const ParameterType& other) = default;
ParameterType& operator=(ParameterType&& source) = default;
ParameterType operator+(const ParameterType& other) const;
/**
......@@ -229,9 +243,15 @@ private:
Parameter(BaseType&& source);
public:
Parameter(const Parameter& other) = default;
Parameter(Parameter&& source) = default;
/// \note this is somehow necessary to make clang 3.8 happy (and cannot be defaulted)
~Parameter() {}
Parameter& operator=(const Parameter& other) = default;
Parameter& operator=(Parameter&& source) = default;
Parameter operator+(const Parameter& other) const;
bool operator<(const Parameter& other) const;
......@@ -258,6 +278,9 @@ public:
Parameter parse_parameter(const Parameter& mu) const;
protected:
void extend_parameter_type(const ParameterType& additional_parameter_type);
private:
ParameterType parameter_type_;
}; // class ParametricInterface
......
Markdown is supported
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