forked from mcoquet642/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfigParamStore.h
More file actions
63 lines (51 loc) · 2.07 KB
/
ConfigParamStore.h
File metadata and controls
63 lines (51 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
#ifndef O2_FRAMEWORK_CONFIGPARAMSTORE_H_
#define O2_FRAMEWORK_CONFIGPARAMSTORE_H_
#include "Framework/ParamRetriever.h"
#include "Framework/ConfigParamSpec.h"
#include <boost/property_tree/ptree_fwd.hpp>
namespace o2::framework
{
/// This provides unified store for the parameters specified in the
/// ConfigParamSpecs. This provides only the store, not the actual
/// API to access it. Notice how the loading of the data is done in
/// to steps, to allow doing a diff between the old and the new
/// configuration.
class ConfigParamStore
{
public:
ConfigParamStore(std::vector<ConfigParamSpec> const& specs,
std::vector<std::unique_ptr<ParamRetriever>> retrievers);
/// Preload the next store with a new copy of
/// the configuration.
void preload();
/// Get the store
boost::property_tree::ptree& store() { return *mStore; };
boost::property_tree::ptree& provenanceTree() { return *mProvenance; };
/// Get the specs
std::vector<ConfigParamSpec> const& specs() const
{
return mSpecs;
}
/// Activate the next store
void activate();
std::string provenance(const char*) const;
private:
std::vector<ConfigParamSpec> const& mSpecs;
std::vector<std::unique_ptr<ParamRetriever>> mRetrievers;
std::unique_ptr<boost::property_tree::ptree> mStore;
std::unique_ptr<boost::property_tree::ptree> mProvenance;
std::unique_ptr<boost::property_tree::ptree> mNextStore;
std::unique_ptr<boost::property_tree::ptree> mNextProvenance;
};
} // namespace o2::framework
#endif // O2_FRAMEWORK_CONFIGPARAMREGISTRY_H_