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  public:
26  : AllowedLabelsDescriptionBase(label, ParameterTypeToEnum::toEnum<T>(), isTracked) {}
27 
29  : AllowedLabelsDescriptionBase(label, ParameterTypeToEnum::toEnum<T>(), isTracked) {}
30 
32 
33  ParameterDescriptionNode* clone() const override { return new AllowedLabelsDescription(*this); }
34 
35  private:
36  void validateAllowedLabel_(std::string const& allowedLabel,
38  std::set<std::string>& validatedLabels) const override {
39  if (pset.existsAs<T>(allowedLabel, isTracked())) {
40  validatedLabels.insert(allowedLabel);
41  }
42  }
43  };
44 
45  template <>
47  public:
49 
50  AllowedLabelsDescription(char const* label, bool isTracked);
51 
52  AllowedLabelsDescription(std::string const& label, ParameterSetDescription const& value, bool isTracked);
53 
54  AllowedLabelsDescription(char const* label, ParameterSetDescription const& value, bool isTracked);
55 
56  ~AllowedLabelsDescription() override;
57 
58  ParameterDescriptionNode* clone() const override;
59 
60  private:
61  void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& helper) const override;
62 
63  void validateAllowedLabel_(std::string const& allowedLabel,
65  std::set<std::string>& validatedLabels) const override;
66 
68  };
69 
70  template <>
71  class AllowedLabelsDescription<std::vector<ParameterSet> > : public AllowedLabelsDescriptionBase {
72  public:
74 
75  AllowedLabelsDescription(char const* label, bool isTracked);
76 
77  AllowedLabelsDescription(std::string const& label, ParameterSetDescription const& value, bool isTracked);
78 
79  AllowedLabelsDescription(char const* label, ParameterSetDescription const& value, bool isTracked);
80 
81  ~AllowedLabelsDescription() override;
82 
83  ParameterDescriptionNode* clone() const override;
84 
85  private:
86  void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& helper) const override;
87 
88  void validateAllowedLabel_(std::string const& allowedLabel,
90  std::set<std::string>& validatedLabels) const override;
91 
93  };
94 } // namespace edm
95 #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:161
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