diff --git a/opm/core/utility/parameters/Parameter.cpp b/opm/core/utility/parameters/Parameter.cpp index c91063cc7..3b92fb56a 100644 --- a/opm/core/utility/parameters/Parameter.cpp +++ b/opm/core/utility/parameters/Parameter.cpp @@ -40,7 +40,6 @@ #include namespace Opm { - namespace parameter { std::string correct_parameter_tag(const ParameterMapItem& item) { @@ -70,5 +69,4 @@ namespace Opm { return ""; } } - } // namespace parameter } // namespace Opm diff --git a/opm/core/utility/parameters/Parameter.hpp b/opm/core/utility/parameters/Parameter.hpp index c2546cf6b..b65028484 100644 --- a/opm/core/utility/parameters/Parameter.hpp +++ b/opm/core/utility/parameters/Parameter.hpp @@ -43,8 +43,6 @@ #include namespace Opm { - /// See ParameterGroup.hpp for how to use the parameter system - namespace parameter { /// @brief /// @todo Doc me! class Parameter : public ParameterMapItem { @@ -213,6 +211,5 @@ namespace Opm { } static std::string type() {return ID_param_type__string;} }; - } // namespace parameter } // namespace Opm #endif // OPM_PARAMETER_HPP diff --git a/opm/core/utility/parameters/ParameterGroup.cpp b/opm/core/utility/parameters/ParameterGroup.cpp index 1f0f59e31..935689aaa 100644 --- a/opm/core/utility/parameters/ParameterGroup.cpp +++ b/opm/core/utility/parameters/ParameterGroup.cpp @@ -49,8 +49,6 @@ #include namespace Opm { - namespace parameter { - ParameterGroup::ParameterGroup() : path_(ID_path_root), parent_(0), output_is_enabled_(true) { @@ -69,7 +67,7 @@ namespace Opm { bool ParameterGroup::has(const std::string& name) const { - std::pair name_path = split(name); + std::pair name_path = splitParam(name); map_type::const_iterator it = map_.find(name_path.first); if (it == map_.end()) { return false; @@ -170,7 +168,7 @@ namespace Opm { void ParameterGroup::insert(const std::string& name, const std::shared_ptr& data) { - std::pair name_path = split(name); + std::pair name_path = splitParam(name); map_type::const_iterator it = map_.find(name_path.first); assert(name_path.second == ""); if (it == map_.end()) { @@ -202,9 +200,9 @@ namespace Opm { void ParameterGroup::insertParameter(const std::string& name, const std::string& value) { - std::pair name_path = split(name); + std::pair name_path = splitParam(name); while (name_path.first == "") { - name_path = split(name_path.second); + name_path = splitParam(name_path.second); } map_type::const_iterator it = map_.find(name_path.first); if (it == map_.end()) { @@ -330,5 +328,4 @@ namespace Opm { return unhandled_arguments_; } - } // namespace parameter } // namespace Opm diff --git a/opm/core/utility/parameters/ParameterGroup.hpp b/opm/core/utility/parameters/ParameterGroup.hpp index f9d3c557a..e550bbf8b 100644 --- a/opm/core/utility/parameters/ParameterGroup.hpp +++ b/opm/core/utility/parameters/ParameterGroup.hpp @@ -45,7 +45,6 @@ #include namespace Opm { - namespace parameter { /// ParameterGroup is a class that is used to provide run-time parameters. /// The standard use of the class is to call create it with the /// (int argc, char** argv) constructor (where the arguments are those @@ -266,7 +265,6 @@ namespace Opm { static std::pair filename_split(const std::string& filename); }; - } // namespace parameter } // namespace Opm #include diff --git a/opm/core/utility/parameters/ParameterGroup_impl.hpp b/opm/core/utility/parameters/ParameterGroup_impl.hpp index 3400221b2..bcb5e42cc 100644 --- a/opm/core/utility/parameters/ParameterGroup_impl.hpp +++ b/opm/core/utility/parameters/ParameterGroup_impl.hpp @@ -48,8 +48,6 @@ #include namespace Opm { - namespace parameter { - template<> struct ParameterMapItemTrait { static ParameterGroup @@ -179,7 +177,7 @@ namespace Opm { const Requirement& r) const { setUsed(); - std::pair name_path = split(name); + std::pair name_path = splitParam(name); map_type::const_iterator it = map_.find(name_path.first); if (it == map_.end()) { if (parent_ != 0) { @@ -225,7 +223,7 @@ namespace Opm { const Requirement& r) const { setUsed(); - std::pair name_path = split(name); + std::pair name_path = splitParam(name); map_type::const_iterator it = map_.find(name_path.first); if (it == map_.end()) { if (parent_ != 0) { @@ -308,7 +306,6 @@ namespace Opm { } return value; } - } // namespace parameter } // namespace Opm #endif // OPM_PARAMETERGROUP_IMPL_HEADER diff --git a/opm/core/utility/parameters/ParameterMapItem.hpp b/opm/core/utility/parameters/ParameterMapItem.hpp index 662178981..3bce38d0a 100644 --- a/opm/core/utility/parameters/ParameterMapItem.hpp +++ b/opm/core/utility/parameters/ParameterMapItem.hpp @@ -39,7 +39,6 @@ #include namespace Opm { - namespace parameter { /// The parameter handlig system is structured as a tree, /// where each node inhertis from ParameterMapItem. /// @@ -67,7 +66,6 @@ namespace Opm { std::string& conversion_error); static std::string type(); }; - } // namespace parameter } // namespace Opm #endif // OPM_PARAMETERMAPITEM_HEADER diff --git a/opm/core/utility/parameters/ParameterRequirement.hpp b/opm/core/utility/parameters/ParameterRequirement.hpp index c9b19f725..95e156ce3 100644 --- a/opm/core/utility/parameters/ParameterRequirement.hpp +++ b/opm/core/utility/parameters/ParameterRequirement.hpp @@ -43,7 +43,6 @@ #include namespace Opm { - namespace parameter { /// @brief /// @todo Doc me! /// @tparam @@ -237,7 +236,6 @@ namespace Opm { private: const std::vector elements_; }; - } // namespace parameter } // namespace Opm #endif // OPM_PARAMETERREQUIREMENT_HEADER diff --git a/opm/core/utility/parameters/ParameterStrings.hpp b/opm/core/utility/parameters/ParameterStrings.hpp index 1441fdcf7..fcf2fa262 100644 --- a/opm/core/utility/parameters/ParameterStrings.hpp +++ b/opm/core/utility/parameters/ParameterStrings.hpp @@ -39,7 +39,6 @@ #include namespace Opm { - namespace parameter { const std::string ID_true = "true"; const std::string ID_false = "false"; @@ -59,7 +58,6 @@ namespace Opm { const std::string ID_delimiter_path = "/"; const std::string ID_comment = "//"; const std::string ID_delimiter_assignment = "="; - } // namespace parameter } // namespace Opm #endif // OPM_PARAMETERSTRINGS_HEADER diff --git a/opm/core/utility/parameters/ParameterTools.cpp b/opm/core/utility/parameters/ParameterTools.cpp index 043fad2be..d88d64ab9 100644 --- a/opm/core/utility/parameters/ParameterTools.cpp +++ b/opm/core/utility/parameters/ParameterTools.cpp @@ -40,8 +40,7 @@ #include namespace Opm { - namespace parameter { - std::pair split(const std::string& name) + std::pair splitParam(const std::string& name) { int pos = name.find(ID_delimiter_path); if (pos == int(std::string::npos)) { @@ -51,5 +50,4 @@ namespace Opm { name.substr(pos + ID_delimiter_path.size())); } } - } // namespace parameter } // namespace Opm diff --git a/opm/core/utility/parameters/ParameterTools.hpp b/opm/core/utility/parameters/ParameterTools.hpp index d1e787704..ead5cbc12 100644 --- a/opm/core/utility/parameters/ParameterTools.hpp +++ b/opm/core/utility/parameters/ParameterTools.hpp @@ -40,9 +40,7 @@ #include namespace Opm { - namespace parameter { - std::pair split(const std::string& name); - } // namespace parameter + std::pair splitParam(const std::string& name); } // namespace Opm #endif // OPM_PARAMETERTOOLS_HEADER diff --git a/tests/test_param.cpp b/tests/test_param.cpp index f219a85d0..9f83a7863 100644 --- a/tests/test_param.cpp +++ b/tests/test_param.cpp @@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE(commandline_syntax_init) "/group/item=overridingstring", 0 }; const std::size_t argc = argv.size() - 1; - parameter::ParameterGroup p(argc, argv.data()); + ParameterGroup p(argc, argv.data()); BOOST_CHECK(p.get("topitem") == "somestring"); std::ostringstream os; p.writeParamToStream(os); @@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(xml_syntax_init) "unhandledargument", 0}; const std::size_t argc = argv.size() - 1; - parameter::ParameterGroup p(argc, argv.data(), false); + ParameterGroup p(argc, argv.data(), false); BOOST_CHECK(p.get("topitem") == "somestring"); std::ostringstream os; p.writeParamToStream(os); @@ -120,5 +120,5 @@ BOOST_AUTO_TEST_CASE(failing_strict_xml_syntax_init) "unhandledargument", 0 }; const std::size_t argc = argv.size() - 1; - BOOST_CHECK_THROW(parameter::ParameterGroup p(argc, argv.data()), std::runtime_error); + BOOST_CHECK_THROW(ParameterGroup p(argc, argv.data()), std::runtime_error); }