DelegatedParameter.h
Go to the documentation of this file.
1 #ifndef fhiclcpp_types_DelegatedParameter_h
2 #define fhiclcpp_types_DelegatedParameter_h
3 
6 #include "fhiclcpp/types/Name.h"
11 
12 namespace fhicl {
13 
14  //========================================================
17  public:
18  explicit DelegatedParameter(Name&& name);
20  explicit DelegatedParameter(Name&& name,
21  Comment&& comment,
22  std::function<bool()> maybeUse);
23 
24  // A DelegatedParameter object must be present. Therefore, it is
25  // safe and correct to call 'pset.get' with no default.
26  template <typename T>
27  auto
28  get() const
29  {
30  auto const trimmed_key =
32  return pset_.get<T>(trimmed_key);
33  }
34 
35  private:
36  void
37  do_set_value(fhicl::ParameterSet const& pset) override
38  {
39  pset_ = pset;
40  };
41 
43  };
44 }
45 
46 #endif /* fhiclcpp_types_DelegatedParameter_h */
47 
48 // Local variables:
49 // mode: c++
50 // End:
std::string const & name() const
Definition: ParameterBase.h:43
std::string strip_first_containing_name(std::string const &key)
T get(std::string const &key) const
Definition: ParameterSet.h:271
std::string const & key() const
Definition: ParameterBase.h:38
std::string const & comment() const
Definition: ParameterBase.h:48
void do_set_value(fhicl::ParameterSet const &pset) override
void function(int client, int *resource, int parblock, int *test, int p)
fhicl::ParameterSet pset_