CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
edm::ParameterWildcard< std::vector< ParameterSet > > Class Template Reference

#include <ParameterWildcard.h>

Inheritance diagram for edm::ParameterWildcard< std::vector< ParameterSet > >:
edm::ParameterWildcardBase edm::ParameterDescriptionNode

Public Member Functions

ParameterDescriptionNodeclone () const override
 
 ParameterWildcard (std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked)
 
 ParameterWildcard (char const *pattern, WildcardValidationCriteria criteria, bool isTracked)
 
 ParameterWildcard (std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked, ParameterSetDescription const &desc)
 
 ParameterWildcard (char const *pattern, WildcardValidationCriteria criteria, bool isTracked, ParameterSetDescription const &desc)
 
 ~ParameterWildcard () override
 
- Public Member Functions inherited from edm::ParameterWildcardBase
WildcardValidationCriteria criteria () const
 
bool isTracked () const
 
ParameterTypes type () const
 
 ~ParameterWildcardBase () override
 
- Public Member Functions inherited from edm::ParameterDescriptionNode
void checkAndGetLabelsAndTypes (std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const
 
std::string const & comment () const
 
bool exists (ParameterSet const &pset) const
 
bool hasNestedContent () const
 
int howManyXORSubNodesExist (ParameterSet const &pset) const
 
 ParameterDescriptionNode ()
 
 ParameterDescriptionNode (Comment const &iComment)
 
bool partiallyExists (ParameterSet const &pset) const
 
void print (std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const
 
void printNestedContent (std::ostream &os, bool optional, DocFormatHelper &dfh) const
 
void setComment (std::string const &value)
 
void setComment (char const *value)
 
void validate (ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const
 
void writeCfi (std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const
 
virtual ~ParameterDescriptionNode ()
 

Private Member Functions

bool exists_ (ParameterSet const &pset) const override
 
bool hasNestedContent_ () const override
 
void printNestedContent_ (std::ostream &os, bool optional, DocFormatHelper &dfh) const override
 
void validate_ (ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
 
void validatePSetVector (std::string const &parameterName, ParameterSet &pset) const
 

Private Attributes

value_ptr< ParameterSetDescriptionpsetDesc_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::ParameterDescriptionNode
static void printSpaces (std::ostream &os, int n)
 
- Protected Member Functions inherited from edm::ParameterWildcardBase
 ParameterWildcardBase (ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)
 
void throwIfInvalidPattern (char const *pattern) const
 
void throwIfInvalidPattern (std::string const &pattern) const
 
void validateMatchingNames (std::vector< std::string > const &matchingNames, std::set< std::string > &validatedLabels, bool optional) const
 
- Protected Attributes inherited from edm::ParameterDescriptionNode
std::string comment_
 

Detailed Description

template<>
class edm::ParameterWildcard< std::vector< ParameterSet > >

Definition at line 93 of file ParameterWildcard.h.

Constructor & Destructor Documentation

edm::ParameterWildcard< std::vector< ParameterSet > >::ParameterWildcard ( std::string const &  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked 
)

Definition at line 116 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

121  }
value_ptr< ParameterSetDescription > psetDesc_
WildcardValidationCriteria criteria() const
void throwIfInvalidPattern(char const *pattern) const
ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)
edm::ParameterWildcard< std::vector< ParameterSet > >::ParameterWildcard ( char const *  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked 
)

Definition at line 123 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

128  }
value_ptr< ParameterSetDescription > psetDesc_
WildcardValidationCriteria criteria() const
void throwIfInvalidPattern(char const *pattern) const
ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)
edm::ParameterWildcard< std::vector< ParameterSet > >::ParameterWildcard ( std::string const &  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked,
ParameterSetDescription const &  desc 
)

Definition at line 130 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

136  }
value_ptr< ParameterSetDescription > psetDesc_
WildcardValidationCriteria criteria() const
void throwIfInvalidPattern(char const *pattern) const
ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)
edm::ParameterWildcard< std::vector< ParameterSet > >::ParameterWildcard ( char const *  pattern,
WildcardValidationCriteria  criteria,
bool  isTracked,
ParameterSetDescription const &  desc 
)

Definition at line 138 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

144  }
value_ptr< ParameterSetDescription > psetDesc_
WildcardValidationCriteria criteria() const
void throwIfInvalidPattern(char const *pattern) const
ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)
edm::ParameterWildcard< std::vector< ParameterSet > >::~ParameterWildcard ( )
override

Definition at line 146 of file ParameterWildcard.cc.

146 {}

Member Function Documentation

ParameterDescriptionNode * edm::ParameterWildcard< std::vector< ParameterSet > >::clone ( void  ) const
overridevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 148 of file ParameterWildcard.cc.

References edm::ParameterWildcard< T >::ParameterWildcard().

148  {
149  return new ParameterWildcard(*this);
150  }
ParameterWildcard(std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked)
bool edm::ParameterWildcard< std::vector< ParameterSet > >::exists_ ( ParameterSet const &  pset) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 209 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::criteria(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterWildcardBase::isTracked(), edm::RequireAtLeastOne, edm::RequireZeroOrMore, and mitigatedMETSequence_cff::U.

209  {
210  if (criteria() == RequireZeroOrMore)
211  return true;
212 
213  std::vector<std::string> parameterNames = pset.getParameterNamesForType<std::vector<ParameterSet> >(isTracked());
214 
215  if (criteria() == RequireAtLeastOne)
216  return !parameterNames.empty();
217  return parameterNames.size() == 1U;
218  }
WildcardValidationCriteria criteria() const
bool edm::ParameterWildcard< std::vector< ParameterSet > >::hasNestedContent_ ( ) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 176 of file ParameterWildcard.cc.

176  {
177  if (psetDesc_)
178  return true;
179  return false;
180  }
value_ptr< ParameterSetDescription > psetDesc_
void edm::ParameterWildcard< std::vector< ParameterSet > >::printNestedContent_ ( std::ostream &  os,
bool  optional,
DocFormatHelper dfh 
) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 182 of file ParameterWildcard.cc.

References edm::DocFormatHelper::brief(), edm::DocFormatHelper::counter(), edm::DocFormatHelper::indentation(), edm::DocFormatHelper::offsetSectionContent(), edm::DocFormatHelper::OTHER, edm::DocFormatHelper::parent(), edm::ParameterDescriptionNode::printSpaces(), edm::DocFormatHelper::section(), edm::DocFormatHelper::setIndentation(), edm::DocFormatHelper::setParent(), edm::DocFormatHelper::setSection(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::DocFormatHelper::TOP.

184  {
185  int indentation = dfh.indentation();
186  if (dfh.parent() != DocFormatHelper::TOP) {
187  indentation -= DocFormatHelper::offsetSectionContent();
188  }
189 
190  printSpaces(os, indentation);
191  os << "Section " << dfh.section() << "." << dfh.counter()
192  << " description used to validate all PSets which are in the VPSet matching the wildcard:";
193  os << "\n";
194  if (!dfh.brief())
195  os << "\n";
196 
197  std::stringstream ss;
198  ss << dfh.section() << "." << dfh.counter();
199  std::string newSection = ss.str();
200 
201  DocFormatHelper new_dfh(dfh);
202  new_dfh.setSection(newSection);
203  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
204  new_dfh.setParent(DocFormatHelper::OTHER);
205 
206  psetDesc_->print(os, new_dfh);
207  }
static int offsetSectionContent()
value_ptr< ParameterSetDescription > psetDesc_
static void printSpaces(std::ostream &os, int n)
void edm::ParameterWildcard< std::vector< ParameterSet > >::validate_ ( ParameterSet pset,
std::set< std::string > &  validatedLabels,
bool  optional 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 152 of file ParameterWildcard.cc.

References edm::for_all(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterWildcardBase::isTracked(), and edm::ParameterWildcardBase::validateMatchingNames().

154  {
155  std::vector<std::string> parameterNames = pset.getParameterNamesForType<std::vector<ParameterSet> >(isTracked());
156  validateMatchingNames(parameterNames, validatedLabels, optional);
157 
158  if (psetDesc_) {
159  for_all(parameterNames,
160  std::bind(&ParameterWildcard<std::vector<ParameterSet> >::validatePSetVector,
161  this,
162  std::placeholders::_1,
163  std::ref(pset)));
164  }
165  }
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
value_ptr< ParameterSetDescription > psetDesc_
void validatePSetVector(std::string const &parameterName, ParameterSet &pset) const
void validateMatchingNames(std::vector< std::string > const &matchingNames, std::set< std::string > &validatedLabels, bool optional) const
ParameterWildcard(std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked)
void edm::ParameterWildcard< std::vector< ParameterSet > >::validatePSetVector ( std::string const &  parameterName,
ParameterSet pset 
) const
private

Definition at line 167 of file ParameterWildcard.cc.

References edm::ParameterSet::getPSetVectorForUpdate(), mps_fire::i, edm::VParameterSetEntry::psetInVector(), and edm::VParameterSetEntry::size().

168  {
169  VParameterSetEntry* vpsetEntry = pset.getPSetVectorForUpdate(parameterName);
170  assert(vpsetEntry);
171  for (unsigned i = 0; i < vpsetEntry->size(); ++i) {
172  psetDesc_->validate(vpsetEntry->psetInVector(i));
173  }
174  }
value_ptr< ParameterSetDescription > psetDesc_

Member Data Documentation

Definition at line 122 of file ParameterWildcard.h.