Project
Loading...
Searching...
No Matches
ConfigurationOptionsRetriever.cxx
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.
12
13#include "Configuration/ConfigurationInterface.h"
15#include "PropertyTreeHelpers.h"
16
17#define BOOST_BIND_GLOBAL_PLACEHOLDERS
18#include <boost/program_options.hpp>
19#include <boost/property_tree/ptree.hpp>
20#include <boost/property_tree/json_parser.hpp>
21
22#include <string>
23#include <vector>
24#include <iostream>
25
26using namespace o2::framework;
27using namespace o2::configuration;
28namespace bpo = boost::program_options;
29namespace bpt = boost::property_tree;
30
31namespace o2::framework
32{
33
35 std::string const& mainKey)
36 : mCfg{cfg},
37 mMainKey{mainKey}
38{
39}
40
41void ConfigurationOptionsRetriever::update(std::vector<ConfigParamSpec> const& schema,
42 boost::property_tree::ptree& store,
43 boost::property_tree::ptree& provenance)
44{
45 boost::property_tree::ptree in;
46 try {
47 in = mCfg->getRecursive(mMainKey);
48 } catch (...) {
49 in.clear();
50 }
51 PropertyTreeHelpers::populate(schema, store, in, provenance, "configuration:" + mMainKey);
52}
53
54} // namespace o2::framework
o2::configuration::ConfigurationInterface ConfigurationInterface
void update(std::vector< ConfigParamSpec > const &schema, boost::property_tree::ptree &store, boost::property_tree::ptree &provenance) override
ConfigurationOptionsRetriever(configuration::ConfigurationInterface *cfg, std::string const &mainKey)
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
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)