DP3
ParsetAterms.h
Go to the documentation of this file.
1 // Copyright (C) 2020 ASTRON (Netherlands Institute for Radio Astronomy)
2 // SPDX-License-Identifier: GPL-3.0-or-later
3 
4 #ifndef IDGPREDICT_PARSETATERMS_H
5 #define IDGPREDICT_PARSETATERMS_H
6 
7 #include <EveryBeam/aterms/parsetprovider.h>
8 
9 namespace dp3 {
10 namespace base {
11 
17 class ParsetATerms : public everybeam::aterms::ParsetProvider {
18  public:
24  explicit ParsetATerms(const common::ParameterSet& parset,
25  const std::string& prefix = "")
26  : parset_(parset), prefix_(prefix) {}
27 
29  std::string GetString(const std::string& key) const final {
30  return parset_.getString(prefix_ + key);
31  }
32 
34  std::string GetStringOr(const std::string& key,
35  const std::string& or_value) const final {
36  return parset_.getString(prefix_ + key, or_value);
37  }
38 
40  std::vector<std::string> GetStringList(const std::string& key) const final {
41  return parset_.getStringVector(prefix_ + key);
42  }
43 
45  double GetDoubleOr(const std::string& key, double or_value) const final {
46  return parset_.getDouble(prefix_ + key, or_value);
47  };
48 
50  bool GetBool(const std::string& key) const final {
51  return parset_.getBool(prefix_ + key);
52  };
53 
55  bool GetBoolOr(const std::string& key, bool or_value) const final {
56  return parset_.getBool(prefix_ + key, or_value);
57  };
58 
59  private:
60  const common::ParameterSet& parset_;
61  const std::string& prefix_;
62 };
63 } // namespace base
64 } // namespace dp3
65 #endif
Parses the parameter settings (parset) related to the aterm settings in an EveryBeam-acceptable forma...
Definition: ParsetAterms.h:17
bool GetBoolOr(const std::string &key, bool or_value) const final
Extracts bool for given key. Defaults to or_value.
Definition: ParsetAterms.h:55
std::vector< std::string > GetStringList(const std::string &key) const final
Extracts string list for given key.
Definition: ParsetAterms.h:40
double GetDoubleOr(const std::string &key, double or_value) const final
Extracts double for given key. Defaults to or_value.
Definition: ParsetAterms.h:45
std::string GetStringOr(const std::string &key, const std::string &or_value) const final
Extracts string for given key. Defaults to or_value.
Definition: ParsetAterms.h:34
std::string GetString(const std::string &key) const final
Extracts string for given key.
Definition: ParsetAterms.h:29
ParsetATerms(const common::ParameterSet &parset, const std::string &prefix="")
Definition: ParsetAterms.h:24
bool GetBool(const std::string &key) const final
Extracts bool for given key. Defaults to or_value.
Definition: ParsetAterms.h:50
Implements a map of Key-Value pairs.
Definition: ParameterSet.h:31
std::vector< std::string > getStringVector(const std::string &aKey, bool expandable=false) const
Definition: ParameterSet.h:763
bool getBool(const std::string &aKey) const
Definition: ParameterSet.h:480
double getDouble(const std::string &aKey) const
Definition: ParameterSet.h:588
std::string getString(const std::string &aKey) const
Definition: ParameterSet.h:599
This file has generic helper routines for testing steps.
Definition: AntennaConfig.h:53