Utopia  2
Framework for studying models of complex & adaptive systems.
Namespaces | Functions
cfg_utils.hh File Reference
#include <list>
#include <sstream>
#include <boost/core/demangle.hpp>
#include <armadillo>
#include <yaml-cpp/yaml.h>
#include "../core/exceptions.hh"
#include "../core/string.hh"
#include "../core/types.hh"
Include dependency graph for cfg_utils.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 Utopia
 
 Utopia::DataIO
 
 Utopia::_internal
 

Functions

template<class Exc >
YAML::Exception Utopia::DataIO::improve_yaml_exception (const Exc &e, const Config &node, std::string prefix={})
 Improves yaml-cpp exceptions occurring for a given node. More...
 
std::string Utopia::DataIO::to_string (const Config &node)
 Given a config node, returns a string representation of it. More...
 
template<typename ReturnType >
ReturnType Utopia::get_as (const std::string &key, const DataIO::Config &node)
 This function is a wrapper around the yaml-cpp YAML::Node::as function. More...
 
template<typename ReturnType >
ReturnType Utopia::get_as (const std::string &key, const DataIO::Config &node, ReturnType fallback)
 Like Utopia::get_as, but instead of KeyError, returns a fallback value. More...
 
template<typename CVecT , DimType dim = 0>
CVecT Utopia::DataIO::get_as_arma_vec (const std::string &key, const DataIO::Config &node)
 Retrieve a config entry as Armadillo column vector using get_. More...
 
template<DimType dim>
SpaceVecType< dim > Utopia::get_as_SpaceVec (const std::string &key, const DataIO::Config &node)
 Special case of Utopia::get_as to retrieve an entry as SpaceVec. More...
 
template<DimType dim>
MultiIndexType< dim > Utopia::get_as_MultiIndex (const std::string &key, const DataIO::Config &node)
 Special case of Utopia::get_as to retrieve an entry as MultiIndex. More...
 
template<class T , class Keys = std::list<std::string>>
Config Utopia::_internal::__recursive_setitem (Config d, Keys &&key_sequence, const T &val)
 Helper function for recursive_setitem. More...
 
Config Utopia::_internal::recursive_getitem (const Config &d, const std::vector< std::string > &key_sequence)
 Recursively retrieve an element from the configuration tree. More...
 
Config Utopia::_internal::recursive_getitem (const Config &d, const std::string &key_sequence, const std::string &delims=".")
 Overload for recursive_getitem, accepting a string-like key sequence. More...
 
template<class T >
void Utopia::_internal::recursive_setitem (Config &d, std::list< std::string > key_sequence, const T val)
 Recursively sets an element in a configuration tree. More...
 
template<class T >
void Utopia::_internal::recursive_setitem (Config &d, const std::string &key_sequence, const T val, const std::string &delims=".")
 Overload for recursive_setitem that splits a string into a key sequence. More...