Project
Loading...
Searching...
No Matches
PropertyTreeHelpers.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11#ifndef O2_FRAMEWORK_PROPERTYTREEHELPERS_H_
12#define O2_FRAMEWORK_PROPERTYTREEHELPERS_H_
13
15
16#define BOOST_BIND_GLOBAL_PLACEHOLDERS
17#include <boost/property_tree/ptree_fwd.hpp>
18#include <boost/program_options/variables_map.hpp>
19#include <functional>
20
21namespace o2::framework
22{
23
30 static void populateDefaults(std::vector<ConfigParamSpec> const& schema,
31 boost::property_tree::ptree& tree,
32 boost::property_tree::ptree& provenance);
33
38 static void populate(std::vector<ConfigParamSpec> const& schema,
39 boost::property_tree::ptree& tree,
40 boost::program_options::variables_map const& vmap,
41 boost::property_tree::ptree& provenance);
42
47 static void populate(std::vector<ConfigParamSpec> const& schema,
48 boost::property_tree::ptree& tree,
49 boost::property_tree::ptree const& in,
50 boost::property_tree::ptree& provenance,
51 std::string const& propertyLabel);
52
53 //using WalkerFunction = std::function<void(boost::property_tree::ptree const&, boost::property_tree::ptree::path_type, boost::property_tree::ptree const&)>;
54 template <typename T> using WalkerFunction = std::function<void(boost::property_tree::ptree const&, typename T::path_type, boost::property_tree::ptree const&)>;
56 template <typename T>
57 static void traverse(boost::property_tree::ptree const& parent, WalkerFunction<T>& method);
58
60 template <typename T>
61 static void merge(boost::property_tree::ptree& dest,
62 boost::property_tree::ptree const& source,
63 typename T::path_type const& mergePoint);
64};
65
66} // namespace o2::framework
67
68#endif // O2_FRAMEWORK_PROPERTYTREEHELPERS_H_
GLsizei GLsizei GLchar * source
Definition glcorearb.h:798
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
Helpers to manipulate property_trees.
static void traverse(boost::property_tree::ptree const &parent, WalkerFunction< T > &method)
Traverse the tree recursively calling WalkerFunction on each leaf.
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 merge(boost::property_tree::ptree &dest, boost::property_tree::ptree const &source, typename T::path_type const &mergePoint)
Merge source ptree into dest.
std::function< void(boost::property_tree::ptree const &, typename T::path_type, boost::property_tree::ptree const &)> WalkerFunction
static void populateDefaults(std::vector< ConfigParamSpec > const &schema, boost::property_tree::ptree &tree, boost::property_tree::ptree &provenance)
std::unique_ptr< TTree > tree((TTree *) flIn.Get(std::string(o2::base::NameConf::CTFTREENAME).c_str()))