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 175 of file ConfigTree.h.

#include <ConfigTree.h>

Inheritance diagram for BaseLib::ConfigTree::ParameterIterator:
Collaboration diagram for BaseLib::ConfigTree::ParameterIterator:

Public Member Functions

ConfigTree operator* ()
 SubtreeIterator (Iterator const &it, std::string const &root, ConfigTree const &parent)
 Inherit the constructor.
- 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_category = std::input_iterator_tag
using value_type = ConfigTree
using difference_type = std::ptrdiff_t
using pointer = ConfigTree*
using reference = ConfigTree&
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* ( )

Definition at line 181 of file ConfigTree.h.

182 {
183 auto st = SubtreeIterator::operator*();
184 if (st.hasChildren())
185 {
186 parent_.error("The requested parameter <" + tagname_ +
187 "> has child elements.");
188 }
189 return st;
190 }
void error(std::string const &message) const

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

◆ SubtreeIterator()

BaseLib::ConfigTree::SubtreeIterator::SubtreeIterator ( Iterator const & it,
std::string const & root,
ConfigTree const & parent )

Inherit the constructor.

Definition at line 125 of file ConfigTree.h.

127 : it_(it), tagname_(root), parent_(parent)
128 {
129 }

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