CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ParameterDescriptionNode* clone() const {
38  return new AllowedLabelsDescription(*this);
39  }
40 
41  private:
42 
43  virtual void validateAllowedLabel_(std::string const& allowedLabel,
44  ParameterSet & pset,
45  std::set<std::string> & validatedLabels) const {
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  virtual ParameterDescriptionNode* clone() const;
71 
72  private:
73 
74  virtual void printNestedContent_(std::ostream & os,
75  bool optional,
76  DocFormatHelper & helper);
77 
78  virtual void validateAllowedLabel_(std::string const& allowedLabel,
79  ParameterSet & pset,
80  std::set<std::string> & validatedLabels) const;
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  virtual ParameterDescriptionNode* clone() const;
104 
105  private:
106 
107  virtual void printNestedContent_(std::ostream & os,
108  bool optional,
109  DocFormatHelper & helper);
110 
111  virtual void validateAllowedLabel_(std::string const& allowedLabel,
112  ParameterSet & pset,
113  std::set<std::string> & validatedLabels) const;
114 
116  };
117 }
118 #endif
virtual ParameterDescriptionNode * clone() const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:187
virtual void validateAllowedLabel_(std::string const &allowedLabel, ParameterSet &pset, std::set< std::string > &validatedLabels) const
AllowedLabelsDescription(char const *label, bool isTracked)
AllowedLabelsDescription(std::string const &label, bool isTracked)
virtual void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh)
long double T