www.mooseframework.org
Public Member Functions | Public Attributes | Private Attributes | List of all members
DupParamWalker Class Reference
Inheritance diagram for DupParamWalker:
[legend]

Public Member Functions

 DupParamWalker (std::string fname)
 
void walk (const std::string &fullpath, const std::string &, hit::Node *n) override
 

Public Attributes

std::vector< std::string > errors
 

Private Attributes

std::string _fname
 
std::set< std::string > _duplicates
 
std::map< std::string, hit::Node * > _have
 

Detailed Description

Definition at line 108 of file Parser.C.

Constructor & Destructor Documentation

DupParamWalker::DupParamWalker ( std::string  fname)
inline

Definition at line 111 of file Parser.C.

111 : _fname(fname) {}
std::string _fname
Definition: Parser.C:133

Member Function Documentation

void DupParamWalker::walk ( const std::string &  fullpath,
const std::string &  ,
hit::Node *  n 
)
inlineoverride

Definition at line 112 of file Parser.C.

113  {
114  std::string prefix = n->type() == hit::NodeType::Field ? "parameter" : "section";
115 
116  if (_have.count(fullpath) > 0)
117  {
118  auto existing = _have[fullpath];
119  if (_duplicates.count(fullpath) == 0)
120  {
121  errors.push_back(
122  errormsg(_fname, existing, prefix, " '", fullpath, "' supplied multiple times"));
123  _duplicates.insert(fullpath);
124  }
125  errors.push_back(errormsg(_fname, n, prefix, " '", fullpath, "' supplied multiple times"));
126  }
127  _have[n->fullpath()] = n;
128  }
std::set< std::string > _duplicates
Definition: Parser.C:134
std::string _fname
Definition: Parser.C:133
std::map< std::string, hit::Node * > _have
Definition: Parser.C:135
PetscInt n
std::string errormsg(std::string, hit::Node *)
Definition: Parser.h:39
std::vector< std::string > errors
Definition: Parser.C:130

Member Data Documentation

std::set<std::string> DupParamWalker::_duplicates
private

Definition at line 134 of file Parser.C.

std::string DupParamWalker::_fname
private

Definition at line 133 of file Parser.C.

std::map<std::string, hit::Node *> DupParamWalker::_have
private

Definition at line 135 of file Parser.C.

std::vector<std::string> DupParamWalker::errors

Definition at line 130 of file Parser.C.

Referenced by Parser::parse().


The documentation for this class was generated from the following file: