CMS 3D CMS Logo

AllowedLabelsDescription.cc
Go to the documentation of this file.
1 
5 
6 #include <cassert>
7 
8 namespace edm {
9 
11  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_() {}
12 
14  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_() {}
15 
18  bool isTracked)
19  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_(new ParameterSetDescription(value)) {}
20 
23  bool isTracked)
24  : AllowedLabelsDescriptionBase(label, k_PSet, isTracked), psetDesc_(new ParameterSetDescription(value)) {}
25 
27 
29  return new AllowedLabelsDescription(*this);
30  }
31 
33  bool optional,
34  DocFormatHelper& dfh) const {
36 
37  int indentation = dfh.indentation();
38  if (dfh.parent() != DocFormatHelper::TOP) {
40  }
41 
42  std::stringstream ss;
43  ss << dfh.section() << "." << dfh.counter() << ".1";
44  std::string newSection = ss.str();
45 
46  if (dfh.brief()) {
48  } else {
49  dfh.indent2(os);
50  }
51  os << "see Section " << newSection << "\n";
52  if (!dfh.brief())
53  os << "\n";
54 
56  os << "Section " << newSection << " PSet description:\n";
57  if (!dfh.brief())
58  os << "\n";
59 
60  DocFormatHelper new_dfh(dfh);
61  new_dfh.setSection(newSection);
64 
65  psetDesc_->print(os, new_dfh);
66  }
67 
69  std::string const& allowedLabel, ParameterSet& pset, std::set<std::string>& validatedLabels) const {
70  if (pset.existsAs<ParameterSet>(allowedLabel, isTracked())) {
71  validatedLabels.insert(allowedLabel);
72  if (psetDesc_) {
73  ParameterSet* containedPSet = pset.getPSetForUpdate(allowedLabel);
74  psetDesc_->validate(*containedPSet);
75  }
76  }
77  }
78 
79  // -----------------------------------------------------------------------
80 
82  bool isTracked)
83  : AllowedLabelsDescriptionBase(label, k_VPSet, isTracked), psetDesc_() {}
84 
86  : AllowedLabelsDescriptionBase(label, k_VPSet, isTracked), psetDesc_() {}
87 
90  bool isTracked)
92 
95  bool isTracked)
97 
98  AllowedLabelsDescription<std::vector<ParameterSet> >::~AllowedLabelsDescription() {}
99 
101  return new AllowedLabelsDescription(*this);
102  }
103 
104  void AllowedLabelsDescription<std::vector<ParameterSet> >::printNestedContent_(std::ostream& os,
105  bool optional,
106  DocFormatHelper& dfh) const {
107  printNestedContentBase_(os, optional, dfh);
108 
109  int indentation = dfh.indentation();
110  if (dfh.parent() != DocFormatHelper::TOP) {
112  }
113 
114  std::stringstream ss;
115  ss << dfh.section() << "." << dfh.counter() << ".1";
116  std::string newSection = ss.str();
117 
118  if (dfh.brief()) {
120  } else {
121  dfh.indent2(os);
122  }
123  os << "see Section " << newSection << "\n";
124  if (!dfh.brief())
125  os << "\n";
126 
127  printSpaces(os, indentation);
128  os << "Section " << newSection << " PSet description used to validate all elements of VPSet's:\n";
129  if (!dfh.brief())
130  os << "\n";
131 
132  DocFormatHelper new_dfh(dfh);
133  new_dfh.setSection(newSection);
136 
137  psetDesc_->print(os, new_dfh);
138  }
139 
141  std::string const& allowedLabel, ParameterSet& pset, std::set<std::string>& validatedLabels) const {
142  if (pset.existsAs<std::vector<ParameterSet> >(allowedLabel, isTracked())) {
143  validatedLabels.insert(allowedLabel);
144 
145  if (psetDesc_) {
146  VParameterSetEntry* vpsetEntry = pset.getPSetVectorForUpdate(allowedLabel);
147  assert(vpsetEntry);
148  for (unsigned i = 0; i < vpsetEntry->size(); ++i) {
149  psetDesc_->validate(vpsetEntry->psetInVector(i));
150  }
151  }
152  }
153  }
154 } // namespace edm
void validateAllowedLabel_(std::string const &allowedLabel, ParameterSet &pset, std::set< std::string > &validatedLabels) const override
ParameterDescriptionNode * clone() const override
assert(be >=bs)
void indent2(std::ostream &os) const
char const * label
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
void printNestedContentBase_(std::ostream &os, bool optional, DocFormatHelper &dfh) const
static int offsetSectionContent()
optional
Definition: Types.py:198
Definition: value.py:1
std::string const & section() const
static void printSpaces(std::ostream &os, int n)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
AllowedLabelsDescription(std::string const &label, bool isTracked)
HLT enums.
ParameterSet & psetInVector(int i)
std::vector< ParameterSet >::size_type size() const
void setSection(std::string const &value)
void setParent(DescriptionParent value)
DescriptionParent parent() const
void setIndentation(int value)