CMS 3D CMS Logo

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

#include <ParameterWildcard.h>

Inheritance diagram for edm::ParameterWildcard< ParameterSetDescription >:
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 &helper) const override
 
void validate_ (ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
 
void validateDescription (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< ParameterSetDescription >

Definition at line 60 of file ParameterWildcard.h.

Constructor & Destructor Documentation

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

Definition at line 14 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

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

Definition at line 21 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

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

Definition at line 28 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

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

Definition at line 36 of file ParameterWildcard.cc.

References edm::ParameterWildcardBase::throwIfInvalidPattern().

42  }
WildcardValidationCriteria criteria() const
void throwIfInvalidPattern(char const *pattern) const
value_ptr< ParameterSetDescription > psetDesc_
ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)

Definition at line 44 of file ParameterWildcard.cc.

44 {}

Member Function Documentation

ParameterDescriptionNode * edm::ParameterWildcard< ParameterSetDescription >::clone ( void  ) const
overridevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 46 of file ParameterWildcard.cc.

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

46  {
47  return new ParameterWildcard(*this);
48  }
ParameterWildcard(std::string const &pattern, WildcardValidationCriteria criteria, bool isTracked)
bool edm::ParameterWildcard< ParameterSetDescription >::exists_ ( ParameterSet const &  pset) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 103 of file ParameterWildcard.cc.

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

103  {
104  if (criteria() == RequireZeroOrMore)
105  return true;
106 
107  std::vector<std::string> parameterNames = pset.getParameterNamesForType<ParameterSet>(isTracked());
108 
109  if (criteria() == RequireAtLeastOne)
110  return !parameterNames.empty();
111  return parameterNames.size() == 1U;
112  }
WildcardValidationCriteria criteria() const
bool edm::ParameterWildcard< ParameterSetDescription >::hasNestedContent_ ( ) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 71 of file ParameterWildcard.cc.

71  {
72  if (psetDesc_)
73  return true;
74  return false;
75  }
value_ptr< ParameterSetDescription > psetDesc_
void edm::ParameterWildcard< ParameterSetDescription >::printNestedContent_ ( std::ostream &  os,
bool  optional,
DocFormatHelper helper 
) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 77 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.

79  {
80  int indentation = dfh.indentation();
81  if (dfh.parent() != DocFormatHelper::TOP) {
83  }
84 
85  printSpaces(os, indentation);
86  os << "Section " << dfh.section() << "." << dfh.counter() << " description of PSet matching wildcard:";
87  os << "\n";
88  if (!dfh.brief())
89  os << "\n";
90 
91  std::stringstream ss;
92  ss << dfh.section() << "." << dfh.counter();
93  std::string newSection = ss.str();
94 
95  DocFormatHelper new_dfh(dfh);
96  new_dfh.setSection(newSection);
97  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
98  new_dfh.setParent(DocFormatHelper::OTHER);
99 
100  psetDesc_->print(os, new_dfh);
101  }
static int offsetSectionContent()
static void printSpaces(std::ostream &os, int n)
value_ptr< ParameterSetDescription > psetDesc_
void edm::ParameterWildcard< ParameterSetDescription >::validate_ ( ParameterSet pset,
std::set< std::string > &  validatedLabels,
bool  optional 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 50 of file ParameterWildcard.cc.

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

52  {
53  std::vector<std::string> parameterNames = pset.getParameterNamesForType<ParameterSet>(isTracked());
54  validateMatchingNames(parameterNames, validatedLabels, optional);
55 
56  if (psetDesc_) {
57  for_all(parameterNames,
59  this,
60  std::placeholders::_1,
61  std::ref(pset)));
62  }
63  }
void validateDescription(std::string const &parameterName, ParameterSet &pset) const
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
value_ptr< ParameterSetDescription > psetDesc_
void validateMatchingNames(std::vector< std::string > const &matchingNames, std::set< std::string > &validatedLabels, bool optional) const
void edm::ParameterWildcard< ParameterSetDescription >::validateDescription ( std::string const &  parameterName,
ParameterSet pset 
) const
private

Definition at line 65 of file ParameterWildcard.cc.

References edm::ParameterSet::getPSetForUpdate().

66  {
67  ParameterSet* containedPSet = pset.getPSetForUpdate(parameterName);
68  psetDesc_->validate(*containedPSet);
69  }
value_ptr< ParameterSetDescription > psetDesc_

Member Data Documentation

Definition at line 89 of file ParameterWildcard.h.