Skip to content
Snippets Groups Projects
Commit 5335b6c8 authored by Christian Engwer's avatar Christian Engwer
Browse files

[parametertree] adhere to the naming scheme for member variables

parent 5414ab11
No related branches found
No related tags found
No related merge requests found
......@@ -25,15 +25,15 @@ ParameterTree::ParameterTree()
void ParameterTree::report(std::ostream& stream, const std::string& prefix) const
{
typedef std::map<std::string, std::string>::const_iterator ValueIt;
ValueIt vit = values.begin();
ValueIt vend = values.end();
ValueIt vit = values_.begin();
ValueIt vend = values_.end();
for(; vit!=vend; ++vit)
stream << vit->first << " = \"" << vit->second << "\"" << std::endl;
typedef std::map<std::string, ParameterTree>::const_iterator SubIt;
SubIt sit = subs.begin();
SubIt send = subs.end();
SubIt sit = subs_.begin();
SubIt send = subs_.end();
for(; sit!=send; ++sit)
{
stream << "[ " << prefix + sit->first << " ]" << std::endl;
......@@ -48,14 +48,14 @@ bool ParameterTree::hasKey(const std::string& key) const
if (dot != std::string::npos)
{
std::string prefix = key.substr(0,dot);
if (subs.count(prefix) == 0)
if (subs_.count(prefix) == 0)
return false;
const ParameterTree& s = sub(prefix);
return s.hasKey(key.substr(dot+1));
}
else
return (values.count(key) != 0);
return (values_.count(key) != 0);
}
bool ParameterTree::hasSub(const std::string& key) const
......@@ -65,14 +65,14 @@ bool ParameterTree::hasSub(const std::string& key) const
if (dot != std::string::npos)
{
std::string prefix = key.substr(0,dot);
if (subs.count(prefix) == 0)
if (subs_.count(prefix) == 0)
return false;
const ParameterTree& s = sub(prefix);
return s.hasSub(key.substr(dot+1));
}
else
return (subs.count(key) != 0);
return (subs_.count(key) != 0);
}
ParameterTree& ParameterTree::sub(const std::string& key)
......@@ -86,9 +86,9 @@ ParameterTree& ParameterTree::sub(const std::string& key)
}
else
{
if (subs.count(key) == 0)
subKeys.push_back(key.substr(0,dot));
return subs[key];
if (subs_.count(key) == 0)
subKeys_.push_back(key.substr(0,dot));
return subs_[key];
}
}
......@@ -117,8 +117,8 @@ std::string& ParameterTree::operator[] (const std::string& key)
{
if (not (hasSub(key.substr(0,dot))))
{
subs[key.substr(0,dot)];
subKeys.push_back(key.substr(0,dot));
subs_[key.substr(0,dot)];
subKeys_.push_back(key.substr(0,dot));
}
ParameterTree& s = sub(key.substr(0,dot));
return s[key.substr(dot+1)];
......@@ -126,8 +126,8 @@ std::string& ParameterTree::operator[] (const std::string& key)
else
{
if (not (hasKey(key)))
valueKeys.push_back(key);
return values[key];
valueKeys_.push_back(key);
return values_[key];
}
}
......@@ -144,7 +144,7 @@ const std::string& ParameterTree::operator[] (const std::string& key) const
{
if (not (hasKey(key)))
DUNE_THROW(Dune::RangeError, "Key '" << key << "' not found in ParameterTree");
return values.find(key)->second;
return values_.find(key)->second;
}
}
......@@ -200,10 +200,10 @@ std::vector<std::string> ParameterTree::split(const std::string & s) {
const ParameterTree::KeyVector& ParameterTree::getValueKeys() const
{
return valueKeys;
return valueKeys_;
}
const ParameterTree::KeyVector& ParameterTree::getSubKeys() const
{
return subKeys;
return subKeys_;
}
......@@ -202,11 +202,12 @@ namespace Dune {
const KeyVector& getSubKeys() const;
protected:
KeyVector valueKeys;
KeyVector subKeys;
KeyVector valueKeys_;
KeyVector subKeys_;
std::map<std::string, std::string> values_;
std::map<std::string, ParameterTree> subs_;
std::map<std::string, std::string> values;
std::map<std::string, ParameterTree> subs;
static std::string ltrim(const std::string& s);
static std::string rtrim(const std::string& s);
static std::vector<std::string> split(const std::string & s);
......
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