Project
Loading...
Searching...
No Matches
o2::framework::PropertyTreeHelpers Struct Reference

Helpers to manipulate property_trees. More...

#include <PropertyTreeHelpers.h>

Public Types

template<typename T >
using WalkerFunction = std::function< void(boost::property_tree::ptree const &, typename T::path_type, boost::property_tree::ptree const &)>
 

Static Public Member Functions

static void populateDefaults (std::vector< ConfigParamSpec > const &schema, boost::property_tree::ptree &tree, boost::property_tree::ptree &provenance)
 
static void populate (std::vector< ConfigParamSpec > const &schema, boost::property_tree::ptree &tree, boost::program_options::variables_map const &vmap, boost::property_tree::ptree &provenance)
 
static void populate (std::vector< ConfigParamSpec > const &schema, boost::property_tree::ptree &tree, boost::property_tree::ptree const &in, boost::property_tree::ptree &provenance, std::string const &propertyLabel)
 
template<typename T >
static void traverse (boost::property_tree::ptree const &parent, WalkerFunction< T > &method)
 Traverse the tree recursively calling WalkerFunction on each leaf.
 
template<typename T >
static void merge (boost::property_tree::ptree &dest, boost::property_tree::ptree const &source, typename T::path_type const &mergePoint)
 Merge source ptree into dest.
 

Detailed Description

Helpers to manipulate property_trees.

Definition at line 25 of file PropertyTreeHelpers.h.

Member Typedef Documentation

◆ WalkerFunction

template<typename T >
using o2::framework::PropertyTreeHelpers::WalkerFunction = std::function<void(boost::property_tree::ptree const&, typename T::path_type, boost::property_tree::ptree const&)>

Definition at line 54 of file PropertyTreeHelpers.h.

Member Function Documentation

◆ merge()

template<typename T >
static void o2::framework::PropertyTreeHelpers::merge ( boost::property_tree::ptree &  dest,
boost::property_tree::ptree const &  source,
typename T::path_type const &  mergePoint 
)
static

Merge source ptree into dest.

◆ populate() [1/2]

void o2::framework::PropertyTreeHelpers::populate ( std::vector< ConfigParamSpec > const &  schema,
boost::property_tree::ptree &  tree,
boost::program_options::variables_map const &  vmap,
boost::property_tree::ptree &  provenance 
)
static

For all the options specified in schama, this fills tree with the contents of vmap, which is populated via boost program options. Any key in the schema will be marked as "fairmq" in the provenance ptree.

Definition at line 138 of file PropertyTreeHelpers.cxx.

◆ populate() [2/2]

void o2::framework::PropertyTreeHelpers::populate ( std::vector< ConfigParamSpec > const &  schema,
boost::property_tree::ptree &  tree,
boost::property_tree::ptree const &  in,
boost::property_tree::ptree &  provenance,
std::string const &  propertyLabel 
)
static

For all the options specified in schama, this fills tree with the contents of in, which is another ptree e.g. populated using ConfigurationInterface. Any key in the schema will be marked as "configuration" in the provenance ptree.

Definition at line 270 of file PropertyTreeHelpers.cxx.

◆ populateDefaults()

void o2::framework::PropertyTreeHelpers::populateDefaults ( std::vector< ConfigParamSpec > const &  schema,
boost::property_tree::ptree &  tree,
boost::property_tree::ptree &  provenance 
)
static

For all the options specified in schema, this fills tree with the contents of vmap, which is populated via boost program options. Any key in the schema will be marked as "default" in the provenance ptree.

Definition at line 36 of file PropertyTreeHelpers.cxx.

◆ traverse()

template<typename T >
static void o2::framework::PropertyTreeHelpers::traverse ( boost::property_tree::ptree const &  parent,
WalkerFunction< T > &  method 
)
static

Traverse the tree recursively calling WalkerFunction on each leaf.


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