OGS 6.2.1-499-g3b941532c.dirty.20191012113459
BaseLib::ConfigTree Class Referencefinal

Detailed Description

Wrapper around a Boost Property Tree with some basic error reporting features.

Features. This class:

  • makes sure that every configuration setting in a Property Tree is read exactly once. If some settings is not read (e.g. due to a typo), a warning message is generated. The message contains a hint where it occured.
  • enforces a naming scheme of settings: letters a-z, numbers 0-9, underscore
  • provides some functionality to read lists of values using range-based for loops.
  • has rather long method names that are easily greppable from the source code. So a list of supported configuration options can be easily obtained from the source code.

The purpose of this class is to reduce or completely avoid the amount of error-handling code in routines that take configuration parameters.

Most methods of this class check that they have not been called before for the same ConfigTree and the same parameter. This behaviour helps to enforce that every parameter is read exactly once during parsing of the configuration settings.

The most notable restriction of this class when compared to plain tree traversal is, that one must know all the XML tags (i.e. configuration parameters) at compile time. It is not possible to read from this class, which configuration parameters are present in the tree. This restriction, however, is intended, because it provides the possibility to get all existing configuration parameters from the source code.

This class maintains a read counter for each parameter accessed through any of its methods. Read counters are increased with every read (the only exception being the peekConfigParameter() method). The destructor finally decreases the read counter for every tag/attribute it find on the current level of the XML tree. If the increases/decreases don't cancel each other, warning messages are generated. This check can also be enforced before destruction by using the BaseLib::checkAndInvalidate() functions.

The design of this class entails some limitations compared to traversing a plain tree, e.g., it is not possible to obtain a list of tags or attributes from the tree, but one has to explicitly query the specific tags/attributes one is interested in. That way it is possible to get all used configuration parameters directly from the source code where this class is used, and to maintain the quality of the configuration parameter documentation.

Instances of this class only keep a reference to the underlying boost::property_tree. Therefore it is necessary that the underlying property tree stays intact as long as any instance—i.e. the top level ConfigTree and any of its children—reference it. In order to simplify the handling of this dependence, the class ConfigTreeTopLevel can be used.

The construction of a ConfigTree from the content of an XML file can be done with the function BaseLib::makeConfigTree(), which performs many error checks. For limitations of the used XML parser, please have a look at that function's documentation.

Definition at line 95 of file ConfigTree.h.

#include <ConfigTree.h>

Classes

struct  CountType
 
class  ParameterIterator
 
class  SubtreeIterator
 
class  ValueIterator
 

Public Types

using PTree = boost::property_tree::ptree
 The tree being wrapped by this class. More...
 
using Callback = std::function< void(const std::string &filename, const std::string &path, const std::string &message)>
 

Public Member Functions

 ConfigTree (PTree const &tree, std::string filename, Callback error_cb, Callback warning_cb)
 
 ConfigTree (PTree &&, std::string const &, Callback const &, Callback const &)=delete
 
 ConfigTree (ConfigTree const &)=delete
 copying is not compatible with the semantics of this class More...
 
 ConfigTree (ConfigTree &&other)
 
ConfigTreeoperator= (ConfigTree const &)=delete
 copying is not compatible with the semantics of this class More...
 
ConfigTreeoperator= (ConfigTree &&other)
 
std::string const & getProjectFileName () const
 Used to get the project file name. More...
 
 ~ConfigTree ()
 
Methods for directly accessing parameter values
template<typename T >
getConfigParameter (std::string const &param) const
 
template<typename T >
getConfigParameter (std::string const &param, T const &default_value) const
 
template<typename T >
boost::optional< T > getConfigParameterOptional (std::string const &param) const
 
template<typename T >
Range< ValueIterator< T > > getConfigParameterList (std::string const &param) const
 
Methods for accessing parameters that have attributes

The getConfigParameter...() methods in this group—note: they do not have template parameters—check that the queried parameters do not have any children (apart from XML attributes); if they do, error() is called.

The support for parameters with attributes is limited in the sense that it is not possible to peek/check them. However, such functionality can easily be added on demand.

ConfigTree getConfigParameter (std::string const &root) const
 
boost::optional< ConfigTreegetConfigParameterOptional (std::string const &root) const
 
Range< ParameterIteratorgetConfigParameterList (std::string const &param) const
 
template<typename T >
getValue () const
 
template<typename T >
getConfigAttribute (std::string const &attr) const
 
template<typename T >
getConfigAttribute (std::string const &attr, T const &default_value) const
 
template<typename T >
boost::optional< T > getConfigAttributeOptional (std::string const &attr) const
 
Methods for peeking and checking parameters

To be used in builder/factory functions: E.g., one can peek a parameter denoting the type of an object to generate in the builder, and check the type parameter in the constructor of the generated object.

template<typename T >
peekConfigParameter (std::string const &param) const
 
template<typename T >
void checkConfigParameter (std::string const &param, T const &value) const
 
template<typename Ch >
void checkConfigParameter (std::string const &param, Ch const *value) const
 Make checkConfigParameter() work for string literals. More...
 
Methods for accessing subtrees
ConfigTree getConfigSubtree (std::string const &root) const
 
boost::optional< ConfigTreegetConfigSubtreeOptional (std::string const &root) const
 
Range< SubtreeIteratorgetConfigSubtreeList (std::string const &root) const
 
Methods for ignoring parameters
void ignoreConfigParameter (std::string const &param) const
 
void ignoreConfigParameterAll (std::string const &param) const
 
void ignoreConfigAttribute (std::string const &attr) const
 

Static Public Member Functions

static void onerror (std::string const &filename, std::string const &path, std::string const &message)
 
static void onwarning (std::string const &filename, std::string const &path, std::string const &message)
 
static void assertNoSwallowedErrors ()
 Asserts that there have not been any errors reported in the destructor. More...
 

Private Types

enum  Attr : bool { Attr::TAG = false, Attr::ATTR = true }
 Used to indicate if dealing with XML tags or XML attributes. More...
 
using KeyType = std::pair< Attr, std::string >
 A pair (is attribute, tag/attribute name). More...
 

Private Member Functions

template<typename T >
boost::optional< T > getConfigParameterOptionalImpl (std::string const &param, T *) const
 Default implementation of reading a value of type T. More...
 
template<typename T >
boost::optional< std::vector< T > > getConfigParameterOptionalImpl (std::string const &param, std::vector< T > *) const
 Implementation of reading a vector of values of type T. More...
 
 ConfigTree (PTree const &tree, ConfigTree const &parent, std::string const &root)
 Used for wrapping a subtree. More...
 
void error (std::string const &message) const
 
void warning (std::string const &message) const
 
void checkKeyname (std::string const &key) const
 Checks if key complies with the rules [a-z0-9_]. More...
 
std::string joinPaths (std::string const &p1, std::string const &p2) const
 Used to generate the path of a subtree. More...
 
void checkUnique (std::string const &key) const
 Asserts that the key has not been read yet. More...
 
void checkUniqueAttr (std::string const &attr) const
 Asserts that the attribute attr has not been read yet. More...
 
template<typename T >
CountTypemarkVisited (std::string const &key, Attr const is_attr, bool peek_only) const
 
CountTypemarkVisited (std::string const &key, Attr const is_attr, bool const peek_only) const
 
void markVisitedDecrement (Attr const is_attr, std::string const &key) const
 
bool hasChildren () const
 Checks if this tree has any children. More...
 
void checkAndInvalidate ()
 

Static Private Member Functions

static std::string shortString (std::string const &s)
 returns a short string at suitable for error/warning messages More...
 

Private Attributes

boost::property_tree::ptree const * _tree
 The wrapped tree. More...
 
std::string _path
 A path printed in error/warning messages. More...
 
std::string _filename
 The path of the file from which this tree has been read. More...
 
std::map< KeyType, CountType_visited_params
 
bool _have_read_data = false
 Indicates if the plain data contained in this tree has already been read. More...
 
Callback _onerror
 Custom error callback. More...
 
Callback _onwarning
 Custom warning callback. More...
 

Static Private Attributes

static const char pathseparator = '/'
 Character separating two path components. More...
 
static const std::string key_chars_start = "abcdefghijklmnopqrstuvwxyz"
 Set of allowed characters as the first letter of a key name. More...
 
static const std::string key_chars = key_chars_start + "_0123456789"
 Set of allowed characters in a key name. More...
 

Friends

void checkAndInvalidate (ConfigTree *const conf)
 
void checkAndInvalidate (ConfigTree &conf)
 
void checkAndInvalidate (std::unique_ptr< ConfigTree > const &conf)
 

Member Typedef Documentation

◆ Callback

using BaseLib::ConfigTree::Callback = std::function<void(const std::string& filename, const std::string& path, const std::string& message)>

Type of the function objects used as callbacks.

Arguments of the callback:

  • filename the file being from which this ConfigTree has been read.
  • path the path in the tree where the message was generated.
  • message the message to be printed.

Definition at line 231 of file ConfigTree.h.

◆ KeyType

using BaseLib::ConfigTree::KeyType = std::pair<Attr, std::string>
private

A pair (is attribute, tag/attribute name).

Definition at line 614 of file ConfigTree.h.

◆ PTree

using BaseLib::ConfigTree::PTree = boost::property_tree::ptree

The tree being wrapped by this class.

Definition at line 220 of file ConfigTree.h.

Member Enumeration Documentation

◆ Attr

enum BaseLib::ConfigTree::Attr : bool
strongprivate

Used to indicate if dealing with XML tags or XML attributes.

Enumerator
TAG 
ATTR 

Definition at line 538 of file ConfigTree.h.

538  : bool
539  {
540  TAG = false, ATTR = true
541  };

Constructor & Destructor Documentation

◆ ConfigTree() [1/5]

BaseLib::ConfigTree::ConfigTree ( PTree const &  tree,
std::string  filename,
Callback  error_cb,
Callback  warning_cb 
)
explicit

Creates a new instance wrapping the given Boost Property Tree.

Parameters
treethe Boost Property Tree to be wrapped
filenamethe file from which the tree has been read
error_cbcallback function to be called on error.
warning_cbcallback function to be called on warning.

The callback functions must be valid callable functions, i.e. not nullptr's. They are configurable in order to make unit tests of this class easier. They should not be provided in production code!

Defaults are strict: By default, both callbacks are set to the same function, i.e., warnings will also result in program abortion!

Definition at line 35 of file ConfigTree.cpp.

References _onerror, _onwarning, and OGS_FATAL.

Referenced by ConfigTree(), getConfigSubtreeOptional(), BaseLib::ConfigTree::SubtreeIterator::operator*(), and BaseLib::ConfigTree::ValueIterator< ValueType >::operator*().

39  : _tree(&tree),
40  _filename(std::move(filename)),
41  _onerror(std::move(error_cb)),
42  _onwarning(std::move(warning_cb))
43 {
44  if (!_onerror) {
45  OGS_FATAL("ConfigTree: No valid error handler provided.");
46  }
47  if (!_onwarning) {
48  OGS_FATAL("ConfigTree: No valid warning handler provided.");
49  }
50 }
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
std::string _filename
The path of the file from which this tree has been read.
Definition: ConfigTree.h:611
Callback _onerror
Custom error callback.
Definition: ConfigTree.h:628
Callback _onwarning
Custom warning callback.
Definition: ConfigTree.h:629
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ ConfigTree() [2/5]

BaseLib::ConfigTree::ConfigTree ( PTree &&  ,
std::string const &  ,
Callback const &  ,
Callback const &   
)
explicitdelete

This constructor is deleted in order to prevent the user from passing temporary instances of PTree. Doing so would lead to a dangling reference _tree and to program crash.

◆ ConfigTree() [3/5]

BaseLib::ConfigTree::ConfigTree ( ConfigTree const &  )
delete

copying is not compatible with the semantics of this class

◆ ConfigTree() [4/5]

BaseLib::ConfigTree::ConfigTree ( ConfigTree &&  other)

After being moved from, other is in an undefined state and must not be used anymore!

Definition at line 63 of file ConfigTree.cpp.

64  : _tree (other._tree)
65  , _path (std::move(other._path))
66  , _filename (std::move(other._filename))
67  , _visited_params(std::move(other._visited_params))
68  , _have_read_data (other._have_read_data)
69  , _onerror (std::move(other._onerror))
70  , _onwarning (std::move(other._onwarning))
71 {
72  other._tree = nullptr;
73 }
std::string _path
A path printed in error/warning messages.
Definition: ConfigTree.h:608
bool _have_read_data
Indicates if the plain data contained in this tree has already been read.
Definition: ConfigTree.h:626
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623
std::string _filename
The path of the file from which this tree has been read.
Definition: ConfigTree.h:611
Callback _onerror
Custom error callback.
Definition: ConfigTree.h:628
Callback _onwarning
Custom warning callback.
Definition: ConfigTree.h:629

◆ ~ConfigTree()

BaseLib::ConfigTree::~ConfigTree ( )

The destructor performs the check if all nodes at the current level of the tree have been read. Errors raised by the check are swallowed. Use assertNoSwallowedErrors() manually to check for those.

Definition at line 75 of file ConfigTree.cpp.

References checkAndInvalidate(), configtree_destructor_error_messages, and operator=().

Referenced by getProjectFileName().

76 {
77  if (std::uncaught_exceptions() > 0)
78  {
79  /* If the stack unwinds the check below shall be suppressed in order to
80  * not accumulate false-positive configuration errors.
81  */
82  return;
83  }
84 
85  try {
87  } catch (std::exception& e) {
88  ERR("%s", e.what());
89  configtree_destructor_error_messages.push_front(e.what());
90  }
91 }
static std::forward_list< std::string > configtree_destructor_error_messages
Definition: ConfigTree.cpp:26

◆ ConfigTree() [5/5]

BaseLib::ConfigTree::ConfigTree ( PTree const &  tree,
ConfigTree const &  parent,
std::string const &  root 
)
explicitprivate

Used for wrapping a subtree.

Definition at line 53 of file ConfigTree.cpp.

References checkKeyname(), and ConfigTree().

55  : _tree(&tree), _path(joinPaths(parent._path, root)),
56  _filename(parent._filename),
57  _onerror(parent._onerror), _onwarning(parent._onwarning)
58 {
59  checkKeyname(root);
60 }
std::string _path
A path printed in error/warning messages.
Definition: ConfigTree.h:608
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
std::string _filename
The path of the file from which this tree has been read.
Definition: ConfigTree.h:611
void checkKeyname(std::string const &key) const
Checks if key complies with the rules [a-z0-9_].
Definition: ConfigTree.cpp:276
Callback _onerror
Custom error callback.
Definition: ConfigTree.h:628
Callback _onwarning
Custom warning callback.
Definition: ConfigTree.h:629
std::string joinPaths(std::string const &p1, std::string const &p2) const
Used to generate the path of a subtree.
Definition: ConfigTree.cpp:294

Member Function Documentation

◆ assertNoSwallowedErrors()

void BaseLib::ConfigTree::assertNoSwallowedErrors ( )
static

Asserts that there have not been any errors reported in the destructor.

Definition at line 246 of file ConfigTree.cpp.

References configtree_destructor_error_messages, and OGS_FATAL.

Referenced by getProjectFileName(), and main().

247 {
249  {
250  return;
251  }
252 
253  ERR("ConfigTree: There have been errors when parsing the configuration "
254  "file(s):");
255 
256  for (auto const& msg : configtree_destructor_error_messages) {
257  ERR("%s", msg.c_str());
258  }
259 
260  OGS_FATAL("There have been errors when parsing the configuration file(s).");
261 }
static std::forward_list< std::string > configtree_destructor_error_messages
Definition: ConfigTree.cpp:26
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ checkAndInvalidate()

void BaseLib::ConfigTree::checkAndInvalidate ( )
private

Checks if the top level of this tree has been read entirely (and not too often).

Postcondition
This method also invalidates the instance, i.e., afterwards it must not be used anymore!

Definition at line 387 of file ConfigTree.cpp.

References _have_read_data, _tree, _visited_params, ATTR, markVisitedDecrement(), shortString(), TAG, and warning().

Referenced by BaseLib::checkAndInvalidate(), operator=(), and ~ConfigTree().

388 {
389  if (!_tree)
390  {
391  return;
392  }
393 
394  // Note: due to a limitation in boost::property_tree it is not possible
395  // to discriminate between <tag></tag> and <tag/> in the input file.
396  // In both cases data() will be empty.
397  if ((!_have_read_data) && !_tree->data().empty()) {
398  warning("The immediate data `" + shortString(_tree->data())
399  +"' of this tag has not been read.");
400  }
401 
402  // iterate over children
403  for (auto const& p : *_tree) {
404  if (p.first != "<xmlattr>")
405  { // attributes are handled below
407  }
408  }
409 
410  // iterate over attributes
411  if (auto attrs = _tree->get_child_optional("<xmlattr>")) {
412  for (auto const& p : *attrs) {
414  }
415  }
416 
417  for (auto const& p : _visited_params)
418  {
419  auto const& tag = p.first.second;
420  auto const& count = p.second.count;
421 
422  switch (p.first.first) {
423  case Attr::ATTR:
424  if (count > 0) {
425  warning("XML attribute '" + tag + "' has been read " +
426  std::to_string(count) +
427  " time(s) more than it was present in the "
428  "configuration tree.");
429  } else if (count < 0) {
430  warning("XML attribute '" + tag + "' has been read " +
431  std::to_string(-count) +
432  " time(s) less than it was present in the "
433  "configuration tree.");
434  }
435  break;
436  case Attr::TAG:
437  if (count > 0) {
438  warning("Key <" + tag + "> has been read " + std::to_string(count)
439  + " time(s) more than it was present in the configuration tree.");
440  } else if (count < 0) {
441  warning("Key <" + tag + "> has been read " + std::to_string(-count)
442  + " time(s) less than it was present in the configuration tree.");
443  }
444  }
445  }
446 
447  // The following invalidates this instance, s.t. it can not be read from it anymore,
448  // but it also prevents double-checking.
449  _tree = nullptr;
450 }
bool _have_read_data
Indicates if the plain data contained in this tree has already been read.
Definition: ConfigTree.h:626
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void warning(std::string const &message) const
Definition: ConfigTree.cpp:226
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623
static std::string shortString(std::string const &s)
returns a short string at suitable for error/warning messages
Definition: ConfigTree.cpp:263
void markVisitedDecrement(Attr const is_attr, std::string const &key) const
Definition: ConfigTree.cpp:357

◆ checkConfigParameter() [1/2]

template<typename T >
void BaseLib::ConfigTree::checkConfigParameter ( std::string const &  param,
T const &  value 
) const

Assert that param has the given value.

Convenience method combining getConfigParameter(std::string const&) with a check.

Definition at line 157 of file ConfigTree-impl.h.

Referenced by MaterialLib::PorousMedium::createBrooksCorey(), MaterialLib::PorousMedium::createCapillaryPressureModel(), ProcessLib::createCentralDifferencesJacobianAssembler(), MaterialLib::Fracture::CohesiveZoneModeI::createCohesiveZoneModeI(), ProcessLib::createCompareJacobiansJacobianAssembler(), ProcessLib::ComponentTransport::createComponentTransportProcess(), MaterialPropertyLib::createConstant(), ParameterLib::createConstantParameter(), MaterialLib::Fracture::Permeability::createConstantPermeability(), ProcessLib::createConstraintDirichletBoundaryCondition(), NumLib::createConvergenceCriterionDeltaX(), NumLib::createConvergenceCriterionPerComponentDeltaX(), NumLib::createConvergenceCriterionPerComponentResidual(), NumLib::createConvergenceCriterionResidual(), MaterialLib::Solids::Creep::createCreepBGRa(), MaterialLib::Fracture::Permeability::createCubicLaw(), ParameterLib::createCurveScaledParameter(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), MaterialLib::Solids::Ehlers::createEhlers(), NumLib::createEvolutionaryPIDcontroller(), MaterialPropertyLib::createExponentialProperty(), NumLib::createFixedTimeStepping(), MaterialLib::Fluid::createFluidDensityModel(), ParameterLib::createFunctionParameter(), ProcessLib::GroundwaterFlow::createGroundwaterFlowProcess(), ParameterLib::createGroupBasedParameter(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), MaterialPropertyLib::createIdealGasLaw(), NumLib::createIterationNumberBasedTimeStepping(), MaterialLib::Fluid::createLinearConcentrationAndPressureDependentDensity(), MaterialLib::Fluid::createLinearConcentrationDependentDensity(), MaterialLib::Fracture::createLinearElasticIsotropic(), MaterialLib::Solids::createLinearElasticIsotropic(), MaterialLib::Solids::createLinearElasticOrthotropic(), MaterialLib::Fluid::createLinearPressureDependentViscosity(), MaterialPropertyLib::createLinearProperty(), MaterialLib::Fluid::createLinearTemperatureDependentDensity(), ProcessLib::createLineSourceTerm(), MaterialLib::Fluid::createLiquidDensity(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), MaterialLib::Solids::Lubby2::createLubby2(), ParameterLib::createMeshElementParameter(), ParameterLib::createMeshNodeParameter(), MaterialLib::Solids::MFront::createMFront(), MaterialLib::Fracture::createMohrCoulomb(), ProcessLib::createNeumannBoundaryCondition(), ProcessLib::createNodalSourceTerm(), MaterialLib::PorousMedium::createNonWettingPhaseBrooksCoreyOilGas(), MaterialLib::PorousMedium::createNonWettingPhaseVanGenuchten(), ProcessLib::NormalTractionBoundaryCondition::createNormalTractionBoundaryCondition(), ProcessLib::createOutput(), MaterialPropertyLib::createParameterProperty(), ProcessLib::createPhaseFieldIrreversibleDamageOracleBoundaryCondition(), ProcessLib::PhaseField::createPhaseFieldProcess(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), MaterialLib::PorousMedium::createRelativePermeabilityModel(), MaterialPropertyLib::createRelPermBrooksCorey(), MaterialPropertyLib::createRelPermLiakopoulos(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess(), ProcessLib::createRobinBoundaryCondition(), MaterialPropertyLib::createSaturationBrooksCorey(), MaterialPropertyLib::createSaturationLiakopoulos(), ProcessLib::SmallDeformationNonlocal::createSmallDeformationNonlocalProcess(), ProcessLib::SmallDeformation::createSmallDeformationProcess(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess(), MaterialLib::Fluid::createTemperatureDependentViscosity(), ProcessLib::TES::createTESProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess(), ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess(), ParameterLib::createTimeDependentHeterogeneousParameter(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowWithPrhoProcess(), MaterialLib::PorousMedium::createVanGenuchten(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), MaterialLib::Fluid::createViscosityModel(), ProcessLib::createVolumetricSourceTerm(), MaterialLib::PorousMedium::createWettingPhaseBrooksCoreyOilGas(), MaterialLib::PorousMedium::createWettingPhaseVanGenuchten(), getProjectFileName(), and peekConfigParameter().

158 {
159  if (getConfigParameter<T>(param) != value) {
160  error("The value of key <" + param + "> is not the expected one.");
161  }
162 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218

◆ checkConfigParameter() [2/2]

template<typename Ch >
void BaseLib::ConfigTree::checkConfigParameter ( std::string const &  param,
Ch const *  value 
) const

Make checkConfigParameter() work for string literals.

Definition at line 167 of file ConfigTree-impl.h.

References getValue().

168 {
169  if (getConfigParameter<std::string>(param) != value) {
170  error("The value of key <" + param + "> is not the expected one.");
171  }
172 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218

◆ checkKeyname()

void BaseLib::ConfigTree::checkKeyname ( std::string const &  key) const
private

Checks if key complies with the rules [a-z0-9_].

Definition at line 276 of file ConfigTree.cpp.

References error(), joinPaths(), key_chars, and key_chars_start.

Referenced by checkUnique(), checkUniqueAttr(), and ConfigTree().

277 {
278  if (key.empty()) {
279  error("Search for empty key.");
280  } else if (key_chars_start.find(key.front()) == std::string::npos) {
281  error("Key <" + key + "> starts with an illegal character.");
282  } else if (key.find_first_not_of(key_chars, 1) != std::string::npos) {
283  error("Key <" + key + "> contains illegal characters.");
284  } else if (key.find("__") != std::string::npos) {
285  // This is illegal because we use parameter names to generate doxygen
286  // page names. Thereby "__" acts as a separator character. Choosing
287  // other separators is not possible because of observed limitations
288  // for valid doxygen page names.
289  error("Key <" + key + "> contains double underscore.");
290  }
291 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
static const std::string key_chars_start
Set of allowed characters as the first letter of a key name.
Definition: ConfigTree.h:635
static const std::string key_chars
Set of allowed characters in a key name.
Definition: ConfigTree.h:638

◆ checkUnique()

void BaseLib::ConfigTree::checkUnique ( std::string const &  key) const
private

Asserts that the key has not been read yet.

Definition at line 308 of file ConfigTree.cpp.

References _visited_params, checkKeyname(), and error().

Referenced by getConfigParameterList(), getConfigSubtreeList(), getConfigSubtreeOptional(), ignoreConfigParameter(), and ignoreConfigParameterAll().

309 {
310  checkKeyname(key);
311 
312  if (_visited_params.find({Attr::TAG, key}) != _visited_params.end()) {
313  error("Key <" + key + "> has already been processed.");
314  }
315 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623
void checkKeyname(std::string const &key) const
Checks if key complies with the rules [a-z0-9_].
Definition: ConfigTree.cpp:276

◆ checkUniqueAttr()

void BaseLib::ConfigTree::checkUniqueAttr ( std::string const &  attr) const
private

Asserts that the attribute attr has not been read yet.

Definition at line 317 of file ConfigTree.cpp.

References _visited_params, checkKeyname(), error(), and markVisited().

Referenced by ignoreConfigAttribute().

318 {
319  // Workaround for handling attributes with xml namespaces and uppercase letters.
320  if (attr.find(':') != std::string::npos)
321  {
322  auto pos = decltype(std::string::npos){0};
323 
324  // Replace colon and uppercase letters with an allowed character 'a'.
325  // That means, attributes containing a colon are also allowed to contain
326  // uppercase letters.
327  auto attr2 = attr;
328  do {
329  pos = attr2.find_first_of(":ABCDEFGHIJKLMNOPQRSTUVWXYZ", pos);
330  if (pos != std::string::npos)
331  {
332  attr2[pos] = 'a';
333  }
334  } while (pos != std::string::npos);
335 
336  checkKeyname(attr2);
337  }
338  else
339  {
340  checkKeyname(attr);
341  }
342 
343  if (_visited_params.find({Attr::ATTR, attr}) != _visited_params.end()) {
344  error("Attribute '" + attr + "' has already been processed.");
345  }
346 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623
void checkKeyname(std::string const &key) const
Checks if key complies with the rules [a-z0-9_].
Definition: ConfigTree.cpp:276

◆ error()

void BaseLib::ConfigTree::error ( std::string const &  message) const
private

Called if an error occurs. Will call the error callback.

This method only acts as a helper method and throws std::runtime_error.

Definition at line 218 of file ConfigTree.cpp.

References _filename, _onerror, _path, and OGS_FATAL.

Referenced by checkKeyname(), checkUnique(), checkUniqueAttr(), getConfigParameter(), getConfigParameterOptional(), getConfigSubtree(), joinPaths(), and BaseLib::ConfigTree::ParameterIterator::operator*().

219 {
220  _onerror(_filename, _path, message);
221  OGS_FATAL(
222  "ConfigTree: The error handler does not break out of the normal "
223  "control flow.");
224 }
std::string _path
A path printed in error/warning messages.
Definition: ConfigTree.h:608
std::string _filename
The path of the file from which this tree has been read.
Definition: ConfigTree.h:611
Callback _onerror
Custom error callback.
Definition: ConfigTree.h:628
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ getConfigAttribute() [1/2]

template<typename T >
T BaseLib::ConfigTree::getConfigAttribute ( std::string const &  attr) const

Get XML attribute attr of type T for the current parameter.

Returns
the requested attribute's value.
Precondition
attr must not have been read before from the current parameter.

Definition at line 195 of file ConfigTree-impl.h.

Referenced by ProcessLib::LiquidFlow::createLiquidFlowMaterialProperties(), MaterialLib::PorousMedium::createPorousMediaProperties(), getProjectFileName(), and getValue().

196 {
197  if (auto a = getConfigAttributeOptional<T>(attr))
198  {
199  return *a;
200  }
201 
202  error("Did not find XML attribute with name '" + attr + "'.");
203 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218

◆ getConfigAttribute() [2/2]

template<typename T >
T BaseLib::ConfigTree::getConfigAttribute ( std::string const &  attr,
T const &  default_value 
) const

Get XML attribute attr of type T for the current parameter or the default_value.

This method has a similar behaviour as getConfigAttribute(std::string const&) except the default_value is returned if the attribute has not been found.

Returns
the requested attribute's value.
Precondition
attr must not have been read before from the current parameter.

Definition at line 206 of file ConfigTree-impl.h.

References getConfigAttributeOptional().

208 {
209  if (auto a = getConfigAttributeOptional<T>(attr))
210  {
211  return *a;
212  }
213 
214  return default_value;
215 }

◆ getConfigAttributeOptional()

template<typename T >
boost::optional< T > BaseLib::ConfigTree::getConfigAttributeOptional ( std::string const &  attr) const

Get XML attribute attr of type T for the current parameter if present.

Returns
the requested attribute's value.
Precondition
attr must not have been read before from the current parameter.

Definition at line 220 of file ConfigTree-impl.h.

References markVisited().

Referenced by ProcessLib::RichardsFlow::createRichardsFlowMaterialProperties(), MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties(), getConfigAttribute(), getProjectFileName(), and anonymous_namespace{ProjectData.cpp}::readSingleMesh().

221 {
222  checkUniqueAttr(attr);
223  auto& ct = markVisited<T>(attr, Attr::ATTR, true);
224 
225  if (auto attrs = _tree->get_child_optional("<xmlattr>")) {
226  if (auto a = attrs->get_child_optional(attr)) {
227  ++ct.count; // count only if attribute has been found
228  if (auto v = a->get_value_optional<T>()) {
229  return v;
230  }
231  error("Value for XML attribute '" + attr + "' `" +
232  shortString(a->data()) +
233  "' not convertible to the desired type.");
234  }
235  }
236 
237  return boost::none;
238 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUniqueAttr(std::string const &attr) const
Asserts that the attribute attr has not been read yet.
Definition: ConfigTree.cpp:317
static std::string shortString(std::string const &s)
returns a short string at suitable for error/warning messages
Definition: ConfigTree.cpp:263

◆ getConfigParameter() [1/3]

template<typename T >
T BaseLib::ConfigTree::getConfigParameter ( std::string const &  param) const

Get parameter param of type T from the configuration tree.

Returns
the value looked for.
Precondition
param must not have been read before from this ConfigTree.

Definition at line 41 of file ConfigTree-impl.h.

Referenced by ChemistryLib::PhreeqcKernelData::createAqueousSolution(), ChemistryLib::PhreeqcIOData::createAqueousSolution(), ProcessLib::HeatTransportBHE::BHE::createBoreholeGeometry(), MaterialLib::PorousMedium::createBrooksCorey(), ProcessLib::createCompareJacobiansJacobianAssembler(), anonymous_namespace{CreateComponent.cpp}::createComponent(), ProcessLib::ComponentTransport::createComponentTransportProcess(), MaterialPropertyLib::createConstant(), ParameterLib::createConstantParameter(), MaterialLib::Fracture::Permeability::createConstantPermeability(), ProcessLib::createConstraintDirichletBoundaryCondition(), NumLib::createConvergenceCriterionDeltaX(), NumLib::createConvergenceCriterionPerComponentDeltaX(), NumLib::createConvergenceCriterionPerComponentResidual(), NumLib::createConvergenceCriterionResidual(), ParameterLib::createCurveScaledParameter(), ProcessLib::createDeactivatedSubdomain(), ProcessLib::createDirichletBoundaryCondition(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), NumLib::createEvolutionaryPIDcontroller(), MaterialPropertyLib::createExponentialProperty(), NumLib::createFixedTimeStepping(), ProcessLib::HeatTransportBHE::BHE::createFlowAndTemperatureControl(), MaterialLib::Fluid::createFluidDensityModel(), MaterialLib::Fluid::createFluidThermalConductivityModel(), ParameterLib::createGroupBasedParameter(), ProcessLib::HeatTransportBHE::BHE::createGroutParameters(), ProcessLib::createHCNonAdvectiveFreeComponentFlowBoundaryCondition(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HT::createHTProcess(), NumLib::createIterationNumberBasedTimeStepping(), MaterialLib::Fluid::createLinearConcentrationAndPressureDependentDensity(), MaterialLib::Fluid::createLinearConcentrationDependentDensity(), MaterialLib::Fluid::createLinearPressureDependentViscosity(), MaterialPropertyLib::createLinearProperty(), MaterialLib::Fluid::createLinearTemperatureDependentDensity(), ProcessLib::createLineSourceTerm(), MaterialLib::Fluid::createLiquidDensity(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), ParameterLib::createMeshElementParameter(), ParameterLib::createMeshNodeParameter(), MaterialLib::Solids::MFront::createMFront(), ProcessLib::createNeumannBoundaryCondition(), MaterialLib::createNewtonRaphsonSolverParameters(), ProcessLib::createNodalSourceTerm(), NumLib::createNonlinearSolver(), MaterialLib::PorousMedium::createNonWettingPhaseBrooksCoreyOilGas(), MaterialLib::PorousMedium::createNonWettingPhaseVanGenuchten(), ProcessLib::NormalTractionBoundaryCondition::createNormalTractionBoundaryCondition(), ProcessLib::createOutput(), ParameterLib::createParameter(), MaterialPropertyLib::createParameterProperty(), MaterialLib::PorousMedium::createPermeabilityModel(), anonymous_namespace{CreatePhase.cpp}::createPhase(), ProcessLib::PhaseField::createPhaseFieldProcess(), MathLib::createPiecewiseLinearCurve(), ProcessLib::HeatTransportBHE::BHE::createPipe(), MaterialLib::PorousMedium::createPorosityModel(), ProcessLib::createPythonBoundaryCondition(), ProcessLib::createPythonSourceTerm(), ProcessLib::HeatTransportBHE::BHE::createRefrigerantProperties(), MaterialPropertyLib::createRelPermBrooksCorey(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::createRobinBoundaryCondition(), MaterialPropertyLib::createSaturationBrooksCorey(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess(), MaterialLib::Fluid::createSpecificFluidHeatCapacityModel(), MaterialLib::PorousMedium::createStorageModel(), ProcessLib::SurfaceFluxData::createSurfaceFluxData(), MaterialLib::Fluid::createTemperatureDependentViscosity(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), NumLib::createTimeDiscretization(), BaseLib::createTimeInterval(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowWithPrhoProcess(), MaterialLib::PorousMedium::createVanGenuchten(), ProcessLib::createVariableDependentNeumannBoundaryCondition(), MaterialLib::Fluid::createViscosityModel(), ProcessLib::createVolumetricSourceTerm(), MaterialLib::PorousMedium::createWettingPhaseBrooksCoreyOilGas(), MaterialLib::PorousMedium::createWettingPhaseVanGenuchten(), anonymous_namespace{ProcessVariable.cpp}::findMeshInConfig(), ParameterLib::findParameter(), ProcessLib::findProcessVariable(), getProjectFileName(), Adsorption::Reaction::newInstance(), operator=(), anonymous_namespace{CreateChemicalSolverInterface.cpp}::parseDatabasePath(), anonymous_namespace{CreateAqueousSolution.cpp}::parseMeansOfAdjustingCharge(), and anonymous_namespace{ProjectData.cpp}::readMeshes().

42 {
43  if (auto p = getConfigParameterOptional<T>(param))
44  {
45  return *p;
46  }
47 
48  error("Key <" + param + "> has not been found");
49 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218

◆ getConfigParameter() [2/3]

template<typename T >
T BaseLib::ConfigTree::getConfigParameter ( std::string const &  param,
T const &  default_value 
) const

Get parameter param of type T from the configuration tree or the default_value.

This method has a similar behaviour as getConfigParameter(std::string const&) except the default_value is returned if the attribute has not been found.

Precondition
param must not have been read before from this ConfigTree.

Definition at line 54 of file ConfigTree-impl.h.

55 {
56  if (auto p = getConfigParameterOptional<T>(param))
57  {
58  return *p;
59  }
60 
61  return default_value;
62 }

◆ getConfigParameter() [3/3]

ConfigTree BaseLib::ConfigTree::getConfigParameter ( std::string const &  root) const

Get parameter param from the configuration tree.

Returns
the subtree representing the requested parameter
Precondition
param must not have been read before from this ConfigTree.

Definition at line 113 of file ConfigTree.cpp.

References error(), getConfigParameterOptional(), and getConfigSubtree().

114 {
115  auto ct = getConfigSubtree(root);
116  if (ct.hasChildren())
117  {
118  error("Requested parameter <" + root + "> actually is a subtree.");
119  }
120  return ct;
121 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
ConfigTree getConfigSubtree(std::string const &root) const
Definition: ConfigTree.cpp:151

◆ getConfigParameterList() [1/2]

template<typename T >
Range< ConfigTree::ValueIterator< T > > BaseLib::ConfigTree::getConfigParameterList ( std::string const &  param) const

Fetches all parameters with name param from the current level of the tree.

The return value is suitable to be used with range-base for-loops.

Precondition
param must not have been read before from this ConfigTree.

Definition at line 118 of file ConfigTree-impl.h.

References peekConfigParameter().

Referenced by ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess(), ProcessLib::findProcessVariables(), getConfigParameterOptional(), getConfigParameterOptionalImpl(), getProjectFileName(), and GeoLib::IO::BoostXmlGmlInterface::readPoints().

119 {
120  checkUnique(param);
121  markVisited<T>(param, Attr::TAG, true);
122 
123  auto p = _tree->equal_range(param);
124  return Range<ValueIterator<T> >(
125  ValueIterator<T>(p.first, param, *this),
126  ValueIterator<T>(p.second, param, *this));
127 }
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308

◆ getConfigParameterList() [2/2]

Range< ConfigTree::ParameterIterator > BaseLib::ConfigTree::getConfigParameterList ( std::string const &  param) const

Fetches all parameters with name param from the current level of the tree.

The return value is suitable to be used with range-base for-loops.

Precondition
param must not have been read before from this ConfigTree.

Definition at line 137 of file ConfigTree.cpp.

References _tree, checkUnique(), getConfigSubtree(), markVisited(), and TAG.

138 {
139  checkUnique(param);
140  markVisited(param, Attr::TAG, true);
141 
142  auto p = _tree->equal_range(param);
143 
144  return Range<ParameterIterator>(
145  ParameterIterator(p.first, param, *this),
146  ParameterIterator(p.second, param, *this));
147 }
CountType & markVisited(std::string const &key, Attr const is_attr, bool peek_only) const
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308

◆ getConfigParameterOptional() [1/2]

template<typename T >
boost::optional< T > BaseLib::ConfigTree::getConfigParameterOptional ( std::string const &  param) const

Get parameter param of type T from the configuration tree if present

This method has a similar behaviour as getConfigParameter(std::string const&) except no errors are raised. Rather it can be told from the return value if the parameter could be read.

Precondition
param must not have been read before from this ConfigTree.

Definition at line 65 of file ConfigTree-impl.h.

Referenced by MaterialLib::PorousMedium::createBrooksCorey(), ProcessLib::createCentralDifferencesJacobianAssembler(), ProcessLib::ComponentTransport::createComponentTransportProcess(), ParameterLib::createConstantParameter(), NumLib::createConvergenceCriterionDeltaX(), NumLib::createConvergenceCriterionPerComponentDeltaX(), NumLib::createConvergenceCriterionPerComponentResidual(), NumLib::createConvergenceCriterionResidual(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), MaterialLib::Solids::MFront::createMFront(), ProcessLib::createOutput(), ProcessLib::PhaseField::createPhaseFieldProcess(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess(), MaterialLib::PorousMedium::createVanGenuchten(), MathLib::ODE::CVodeSolverImpl::CVodeSolverImpl(), anonymous_namespace{ProcessVariable.cpp}::findMeshInConfig(), ParameterLib::findOptionalTagParameter(), getConfigParameter(), getProjectFileName(), MathLib::LisOption::LisOption(), ProjectData::ProjectData(), and ProcessLib::TES::TESProcess::TESProcess().

67 {
68  checkUnique(param);
69 
70  return getConfigParameterOptionalImpl(param, static_cast<T*>(nullptr));
71 }
boost::optional< T > getConfigParameterOptionalImpl(std::string const &param, T *) const
Default implementation of reading a value of type T.
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308

◆ getConfigParameterOptional() [2/2]

boost::optional< ConfigTree > BaseLib::ConfigTree::getConfigParameterOptional ( std::string const &  root) const

Get parameter param from the configuration tree if present.

Returns
the subtree representing the requested parameter
Precondition
param must not have been read before from this ConfigTree.

Definition at line 125 of file ConfigTree.cpp.

References error(), getConfigParameterList(), and getConfigSubtreeOptional().

126 {
127  auto ct = getConfigSubtreeOptional(root);
128  if (ct && ct->hasChildren())
129  {
130  error("Requested parameter <" + root + "> actually is a subtree.");
131  }
132  return ct;
133 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
boost::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:161

◆ getConfigParameterOptionalImpl() [1/2]

template<typename T >
boost::optional< T > BaseLib::ConfigTree::getConfigParameterOptionalImpl ( std::string const &  param,
T *   
) const
private

Default implementation of reading a value of type T.

Definition at line 74 of file ConfigTree-impl.h.

Referenced by getProjectFileName().

76 {
77  if (auto p = getConfigSubtreeOptional(param))
78  {
79  return p->getValue<T>();
80  }
81 
82  return boost::none;
83 }
boost::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:161

◆ getConfigParameterOptionalImpl() [2/2]

template<typename T >
boost::optional< std::vector< T > > BaseLib::ConfigTree::getConfigParameterOptionalImpl ( std::string const &  param,
std::vector< T > *   
) const
private

Implementation of reading a vector of values of type T.

Definition at line 86 of file ConfigTree-impl.h.

References getConfigParameterList().

88 {
89  if (auto p = getConfigSubtreeOptional(param))
90  {
91  std::istringstream sstr{p->getValue<std::string>()};
92  std::vector<T> result;
93  T value;
94  while (sstr >> value)
95  {
96  result.push_back(value);
97  }
98  if (!sstr.eof()) // The stream is not read until the end, must be an
99  // error. result contains number of read values.
100  {
101  error("Value for key <" + param + "> `" +
102  shortString(sstr.str()) +
103  "' not convertible to a vector of the desired type."
104  " Could not convert token no. " +
105  std::to_string(result.size() + 1) + ".");
106  return boost::none;
107  }
108 
109  return boost::make_optional(result);
110  }
111 
112  return boost::none;
113 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
static std::string shortString(std::string const &s)
returns a short string at suitable for error/warning messages
Definition: ConfigTree.cpp:263
boost::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:161

◆ getConfigSubtree()

ConfigTree BaseLib::ConfigTree::getConfigSubtree ( std::string const &  root) const

Get the subtree rooted at root

If root is not found error() is called.

Precondition
root must not have been read before from this ConfigTree.

Definition at line 151 of file ConfigTree.cpp.

References error(), and getConfigSubtreeOptional().

Referenced by MaterialLib::PorousMedium::createCapillaryPressureModel(), ProcessLib::createCompareJacobiansJacobianAssembler(), ProcessLib::ComponentTransport::createComponentTransportProcess(), MaterialPropertyLib::createExponentialProperty(), NumLib::createFixedTimeStepping(), MaterialLib::Fluid::createFluidProperties(), ProcessLib::GroundwaterFlow::createGroundwaterFlowProcess(), ProcessLib::HeatConduction::createHeatConductionProcess(), ProcessLib::HeatTransportBHE::createHeatTransportBHEProcess(), ProcessLib::HT::createHTProcess(), ProcessLib::HydroMechanics::createHydroMechanicsProcess(), ProcessLib::LIE::HydroMechanics::createHydroMechanicsProcess(), ChemistryLib::PhreeqcKernelData::createInitialAqueousSolution(), ProcessLib::LiquidFlow::createLiquidFlowMaterialProperties(), ProcessLib::LiquidFlow::createLiquidFlowProcess(), MaterialLib::Solids::MFront::createMFront(), ProcessLib::createOutput(), ProcessLib::PhaseField::createPhaseFieldProcess(), MaterialLib::PorousMedium::createPorousMediaProperties(), MaterialLib::PorousMedium::createRelativePermeabilityModel(), ProcessLib::RichardsComponentTransport::createRichardsComponentTransportProcess(), ProcessLib::RichardsFlow::createRichardsFlowMaterialProperties(), ProcessLib::RichardsFlow::createRichardsFlowProcess(), ProcessLib::RichardsMechanics::createRichardsMechanicsProcess(), ProcessLib::SmallDeformationNonlocal::createSmallDeformationNonlocalProcess(), ProcessLib::SmallDeformation::createSmallDeformationProcess(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess(), ChemistryLib::PhreeqcIOData::createSolutionComponents(), ProcessLib::TES::createTESProcess(), ProcessLib::ThermalTwoPhaseFlowWithPP::createThermalTwoPhaseFlowWithPPProcess(), ProcessLib::ThermoHydroMechanics::createThermoHydroMechanicsProcess(), ProcessLib::ThermoMechanicalPhaseField::createThermoMechanicalPhaseFieldProcess(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess(), ParameterLib::createTimeDependentHeterogeneousParameter(), BaseLib::createTimeInterval(), ProcessLib::createTimeLoop(), MaterialLib::TwoPhaseFlowWithPP::createTwoPhaseFlowMaterialProperties(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowPrhoMaterialProperties(), ProcessLib::TwoPhaseFlowWithPP::createTwoPhaseFlowWithPPProcess(), ProcessLib::TwoPhaseFlowWithPrho::createTwoPhaseFlowWithPrhoProcess(), getConfigParameter(), getConfigParameterList(), getProjectFileName(), ProcessLib::HeatTransportBHE::BHE::parseBHECoaxialConfig(), ProcessLib::HeatTransportBHE::BHE::parseBHEUTypeConfig(), ProjectData::ProjectData(), Adsorption::ReactionCaOH2::ReactionCaOH2(), and ProcessLib::TES::TESProcess::TESProcess().

152 {
153  if (auto t = getConfigSubtreeOptional(root)) {
154  return std::move(*t);
155  }
156  error("Key <" + root + "> has not been found.");
157 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
boost::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
Definition: ConfigTree.cpp:161

◆ getConfigSubtreeList()

Range< ConfigTree::SubtreeIterator > BaseLib::ConfigTree::getConfigSubtreeList ( std::string const &  root) const

Get all subtrees that have a root root from the current level of the tree.

The return value is suitable to be used with range-base for-loops.

Precondition
root must not have been read before from this ConfigTree.

Definition at line 175 of file ConfigTree.cpp.

References _tree, checkUnique(), markVisited(), and TAG.

Referenced by MaterialLib::Solids::createConstitutiveRelations(), NumLib::createFixedTimeStepping(), ParameterLib::createFunctionParameter(), ParameterLib::createGroupBasedParameter(), MaterialPropertyLib::createLinearProperty(), ProcessLib::createPerProcessData(), ProcessLib::RichardsComponentTransport::createPorousMediaProperties(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess(), getConfigSubtreeOptional(), getProjectFileName(), InSituLib::Initialize(), ProjectData::parseLinearSolvers(), ProjectData::parseNonlinearSolvers(), ProjectData::parseParameters(), ProjectData::parseProcesses(), ProjectData::parseProcessVariables(), GeoLib::IO::BoostXmlGmlInterface::readPolylines(), GeoLib::IO::BoostXmlGmlInterface::readSurfaces(), and ApplicationsLib::TestDefinition::TestDefinition().

176 {
177  checkUnique(root);
178  markVisited(root, Attr::TAG, true);
179 
180  auto p = _tree->equal_range(root);
181 
182  return Range<SubtreeIterator>(
183  SubtreeIterator(p.first, root, *this),
184  SubtreeIterator(p.second, root, *this));
185 }
CountType & markVisited(std::string const &key, Attr const is_attr, bool peek_only) const
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308

◆ getConfigSubtreeOptional()

boost::optional< ConfigTree > BaseLib::ConfigTree::getConfigSubtreeOptional ( std::string const &  root) const

Get the subtree rooted at root if present

Precondition
root must not have been read before from this ConfigTree.

Definition at line 161 of file ConfigTree.cpp.

References _tree, checkUnique(), ConfigTree(), getConfigSubtreeList(), markVisited(), and TAG.

Referenced by anonymous_namespace{CreateComponent.cpp}::createComponent(), ProcessLib::ComponentTransport::createComponentTransportProcess(), ProcessLib::createDeactivatedSubdomains(), MaterialLib::Fluid::createFluidProperties(), ProcessLib::HT::createHTProcess(), MaterialPropertyLib::createMedium(), ProcessLib::createOutput(), anonymous_namespace{CreatePhase.cpp}::createPhase(), MeshGeoToolsLib::createSearchLengthAlgorithm(), ProcessLib::createSecondaryVariables(), ProcessLib::createTimeLoop(), getConfigParameterOptional(), getConfigSubtree(), getProjectFileName(), MathLib::PETScLinearSolver::PETScLinearSolver(), ProcessLib::ProcessVariable::ProcessVariable(), ProjectData::ProjectData(), anonymous_namespace{ProjectData.cpp}::readMeshes(), and MathLib::EigenLinearSolver::setOption().

162 {
163  checkUnique(root);
164 
165  if (auto subtree = _tree->get_child_optional(root)) {
166  markVisited(root, Attr::TAG, false);
167  return ConfigTree(*subtree, *this, root);
168  }
169  markVisited(root, Attr::TAG, true);
170  return boost::none;
171 }
CountType & markVisited(std::string const &key, Attr const is_attr, bool peek_only) const
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308
ConfigTree(PTree const &tree, std::string filename, Callback error_cb, Callback warning_cb)
Definition: ConfigTree.cpp:35

◆ getProjectFileName()

◆ getValue()

template<typename T >
T BaseLib::ConfigTree::getValue ( ) const

Get the plain data contained in the current level of the tree.

Returns
the data converted to the type T
Precondition
The data must not have been read before.

Definition at line 177 of file ConfigTree-impl.h.

References getConfigAttribute().

Referenced by checkConfigParameter(), getProjectFileName(), and anonymous_namespace{ProjectData.cpp}::readSingleMesh().

178 {
179  if (_have_read_data) {
180  error("The data of this subtree has already been read.");
181  }
182 
183  _have_read_data = true;
184 
185  if (auto v = _tree->get_value_optional<T>()) {
186  return *v;
187  }
188  error("Value `" + shortString(_tree->data()) +
189  "' is not convertible to the desired type.");
190 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
bool _have_read_data
Indicates if the plain data contained in this tree has already been read.
Definition: ConfigTree.h:626
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
static std::string shortString(std::string const &s)
returns a short string at suitable for error/warning messages
Definition: ConfigTree.cpp:263

◆ hasChildren()

bool BaseLib::ConfigTree::hasChildren ( ) const
private

Checks if this tree has any children.

Definition at line 371 of file ConfigTree.cpp.

References _tree.

372 {
373  auto const& tree = *_tree;
374  if (tree.begin() == tree.end())
375  {
376  return false; // no children
377  }
378  if (tree.front().first == "<xmlattr>" && (++tree.begin()) == tree.end())
379  {
380  return false; // only attributes
381  }
382 
383  return true;
384 }
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605

◆ ignoreConfigAttribute()

void BaseLib::ConfigTree::ignoreConfigAttribute ( std::string const &  attr) const

Tell this instance to ignore the XML attribute attr.

This method is used to avoid warning messages.

Precondition
attr must not have been read before from this ConfigTree.

Definition at line 195 of file ConfigTree.cpp.

References _tree, ATTR, checkUniqueAttr(), and markVisited().

Referenced by getProjectFileName().

196 {
197  checkUniqueAttr(attr);
198 
199  // Exercise: Guess what not! (hint: if not found, peek only)
200  // Btw. (not a hint) _tree->find() does not seem to work here.
201  bool peek_only = !_tree->get_child_optional("<xmlattr>." + attr);
202 
203  markVisited(attr, Attr::ATTR, peek_only);
204 }
CountType & markVisited(std::string const &key, Attr const is_attr, bool peek_only) const
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUniqueAttr(std::string const &attr) const
Asserts that the attribute attr has not been read yet.
Definition: ConfigTree.cpp:317

◆ ignoreConfigParameter()

void BaseLib::ConfigTree::ignoreConfigParameter ( std::string const &  param) const

Tell this instance to ignore parameter param.

This method is used to avoid warning messages.

Precondition
param must not have been read before from this ConfigTree.

Definition at line 187 of file ConfigTree.cpp.

References _tree, checkUnique(), markVisited(), and TAG.

Referenced by NumLib::createTimeStepper(), getProjectFileName(), and MathLib::ignoreOtherLinearSolvers().

188 {
189  checkUnique(param);
190  // if not found, peek only
191  bool peek_only = _tree->find(param) == _tree->not_found();
192  markVisited(param, Attr::TAG, peek_only);
193 }
CountType & markVisited(std::string const &key, Attr const is_attr, bool peek_only) const
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308

◆ ignoreConfigParameterAll()

void BaseLib::ConfigTree::ignoreConfigParameterAll ( std::string const &  param) const

Tell this instance to ignore all parameters param on the current level of the tree.

This method is used to avoid warning messages.

Precondition
param must not have been read before from this ConfigTree.

Definition at line 206 of file ConfigTree.cpp.

References _tree, checkUnique(), markVisited(), and TAG.

Referenced by getProjectFileName().

207 {
208  checkUnique(param);
209  auto& ct = markVisited(param, Attr::TAG, true);
210 
211  auto p = _tree->equal_range(param);
212  for (auto it = p.first; it != p.second; ++it) {
213  ++ct.count;
214  }
215 }
CountType & markVisited(std::string const &key, Attr const is_attr, bool peek_only) const
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkUnique(std::string const &key) const
Asserts that the key has not been read yet.
Definition: ConfigTree.cpp:308

◆ joinPaths()

std::string BaseLib::ConfigTree::joinPaths ( std::string const &  p1,
std::string const &  p2 
) const
private

Used to generate the path of a subtree.

Definition at line 294 of file ConfigTree.cpp.

References error(), and pathseparator.

Referenced by checkKeyname().

295 {
296  if (p2.empty()) {
297  error("Second path to be joined is empty.");
298  }
299 
300  if (p1.empty())
301  {
302  return p2;
303  }
304 
305  return p1 + pathseparator + p2;
306 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
static const char pathseparator
Character separating two path components.
Definition: ConfigTree.h:632

◆ markVisited() [1/2]

template<typename T >
ConfigTree::CountType & BaseLib::ConfigTree::markVisited ( std::string const &  key,
Attr const  is_attr,
bool  peek_only 
) const
private

Keeps track of the key key and its value type T.

This method asserts that a key is read always with the same type.

param peek_only if true, do not change the read-count of the given key.

Definition at line 243 of file ConfigTree-impl.h.

Referenced by checkUniqueAttr(), getConfigAttributeOptional(), getConfigParameterList(), getConfigSubtreeList(), getConfigSubtreeOptional(), ignoreConfigAttribute(), ignoreConfigParameter(), ignoreConfigParameterAll(), BaseLib::ConfigTree::SubtreeIterator::operator*(), and BaseLib::ConfigTree::ValueIterator< ValueType >::operator*().

245 {
246  auto const type = std::type_index(typeid(T));
247 
248  auto p = _visited_params.emplace(std::make_pair(is_attr, key),
249  CountType{peek_only ? 0 : 1, type});
250 
251  if (!p.second) { // no insertion happened
252  auto& v = p.first->second;
253  if (v.type == type) {
254  if (!peek_only)
255  {
256  ++v.count;
257  }
258  } else {
259  error("There already was an attempt to obtain key <" + key +
260  "> with type '" + v.type.name() + "' (now: '" + type.name() +
261  "').");
262  }
263  }
264 
265  return p.first->second;
266 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623

◆ markVisited() [2/2]

ConfigTree::CountType & BaseLib::ConfigTree::markVisited ( std::string const &  key,
Attr const  is_attr,
bool const  peek_only 
) const
private

Keeps track of the key key and its value type ConfigTree.

This method asserts that a key is read always with the same type.

param peek_only if true, do not change the read-count of the given key.

Definition at line 350 of file ConfigTree.cpp.

References markVisitedDecrement().

351 {
352  return markVisited<ConfigTree>(key, is_attr, peek_only);
353 }

◆ markVisitedDecrement()

void BaseLib::ConfigTree::markVisitedDecrement ( Attr const  is_attr,
std::string const &  key 
) const
private

Used in the destructor to compute the difference between number of reads of a parameter and the number of times it exists in the ConfigTree

Definition at line 357 of file ConfigTree.cpp.

References _visited_params.

Referenced by checkAndInvalidate(), and markVisited().

358 {
359  auto const type = std::type_index(typeid(nullptr));
360 
361  auto p = _visited_params.emplace(std::make_pair(is_attr, key),
362  CountType{-1, type});
363 
364  if (!p.second) { // no insertion happened
365  auto& v = p.first->second;
366  --v.count;
367  }
368 }
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623

◆ onerror()

void BaseLib::ConfigTree::onerror ( std::string const &  filename,
std::string const &  path,
std::string const &  message 
)
static

Default error callback function Will throw std::runtime_error

Definition at line 232 of file ConfigTree.cpp.

References OGS_FATAL.

Referenced by getProjectFileName().

234 {
235  OGS_FATAL("ConfigTree: In file `%s' at path <%s>: %s",
236  filename.c_str(), path.c_str(), message.c_str());
237 }
#define OGS_FATAL(fmt,...)
Definition: Error.h:64

◆ onwarning()

void BaseLib::ConfigTree::onwarning ( std::string const &  filename,
std::string const &  path,
std::string const &  message 
)
static

Default warning callback function Will print a warning message

Definition at line 239 of file ConfigTree.cpp.

Referenced by getProjectFileName().

241 {
242  WARN("ConfigTree: In file `%s' at path <%s>: %s",
243  filename.c_str(), path.c_str(), message.c_str());
244 }

◆ operator=() [1/2]

ConfigTree& BaseLib::ConfigTree::operator= ( ConfigTree const &  )
delete

copying is not compatible with the semantics of this class

Referenced by ~ConfigTree().

◆ operator=() [2/2]

ConfigTree & BaseLib::ConfigTree::operator= ( ConfigTree &&  other)

After being moved from, other is in an undefined state and must not be used anymore!

Definition at line 95 of file ConfigTree.cpp.

References _filename, _have_read_data, _onerror, _onwarning, _path, _tree, _visited_params, checkAndInvalidate(), and getConfigParameter().

96 {
98 
99  _tree = other._tree;
100  other._tree = nullptr;
101  _path = std::move(other._path);
102  _filename = std::move(other._filename);
103  _visited_params = std::move(other._visited_params);
104  _have_read_data = other._have_read_data;
105  _onerror = std::move(other._onerror);
106  _onwarning = std::move(other._onwarning);
107 
108  return *this;
109 }
std::string _path
A path printed in error/warning messages.
Definition: ConfigTree.h:608
bool _have_read_data
Indicates if the plain data contained in this tree has already been read.
Definition: ConfigTree.h:626
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
std::map< KeyType, CountType > _visited_params
Definition: ConfigTree.h:623
std::string _filename
The path of the file from which this tree has been read.
Definition: ConfigTree.h:611
Callback _onerror
Custom error callback.
Definition: ConfigTree.h:628
Callback _onwarning
Custom warning callback.
Definition: ConfigTree.h:629

◆ peekConfigParameter()

template<typename T >
T BaseLib::ConfigTree::peekConfigParameter ( std::string const &  param) const

Peek at a parameter param of type T from the configuration tree.

This method is an exception to the single-read rule. It is meant to be used to tell from a ConfigTree instance where to pass that instance on for further processing.

But in order that the requested parameter counts as "completely parsed", it has to be read through some other method, too.

Return value and error behaviour are the same as for getConfigParameter<T>(std::string const&).

Definition at line 132 of file ConfigTree-impl.h.

References checkConfigParameter().

Referenced by ProcessLib::createBoundaryCondition(), MaterialLib::PorousMedium::createCapillaryPressureModel(), MaterialLib::Solids::createConstitutiveRelation(), NumLib::createConvergenceCriterion(), ProcessLib::createDeactivatedSubdomain(), ProcessLib::createDirichletBoundaryConditionWithinTimeInterval(), MaterialLib::Fluid::createFluidDensityModel(), ParameterLib::createParameter(), MaterialLib::Fracture::Permeability::createPermeabilityModel(), anonymous_namespace{CreateProperty.cpp}::createProperty(), MaterialLib::PorousMedium::createRelativePermeabilityModel(), ProcessLib::LIE::SmallDeformation::createSmallDeformationProcess(), ProcessLib::createSourceTerm(), ProcessLib::ThermoMechanics::createThermoMechanicsProcess(), NumLib::createTimeStepper(), MaterialLib::Fluid::createViscosityModel(), getConfigParameterList(), and getProjectFileName().

133 {
134  checkKeyname(param);
135 
136  if (auto p = _tree->get_child_optional(param))
137  {
138  try
139  {
140  return p->get_value<T>();
141  }
142  catch (boost::property_tree::ptree_bad_data const&)
143  {
144  error("Value for key <" + param + "> `" + shortString(p->data()) +
145  "' not convertible to the desired type.");
146  }
147  }
148  else
149  {
150  error("Key <" + param + "> has not been found");
151  }
152 }
void error(std::string const &message) const
Definition: ConfigTree.cpp:218
boost::property_tree::ptree const * _tree
The wrapped tree.
Definition: ConfigTree.h:605
void checkKeyname(std::string const &key) const
Checks if key complies with the rules [a-z0-9_].
Definition: ConfigTree.cpp:276
static std::string shortString(std::string const &s)
returns a short string at suitable for error/warning messages
Definition: ConfigTree.cpp:263

◆ shortString()

std::string BaseLib::ConfigTree::shortString ( std::string const &  s)
staticprivate

returns a short string at suitable for error/warning messages

Definition at line 263 of file ConfigTree.cpp.

Referenced by checkAndInvalidate().

264 {
265  const std::size_t maxlen = 100;
266 
267  if (s.size() < maxlen)
268  {
269  return s;
270  }
271 
272  return s.substr(0, maxlen-3) + "...";
273 }

◆ warning()

void BaseLib::ConfigTree::warning ( std::string const &  message) const
private

Called for printing warning messages. Will call the warning callback. This method only acts as a helper method.

Definition at line 226 of file ConfigTree.cpp.

References _filename, _onwarning, and _path.

Referenced by checkAndInvalidate().

227 {
228  _onwarning(_filename, _path, message);
229 }
std::string _path
A path printed in error/warning messages.
Definition: ConfigTree.h:608
std::string _filename
The path of the file from which this tree has been read.
Definition: ConfigTree.h:611
Callback _onwarning
Custom warning callback.
Definition: ConfigTree.h:629

Friends And Related Function Documentation

◆ checkAndInvalidate [1/3]

void checkAndInvalidate ( ConfigTree *const  conf)
friend

Check if conf has been read entirely and invalidate it.

This method can savely be called on nullptr's.

See also
ConfigTree::checkAndInvalidate()

Definition at line 458 of file ConfigTree.cpp.

459 {
460  if (conf)
461  {
462  conf->checkAndInvalidate();
463  }
464 }

◆ checkAndInvalidate [2/3]

void checkAndInvalidate ( ConfigTree conf)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 453 of file ConfigTree.cpp.

454 {
455  conf.checkAndInvalidate();
456 }

◆ checkAndInvalidate [3/3]

void checkAndInvalidate ( std::unique_ptr< ConfigTree > const &  conf)
friend

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 466 of file ConfigTree.cpp.

467 {
468  if (conf)
469  {
470  conf->checkAndInvalidate();
471  }
472 }

Member Data Documentation

◆ _filename

std::string BaseLib::ConfigTree::_filename
private

The path of the file from which this tree has been read.

Definition at line 611 of file ConfigTree.h.

Referenced by error(), getProjectFileName(), operator=(), and warning().

◆ _have_read_data

bool BaseLib::ConfigTree::_have_read_data = false
mutableprivate

Indicates if the plain data contained in this tree has already been read.

Definition at line 626 of file ConfigTree.h.

Referenced by checkAndInvalidate(), and operator=().

◆ _onerror

Callback BaseLib::ConfigTree::_onerror
private

Custom error callback.

Definition at line 628 of file ConfigTree.h.

Referenced by ConfigTree(), error(), and operator=().

◆ _onwarning

Callback BaseLib::ConfigTree::_onwarning
private

Custom warning callback.

Definition at line 629 of file ConfigTree.h.

Referenced by ConfigTree(), operator=(), and warning().

◆ _path

std::string BaseLib::ConfigTree::_path
private

A path printed in error/warning messages.

Definition at line 608 of file ConfigTree.h.

Referenced by error(), operator=(), and warning().

◆ _tree

boost::property_tree::ptree const* BaseLib::ConfigTree::_tree
private

◆ _visited_params

std::map<KeyType, CountType> BaseLib::ConfigTree::_visited_params
mutableprivate

A map KeyType -> (count, type) keeping track which parameters have been read how often and which datatype they have.

This member will be written to when reading from the config tree. Therefore it has to be mutable in order to be able to read from constant instances, e.g., those passed as constant references to temporaries.

Definition at line 623 of file ConfigTree.h.

Referenced by checkAndInvalidate(), checkUnique(), checkUniqueAttr(), markVisitedDecrement(), and operator=().

◆ key_chars

const std::string BaseLib::ConfigTree::key_chars = key_chars_start + "_0123456789"
staticprivate

Set of allowed characters in a key name.

Definition at line 638 of file ConfigTree.h.

Referenced by checkKeyname().

◆ key_chars_start

const std::string BaseLib::ConfigTree::key_chars_start = "abcdefghijklmnopqrstuvwxyz"
staticprivate

Set of allowed characters as the first letter of a key name.

Definition at line 635 of file ConfigTree.h.

Referenced by checkKeyname().

◆ pathseparator

const char BaseLib::ConfigTree::pathseparator = '/'
staticprivate

Character separating two path components.

Definition at line 632 of file ConfigTree.h.

Referenced by joinPaths().


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