LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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 #include <iostream>
13 
14 namespace fhicl {
15 
16  //========================================================
19  public:
20  explicit DelegatedParameter(Name&& name);
22  explicit DelegatedParameter(Name&& name,
23  Comment&& comment,
24  std::function<bool()> maybeUse);
25 
26  // A DelegatedParameter object must be present. Therefore, it is
27  // safe and correct to call 'pset.get' with no default.
28  template <typename T>
29  auto
30  get() const
31  {
32  std::string const& trimmed_key =
34  return pset_.get<T>(trimmed_key);
35  }
36 
37  private:
38  void
40  bool const /*trimParents*/) override
41  {
42  pset_ = pset;
43  };
44 
46  };
47 }
48 
49 #endif /* fhiclcpp_types_DelegatedParameter_h */
50 
51 // Local variables:
52 // mode: c++
53 // End:
std::string strip_first_containing_name(std::string const &key)
parameter set interface
T get(std::string const &key) const
Definition: ParameterSet.h:231
void do_set_value(fhicl::ParameterSet const &pset, bool const ) override
std::string name() const
Definition: ParameterBase.h:49
fhicl::ParameterSet pset_
std::string key() const
Definition: ParameterBase.h:44
std::string comment() const
Definition: ParameterBase.h:54