CMS 3D CMS Logo

AllowedLabelsDescription.h
Go to the documentation of this file.
1 
2 #ifndef FWCore_ParameterSet_AllowedLabelsDescription_h
3 #define FWCore_ParameterSet_AllowedLabelsDescription_h
4 
10 
11 #include <string>
12 #include <set>
13 #include <vector>
14 #include <iosfwd>
15 
16 namespace edm {
17 
18  class VParameterSetEntry;
20  class DocFormatHelper;
21 
22  template<class T>
24 
25  public:
27  bool isTracked) :
28  AllowedLabelsDescriptionBase(label, ParameterTypeToEnum::toEnum<T>(), isTracked)
29  {
30  }
31 
33  bool isTracked) :
34  AllowedLabelsDescriptionBase(label, ParameterTypeToEnum::toEnum<T>(), isTracked)
35  {
36  }
37 
39  {
40  }
41 
42  ParameterDescriptionNode* clone() const override {
43  return new AllowedLabelsDescription(*this);
44  }
45 
46  private:
47 
48  void validateAllowedLabel_(std::string const& allowedLabel,
50  std::set<std::string> & validatedLabels) const override {
51  if (pset.existsAs<T>(allowedLabel, isTracked())) {
52  validatedLabels.insert(allowedLabel);
53  }
54  }
55  };
56 
57  template<>
59 
60  public:
62  bool isTracked);
63 
64  AllowedLabelsDescription(char const* label,
65  bool isTracked);
66 
69  bool isTracked);
70 
71  AllowedLabelsDescription(char const* label,
72  ParameterSetDescription const& value,
73  bool isTracked);
74 
75  ~AllowedLabelsDescription() override;
76 
77  ParameterDescriptionNode* clone() const override;
78 
79  private:
80 
81  void printNestedContent_(std::ostream & os,
82  bool optional,
83  DocFormatHelper & helper) const override;
84 
85  void validateAllowedLabel_(std::string const& allowedLabel,
87  std::set<std::string> & validatedLabels) const override;
88 
90  };
91 
92  template<>
93  class AllowedLabelsDescription<std::vector<ParameterSet> > : public AllowedLabelsDescriptionBase {
94 
95  public:
97  bool isTracked);
98 
99  AllowedLabelsDescription(char const* label,
100  bool isTracked);
101 
104  bool isTracked);
105 
106  AllowedLabelsDescription(char const* label,
107  ParameterSetDescription const& value,
108  bool isTracked);
109 
110  ~AllowedLabelsDescription() override;
111 
112  ParameterDescriptionNode* clone() const override;
113 
114  private:
115 
116  void printNestedContent_(std::ostream & os,
117  bool optional,
118  DocFormatHelper & helper) const override;
119 
120  void validateAllowedLabel_(std::string const& allowedLabel,
121  ParameterSet & pset,
122  std::set<std::string> & validatedLabels) const override;
123 
125  };
126 }
127 #endif
ParameterDescriptionNode * clone() const override
Definition: helper.py:1
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:185
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
char const * label
AllowedLabelsDescription(char const *label, bool isTracked)
void validateAllowedLabel_(std::string const &allowedLabel, ParameterSet &pset, std::set< std::string > &validatedLabels) const override
Definition: value.py:1
AllowedLabelsDescription(std::string const &label, bool isTracked)
HLT enums.
long double T