From 649e16a450c0c3506f9373ffd495730935061941 Mon Sep 17 00:00:00 2001 From: Timo Koch <timo.koch@iws.uni-stuttgart.de> Date: Fri, 13 Jul 2018 10:40:56 +0200 Subject: [PATCH] [params] Introduce hasParam, deprecate haveParam --- dumux/common/parameters.hh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/dumux/common/parameters.hh b/dumux/common/parameters.hh index 7b31472aae..8ac9c24e75 100644 --- a/dumux/common/parameters.hh +++ b/dumux/common/parameters.hh @@ -260,7 +260,10 @@ private: } }; -// a free function to set model- or problem-specific default parameters +/*! + * \ingroup Common + * \brief a free function to set model- or problem-specific default parameters + */ void setParam(Dune::ParameterTree& params, const std::string& group, const std::string& key, @@ -300,7 +303,7 @@ T getParamFromGroup(Args&&... args) * \ingroup Common * \brief Check whether a key exists in the parameter tree */ -bool haveParam(const std::string& param) +bool hasParam(const std::string& param) { const auto& p = Parameters::getTree(); return p.hasKey(param); @@ -311,7 +314,7 @@ bool haveParam(const std::string& param) * \brief Check whether a key exists in the parameter tree with a model group prefix */ template<typename... Args> -bool haveParamInGroup(const std::string& paramGroup, const std::string& param) +bool hasParamInGroup(const std::string& paramGroup, const std::string& param) { const auto& p = Parameters::getTree(); if (paramGroup == "") @@ -320,6 +323,15 @@ bool haveParamInGroup(const std::string& paramGroup, const std::string& param) return p.hasKey(paramGroup + "." + param); } +DUNE_DEPRECATED_MSG("haveParam is deprecated, please use hasParam instead.") +bool haveParam(const std::string& param) +{ return hasParam(param); } + +template<typename... Args> +DUNE_DEPRECATED_MSG("haveParamInGroup is deprecated, please use hasParamInGroup instead.") +bool haveParamInGroup(const std::string& paramGroup, const std::string& param) +{ return hasParamInGroup(paramGroup, param); } + } // namespace Dumux #endif -- GitLab