CMS 3D CMS Logo

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

#include <ParameterDescription.h>

Inheritance diagram for edm::ParameterDescription< ParameterSetDescription >:
edm::ParameterDescriptionBase edm::ParameterDescriptionNode

Public Member Functions

ParameterDescriptionNodeclone () const override
 
 ParameterDescription (std::string const &iLabel, ParameterSetDescription const &value, bool isTracked, Comment const &iComment=Comment())
 
 ParameterDescription (char const *iLabel, ParameterSetDescription const &value, bool isTracked, Comment const &iComment=Comment())
 
ParameterSetDescription const * parameterSetDescription () const override
 
ParameterSetDescriptionparameterSetDescription () override
 
 ~ParameterDescription () override
 
- Public Member Functions inherited from edm::ParameterDescriptionBase
bool hasDefault () const
 
bool isTracked () const
 
std::string const & label () const
 
ParameterTypes type () const
 
 ~ParameterDescriptionBase () 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 exists_ (ParameterSet const &pset, bool isTracked) const override
 
bool hasNestedContent_ () const override
 
void insertDefault_ (ParameterSet &pset) const override
 
void printDefault_ (std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) 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 writeCfi_ (std::ostream &os, int indentation) const override
 
void writeDoc_ (std::ostream &os, int indentation) const override
 

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::ParameterDescriptionBase
 ParameterDescriptionBase (std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)
 
 ParameterDescriptionBase (char const *iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)
 
void throwMissingRequiredNoDefault () const
 
void throwParameterWrongTrackiness () const
 
void throwParameterWrongType () const
 
- Protected Attributes inherited from edm::ParameterDescriptionNode
std::string comment_
 

Detailed Description

template<>
class edm::ParameterDescription< ParameterSetDescription >

Definition at line 194 of file ParameterDescription.h.

Constructor & Destructor Documentation

edm::ParameterDescription< ParameterSetDescription >::ParameterDescription ( std::string const &  iLabel,
ParameterSetDescription const &  value,
bool  isTracked,
Comment const &  iComment = Comment() 
)

Definition at line 27 of file ParameterDescription.cc.

31  : ParameterDescriptionBase(iLabel, k_PSet, isTracked, true, iComment),
Definition: value.py:1
ParameterDescriptionBase(std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)
edm::ParameterDescription< ParameterSetDescription >::ParameterDescription ( char const *  iLabel,
ParameterSetDescription const &  value,
bool  isTracked,
Comment const &  iComment = Comment() 
)

Definition at line 34 of file ParameterDescription.cc.

38  : ParameterDescriptionBase(iLabel, k_PSet, isTracked, true, iComment),
Definition: value.py:1
ParameterDescriptionBase(std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)

Definition at line 41 of file ParameterDescription.cc.

41 {}

Member Function Documentation

ParameterDescriptionNode* edm::ParameterDescription< ParameterSetDescription >::clone ( void  ) const
inlineoverridevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 211 of file ParameterDescription.h.

References muonDTDigis_cfi::pset.

211 { return new ParameterDescription(*this); }
ParameterDescription(std::string const &iLabel, ParameterSetDescription const &value, bool isTracked, Comment const &iComment=Comment())
bool edm::ParameterDescription< ParameterSetDescription >::exists_ ( ParameterSet const &  pset) const
overrideprivatevirtual
bool edm::ParameterDescription< ParameterSetDescription >::exists_ ( ParameterSet const &  pset,
bool  isTracked 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionBase.

Definition at line 134 of file ParameterDescription.cc.

References Exception, and edm::errors::LogicError.

134  {
136  return true;
137  }
bool edm::ParameterDescription< ParameterSetDescription >::hasNestedContent_ ( ) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 85 of file ParameterDescription.cc.

85 { return true; }
void edm::ParameterDescription< ParameterSetDescription >::insertDefault_ ( ParameterSet pset) const
overrideprivatevirtual

Implements edm::ParameterDescriptionBase.

Definition at line 139 of file ParameterDescription.cc.

References Exception, and edm::errors::LogicError.

139  {
141  return;
142  }
ParameterSetDescription const * edm::ParameterDescription< ParameterSetDescription >::parameterSetDescription ( ) const
overridevirtual

Reimplemented from edm::ParameterDescriptionBase.

Definition at line 117 of file ParameterDescription.cc.

117  {
118  return psetDesc_.operator->();
119  }
ParameterSetDescription * edm::ParameterDescription< ParameterSetDescription >::parameterSetDescription ( )
overridevirtual

Reimplemented from edm::ParameterDescriptionBase.

Definition at line 121 of file ParameterDescription.cc.

121  {
122  return psetDesc_.operator->();
123  }
void edm::ParameterDescription< ParameterSetDescription >::printDefault_ ( std::ostream &  os,
bool  writeToCfi,
DocFormatHelper dfh 
) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionBase.

Definition at line 76 of file ParameterDescription.cc.

References edm::DocFormatHelper::counter(), and edm::DocFormatHelper::section().

78  {
79  os << "see Section " << dfh.section() << "." << dfh.counter();
80  if (!writeToCfi)
81  os << " (do not write to cfi)";
82  os << "\n";
83  }
void edm::ParameterDescription< ParameterSetDescription >::printNestedContent_ ( std::ostream &  os,
bool  optional,
DocFormatHelper dfh 
) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 87 of file ParameterDescription.cc.

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

89  {
90  int indentation = dfh.indentation();
91  if (dfh.parent() != DocFormatHelper::TOP) {
93  }
94 
95  std::stringstream ss;
96  ss << dfh.section() << "." << dfh.counter();
97  std::string newSection = ss.str();
98 
99  printSpaces(os, indentation);
100  os << "Section " << newSection << " " << label() << " PSet description:\n";
101  if (!dfh.brief())
102  os << "\n";
103 
104  DocFormatHelper new_dfh(dfh);
105  new_dfh.init();
106  new_dfh.setSection(newSection);
107  if (dfh.parent() == DocFormatHelper::TOP) {
108  new_dfh.setIndentation(indentation + DocFormatHelper::offsetSectionContent());
109  }
110  psetDesc_->print(os, new_dfh);
111  }
static int offsetSectionContent()
static void printSpaces(std::ostream &os, int n)
std::string const & label() const
void edm::ParameterDescription< ParameterSetDescription >::validate_ ( ParameterSet pset,
std::set< std::string > &  validatedLabels,
bool  optional 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 43 of file ParameterDescription.cc.

References edm::ParameterSet::addParameter(), edm::ParameterSet::addUntrackedParameter(), edm::ParameterDescriptionNode::exists(), edm::ParameterSet::exists(), edm::ParameterSet::existsAs(), edm::ParameterSet::getPSetForUpdate(), edm::ParameterSet::insert(), edm::ParameterSet::invalidateRegistration(), edm::ParameterSet::isRegistered(), edm::ParameterDescriptionBase::isTracked(), edm::ParameterDescriptionBase::label(), edm::ParameterDescriptionBase::throwParameterWrongTrackiness(), and edm::ParameterDescriptionBase::throwParameterWrongType().

45  {
46  bool exists = pset.existsAs<ParameterSet>(label(), isTracked());
47 
48  if (exists) {
49  validatedLabels.insert(label());
50  } else if (pset.existsAs<ParameterSet>(label(), !isTracked())) {
52  } else if (pset.exists(label())) {
54  }
55 
56  if (!optional && !exists) {
57  if (isTracked()) {
58  pset.addParameter(label(), ParameterSet());
59  } else {
60  pset.addUntrackedParameter(label(), ParameterSet());
61  }
62  validatedLabels.insert(label());
63  }
64 
65  exists = pset.existsAs<ParameterSet>(label(), isTracked());
66 
67  if (exists) {
68  if (pset.isRegistered()) {
69  pset.invalidateRegistration("");
70  }
71  ParameterSet* containedPSet = pset.getPSetForUpdate(label());
72  psetDesc_->validate(*containedPSet);
73  }
74  }
bool exists(ParameterSet const &pset) const
std::string const & label() const
void edm::ParameterDescription< ParameterSetDescription >::writeCfi_ ( std::ostream &  os,
int  indentation 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionBase.

Definition at line 125 of file ParameterDescription.cc.

125  {
126  bool startWithComma = false;
127  indentation += 2;
128  psetDesc_->writeCfi(os, startWithComma, indentation);
129  }
void edm::ParameterDescription< ParameterSetDescription >::writeDoc_ ( std::ostream &  os,
int  indentation 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionBase.

Definition at line 131 of file ParameterDescription.cc.

131 {}

Member Data Documentation

Definition at line 232 of file ParameterDescription.h.