OGS
BaseLib::ConfigTree::ParameterIterator Class Reference

Detailed Description

A wrapper around a Boost Iterator for iterating over ranges of parameters.

The methods of this class tell the associated (parent) ConfigTree object when a setting has been parsed.

Definition at line 166 of file ConfigTree.h.

#include <ConfigTree.h>

Inheritance diagram for BaseLib::ConfigTree::ParameterIterator:
[legend]
Collaboration diagram for BaseLib::ConfigTree::ParameterIterator:
[legend]

Public Member Functions

ConfigTree operator* ()
 
 SubtreeIterator (Iterator const &it, std::string const &root, ConfigTree const &parent)
 Inherit the constructor. More...
 
- Public Member Functions inherited from BaseLib::ConfigTree::SubtreeIterator
 SubtreeIterator (Iterator const &it, std::string const &root, ConfigTree const &parent)
 
SubtreeIteratoroperator++ ()
 
ConfigTree operator* ()
 
bool operator== (SubtreeIterator const &other) const
 
bool operator!= (SubtreeIterator const &other) const
 

Additional Inherited Members

- Public Types inherited from BaseLib::ConfigTree::SubtreeIterator
using Iterator = boost::property_tree::ptree::const_assoc_iterator
 
- Protected Attributes inherited from BaseLib::ConfigTree::SubtreeIterator
std::string const tagname_
 
ConfigTree const & parent_
 

Member Function Documentation

◆ operator*()

ConfigTree BaseLib::ConfigTree::ParameterIterator::operator* ( )
inline

Definition at line 172 of file ConfigTree.h.

173  {
174  auto st = SubtreeIterator::operator*();
175  if (st.hasChildren())
176  {
177  parent_.error("The requested parameter <" + tagname_ +
178  "> has child elements.");
179  }
180  return st;
181  }
void error(std::string const &message) const
Definition: ConfigTree.cpp:212

References BaseLib::ConfigTree::error(), BaseLib::ConfigTree::SubtreeIterator::operator*(), BaseLib::ConfigTree::SubtreeIterator::parent_, and BaseLib::ConfigTree::SubtreeIterator::tagname_.

◆ SubtreeIterator()

BaseLib::ConfigTree::SubtreeIterator::SubtreeIterator
inlineexplicit

Inherit the constructor.

Definition at line 116 of file ConfigTree.h.

118  : it_(it), tagname_(root), parent_(parent)
119  {
120  }

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