LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ParameterMetadata.h
Go to the documentation of this file.
1 #ifndef fhiclcpp_types_detail_ParameterMetadata_h
2 #define fhiclcpp_types_detail_ParameterMetadata_h
3 
5 #include "fhiclcpp/types/Name.h"
9 
10 #include <string>
11 
12 namespace fhicl {
13  namespace detail {
14 
15  class ParameterBase;
16 
18  public:
19  ParameterMetadata() = default;
20 
22  Comment const& comment = Comment(""),
23  par_style const parStyle = par_style::NTYPES,
24  par_type const parType = par_type::NTYPES)
26  , name_{name.value}
27  , comment_{comment.value}
28  , parStyle_{parStyle}
29  , parType_{parType}
30  {}
31 
32  std::string
33  key() const
34  {
35  return key_;
36  }
37  std::string
38  name() const
39  {
40  return name_;
41  }
42  std::string
43  comment() const
44  {
45  return comment_;
46  }
47 
48  bool
49  has_default() const
50  {
51  return parStyle_ == par_style::DEFAULT ||
53  }
54 
55  bool
56  is_optional() const
57  {
58  return parStyle_ == par_style::OPTIONAL ||
60  }
61 
62  bool
64  {
68  }
69 
70  par_type
71  type() const
72  {
73  return parType_;
74  }
75 
76  void
77  set_key(std::string const& key)
78  {
79  key_ = key;
81  }
82 
83  void
85  {
86  parStyle_ = vt;
87  }
88 
89  private:
90  std::string key_{};
91  std::string name_{};
92  std::string comment_{};
95  };
96  }
97 }
98 
99 #endif /* fhiclcpp_types_detail_ParameterMetadata_h */
100 
101 // Local variables:
102 // mode: c++
103 // End:
static NameStackRegistry & instance()
ParameterMetadata(Name const &name=Name(), Comment const &comment=Comment(""), par_style const parStyle=par_style::NTYPES, par_type const parType=par_type::NTYPES)
parameter set interface
void set_key(std::string const &key)
std::string full_key(std::string const &key)
std::string strip_all_containing_names(std::string const &key)
void set_par_style(par_style const vt)