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 
9 
10 #include <string>
11 #include <set>
12 #include <vector>
13 #include <iosfwd>
14 
15 namespace edm {
16 
17  class VParameterSetEntry;
19  class DocFormatHelper;
20 
21  template<class T>
23 
24  public:
26  bool isTracked) :
27  AllowedLabelsDescriptionBase(label, ParameterTypeToEnum::toEnum<T>(), isTracked)
28  {
29  }
30 
32  bool isTracked) :
33  AllowedLabelsDescriptionBase(label, ParameterTypeToEnum::toEnum<T>(), isTracked)
34  {
35  }
36 
37  ParameterDescriptionNode* clone() const override {
38  return new AllowedLabelsDescription(*this);
39  }
40 
41  private:
42 
43  void validateAllowedLabel_(std::string const& allowedLabel,
45  std::set<std::string> & validatedLabels) const override {
46  if (pset.existsAs<T>(allowedLabel, isTracked())) {
47  validatedLabels.insert(allowedLabel);
48  }
49  }
50  };
51 
52  template<>
54 
55  public:
57  bool isTracked);
58 
59  AllowedLabelsDescription(char const* label,
60  bool isTracked);
61 
64  bool isTracked);
65 
66  AllowedLabelsDescription(char const* label,
67  ParameterSetDescription const& value,
68  bool isTracked);
69 
70  ParameterDescriptionNode* clone() const override;
71 
72  private:
73 
74  void printNestedContent_(std::ostream & os,
75  bool optional,
76  DocFormatHelper & helper) const override;
77 
78  void validateAllowedLabel_(std::string const& allowedLabel,
80  std::set<std::string> & validatedLabels) const override;
81 
83  };
84 
85  template<>
86  class AllowedLabelsDescription<std::vector<ParameterSet> > : public AllowedLabelsDescriptionBase {
87 
88  public:
90  bool isTracked);
91 
92  AllowedLabelsDescription(char const* label,
93  bool isTracked);
94 
97  bool isTracked);
98 
99  AllowedLabelsDescription(char const* label,
100  ParameterSetDescription const& value,
101  bool isTracked);
102 
103  ParameterDescriptionNode* clone() const override;
104 
105  private:
106 
107  void printNestedContent_(std::ostream & os,
108  bool optional,
109  DocFormatHelper & helper) const override;
110 
111  void validateAllowedLabel_(std::string const& allowedLabel,
112  ParameterSet & pset,
113  std::set<std::string> & validatedLabels) const override;
114 
116  };
117 }
118 #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:186
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
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