CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
edm::ParameterDescriptionBase Class Referenceabstract

#include <ParameterDescriptionBase.h>

Inheritance diagram for edm::ParameterDescriptionBase:
edm::ParameterDescriptionNode edm::ParameterDescription< T > edm::ParameterDescription< ParameterSetDescription > edm::ParameterDescription< std::vector< ParameterSet > > edm::ParameterDescription< std::vector< std::string > >

Public Member Functions

bool hasDefault () const
 
bool isTracked () const
 
std::string const & label () const
 
virtual ParameterSetDescription const * parameterSetDescription () const
 
virtual ParameterSetDescriptionparameterSetDescription ()
 
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
 
virtual ParameterDescriptionNodeclone () const =0
 
std::string const & comment () const
 
bool exists (ParameterSet const &pset) const
 
bool hasNestedContent () const
 
int howManyXORSubNodesExist (ParameterSet const &pset) const
 
virtual bool isWildcard () 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 optional, bool &startWithComma, int indentation, CfiOptions &options, bool &wroteSomething) const
 
virtual ~ParameterDescriptionNode ()
 

Protected Member Functions

 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 Member Functions inherited from edm::ParameterDescriptionNode
virtual bool exists_ (ParameterSet const &pset) const =0
 
virtual bool hasNestedContent_ () const
 

Private Member Functions

void checkAndGetLabelsAndTypes_ (std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const override
 
virtual bool exists_ (ParameterSet const &pset) const=0
 
virtual bool exists_ (ParameterSet const &pset, bool isTracked) const =0
 
int howManyXORSubNodesExist_ (ParameterSet const &pset) const override
 
virtual void insertDefault_ (ParameterSet &pset) const =0
 
bool partiallyExists_ (ParameterSet const &pset) const override
 
void print_ (std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
 
virtual void printDefault_ (std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) const
 
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, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const override
 
virtual void writeCfi_ (std::ostream &os, int indentation, CfiOptions &) const =0
 
virtual void writeDoc_ (std::ostream &os, int indentation) const =0
 
void writeFullCfi (std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const
 
void writeLabelValueCfi (std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const
 

Private Attributes

bool hasDefault_
 
bool isTracked_
 
std::string label_
 
ParameterTypes type_
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::ParameterDescriptionNode
static void printSpaces (std::ostream &os, int n)
 
- Protected Attributes inherited from edm::ParameterDescriptionNode
std::string comment_
 

Detailed Description

Definition at line 33 of file ParameterDescriptionBase.h.

Constructor & Destructor Documentation

◆ ~ParameterDescriptionBase()

ParameterDescriptionBase::~ParameterDescriptionBase ( )
override

Definition at line 50 of file ParameterDescriptionBase.cc.

50 {}

◆ ParameterDescriptionBase() [1/2]

ParameterDescriptionBase::ParameterDescriptionBase ( std::string const &  iLabel,
ParameterTypes  iType,
bool  isTracked,
bool  hasDefault,
Comment const &  iComment 
)
protected

Definition at line 24 of file ParameterDescriptionBase.cc.

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

26  : ParameterDescriptionNode(iComment),
27  label_(iLabel),
28  type_(iType),
31  if (label_.empty()) {
32  throw Exception(errors::LogicError) << "Empty string used as a label for a parameter. This is\n"
33  "not allowed.\n";
34  }
35  }

◆ ParameterDescriptionBase() [2/2]

ParameterDescriptionBase::ParameterDescriptionBase ( char const *  iLabel,
ParameterTypes  iType,
bool  isTracked,
bool  hasDefault,
Comment const &  iComment 
)
protected

Definition at line 37 of file ParameterDescriptionBase.cc.

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

39  : ParameterDescriptionNode(iComment),
40  label_(iLabel),
41  type_(iType),
44  if (label_.empty()) {
45  throw Exception(errors::LogicError) << "Empty string used as a label for a parameter. This is\n"
46  "not allowed.\n";
47  }
48  }

Member Function Documentation

◆ checkAndGetLabelsAndTypes_()

void ParameterDescriptionBase::checkAndGetLabelsAndTypes_ ( std::set< std::string > &  usedLabels,
std::set< ParameterTypes > &  parameterTypes,
std::set< ParameterTypes > &  wildcardTypes 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 91 of file ParameterDescriptionBase.cc.

References label(), and type().

93  {
94  usedLabels.insert(label());
95  parameterTypes.insert(type());
96  }
std::string const & label() const

◆ exists_() [1/2]

virtual bool edm::ParameterDescriptionNode::exists_
private

◆ exists_() [2/2]

virtual bool edm::ParameterDescriptionBase::exists_ ( ParameterSet const &  pset,
bool  isTracked 
) const
privatepure virtual

◆ hasDefault()

bool edm::ParameterDescriptionBase::hasDefault ( ) const
inline

◆ howManyXORSubNodesExist_()

int ParameterDescriptionBase::howManyXORSubNodesExist_ ( ParameterSet const &  pset) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 335 of file ParameterDescriptionBase.cc.

References edm::ParameterDescriptionNode::exists(), and muonDTDigis_cfi::pset.

335  {
336  return exists(pset) ? 1 : 0;
337  }
bool exists(ParameterSet const &pset) const

◆ insertDefault_()

virtual void edm::ParameterDescriptionBase::insertDefault_ ( ParameterSet pset) const
privatepure virtual

◆ isTracked()

bool edm::ParameterDescriptionBase::isTracked ( ) const
inline

Definition at line 39 of file ParameterDescriptionBase.h.

References isTracked_.

Referenced by Types.PSet::clone(), Mixins._ParameterTypeBase::configTypeName(), edm::ParameterDescription< std::vector< std::string > >::exists_(), edm::ParameterDescription< ParameterSetDescription >::exists_(), edm::ParameterDescription< std::vector< std::string > >::insertDefault_(), Mixins.UsingBlock::insertInto(), Types.int32::insertInto(), Types.uint32::insertInto(), Types.int64::insertInto(), Types.uint64::insertInto(), Types.double::insertInto(), Types.bool::insertInto(), Types.string::insertInto(), Types.EventID::insertInto(), Types.LuminosityBlockID::insertInto(), Types.LuminosityBlockRange::insertInto(), Types.EventRange::insertInto(), Types.InputTag::insertInto(), Types.ESInputTag::insertInto(), Types.FileInPath::insertInto(), Types.PSet::insertInto(), Types.vint32::insertInto(), Types.vuint32::insertInto(), Types.vint64::insertInto(), Types.vuint64::insertInto(), Types.vdouble::insertInto(), Types.vbool::insertInto(), Types.vstring::insertInto(), Types.VLuminosityBlockID::insertInto(), Types.VInputTag::insertInto(), Types.VESInputTag::insertInto(), Types.VEventID::insertInto(), Types.VLuminosityBlockRange::insertInto(), Types.VEventRange::insertInto(), Types.VPSet::insertInto(), print_(), Mixins._ParameterTypeBase::pythonTypeName(), throwMissingRequiredNoDefault(), throwParameterWrongTrackiness(), throwParameterWrongType(), validate_(), edm::ParameterDescription< ParameterSetDescription >::validate_(), and writeFullCfi().

◆ label()

std::string const& edm::ParameterDescriptionBase::label ( ) const
inline

◆ parameterSetDescription() [1/2]

virtual ParameterSetDescription const* edm::ParameterDescriptionBase::parameterSetDescription ( ) const
inlinevirtual

◆ parameterSetDescription() [2/2]

virtual ParameterSetDescription* edm::ParameterDescriptionBase::parameterSetDescription ( )
inlinevirtual

◆ partiallyExists_()

bool ParameterDescriptionBase::partiallyExists_ ( ParameterSet const &  pset) const
overrideprivatevirtual

◆ print_()

void ParameterDescriptionBase::print_ ( std::ostream &  os,
bool  optional,
bool  writeToCfi,
DocFormatHelper dfh 
) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 234 of file ParameterDescriptionBase.cc.

References edm::DocFormatHelper::brief(), edm::DocFormatHelper::column1(), edm::DocFormatHelper::column2(), edm::DocFormatHelper::column3(), edm::ParameterDescriptionNode::comment(), edm::DocFormatHelper::commentWidth(), relativeConstraints::empty, edm::DocFormatHelper::indent(), edm::DocFormatHelper::indent2(), isTracked(), label(), Types::optional, edm::parameterTypeEnumToString(), edm::DocFormatHelper::pass(), printDefault_(), edm::DocFormatHelper::setAtLeast1(), edm::DocFormatHelper::setAtLeast2(), edm::DocFormatHelper::setAtLeast3(), contentValuesCheck::ss, edm::DocFormatHelper::startColumn2(), type(), mitigatedMETSequence_cff::U, and edm::DocFormatHelper::wrapAndPrintText().

234  {
235  if (dfh.pass() == 0) {
236  dfh.setAtLeast1(label().size());
237  if (isTracked()) {
238  dfh.setAtLeast2(parameterTypeEnumToString(type()).size());
239  } else {
240  dfh.setAtLeast2(parameterTypeEnumToString(type()).size() + 10U);
241  }
242  if (optional) {
243  dfh.setAtLeast3(8U);
244  }
245  } else {
246  if (dfh.brief()) {
247  std::ios::fmtflags oldFlags = os.flags();
248 
249  dfh.indent(os);
250  os << std::left << std::setw(dfh.column1()) << label() << " ";
251 
252  if (isTracked()) {
253  os << std::setw(dfh.column2()) << parameterTypeEnumToString(type());
254  } else {
255  std::stringstream ss;
256  ss << "untracked ";
258  os << std::setw(dfh.column2()) << ss.str();
259  }
260  os << " ";
261 
262  os << std::setw(dfh.column3());
263  if (optional) {
264  os << "optional";
265  } else {
266  os << "";
267  }
268  os << " ";
269  os.flags(oldFlags);
270  printDefault_(os, writeToCfi, dfh);
271  } else {
272  // not brief
273  dfh.indent(os);
274  os << label() << "\n";
275 
276  dfh.indent2(os);
277  os << "type: ";
278  if (!isTracked())
279  os << "untracked ";
280 
281  os << parameterTypeEnumToString(type()) << " ";
282 
283  if (optional)
284  os << "optional";
285  os << "\n";
286 
287  dfh.indent2(os);
288  printDefault_(os, writeToCfi, dfh);
289 
290  if (!comment().empty()) {
291  DocFormatHelper::wrapAndPrintText(os, comment(), dfh.startColumn2(), dfh.commentWidth());
292  }
293  os << "\n";
294  }
295  }
296  }
size
Write out results.
std::string const & label() const
static void wrapAndPrintText(std::ostream &os, std::string const &text, size_t indent, size_t suggestedWidth)
std::string parameterTypeEnumToString(ParameterTypes iType)
optional
Definition: Types.py:245
std::string const & comment() const
virtual void printDefault_(std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) const

◆ printDefault_()

void ParameterDescriptionBase::printDefault_ ( std::ostream &  os,
bool  writeToCfi,
DocFormatHelper dfh 
) const
privatevirtual

Reimplemented in edm::ParameterDescription< std::vector< ParameterSet > >, and edm::ParameterDescription< ParameterSetDescription >.

Definition at line 298 of file ParameterDescriptionBase.cc.

References edm::DocFormatHelper::brief(), edm::DocFormatHelper::counter(), hasDefault(), edm::ParameterDescriptionNode::hasNestedContent(), edm::DocFormatHelper::indentation(), edm::DocFormatHelper::section(), edm::DocFormatHelper::startColumn2(), and writeDoc_().

Referenced by print_().

298  {
299  if (!dfh.brief())
300  os << "default: ";
301  if (writeToCfi && hasDefault()) {
302  if (hasNestedContent()) {
303  os << "see Section " << dfh.section() << "." << dfh.counter();
304  } else {
305  if (dfh.brief()) {
306  writeDoc_(os, dfh.indentation());
307  } else {
308  writeDoc_(os, dfh.startColumn2());
309  }
310  }
311  } else if (!writeToCfi) {
312  os << "none (do not write to cfi)";
313  } else {
314  os << "none";
315  }
316  os << "\n";
317  }
virtual void writeDoc_(std::ostream &os, int indentation) const =0

◆ printNestedContent_()

void ParameterDescriptionBase::printNestedContent_ ( std::ostream &  os,
bool  optional,
DocFormatHelper dfh 
) const
overrideprivatevirtual

Reimplemented from edm::ParameterDescriptionNode.

Definition at line 319 of file ParameterDescriptionBase.cc.

References edm::DocFormatHelper::brief(), edm::DocFormatHelper::counter(), printContent_cfi::indentation, edm::DocFormatHelper::indentation(), label(), edm::DocFormatHelper::offsetSectionContent(), edm::DocFormatHelper::parent(), edm::ParameterDescriptionNode::printSpaces(), edm::DocFormatHelper::section(), edm::DocFormatHelper::TOP, and writeDoc_().

319  {
320  int indentation = dfh.indentation();
321  if (dfh.parent() != DocFormatHelper::TOP) {
323  }
324 
326  os << "Section " << dfh.section() << "." << dfh.counter() << " " << label() << " default contents: ";
327  writeDoc_(os, indentation + 2);
328  os << "\n";
329  if (!dfh.brief())
330  os << "\n";
331  }
std::string const & label() const
static int offsetSectionContent()
static void printSpaces(std::ostream &os, int n)
virtual void writeDoc_(std::ostream &os, int indentation) const =0

◆ throwMissingRequiredNoDefault()

void ParameterDescriptionBase::throwMissingRequiredNoDefault ( ) const
protected

Definition at line 79 of file ParameterDescriptionBase.cc.

References edm::errors::Configuration, Exception, isTracked(), label(), edm::parameterTypeEnumToString(), AlCaHLTBitMon_QueryRunRegistry::string, and type().

Referenced by validate_().

79  {
80  std::string tr("untracked");
81  if (isTracked())
82  tr = "tracked";
83 
85  << "Missing required parameter. It should have label \"" << label() << "\" and have type \"" << tr << " "
86  << parameterTypeEnumToString(type()) << "\".\n"
87  << "The description has no default. The parameter must be defined "
88  "in the configuration\n";
89  }
std::string const & label() const
std::string parameterTypeEnumToString(ParameterTypes iType)

◆ throwParameterWrongTrackiness()

void ParameterDescriptionBase::throwParameterWrongTrackiness ( ) const
protected

Definition at line 52 of file ParameterDescriptionBase.cc.

References edm::errors::Configuration, Exception, isTracked(), label(), edm::parameterTypeEnumToString(), AlCaHLTBitMon_QueryRunRegistry::string, and type().

Referenced by validate_(), and edm::ParameterDescription< ParameterSetDescription >::validate_().

52  {
53  std::string tr("a tracked");
54  std::string shouldBe("untracked");
55  if (isTracked()) {
56  tr = "an untracked";
57  shouldBe = "tracked";
58  }
59 
60  throw Exception(errors::Configuration) << "In the configuration, parameter \"" << label()
61  << "\" is defined "
62  "as "
63  << tr << " " << parameterTypeEnumToString(type()) << ".\n"
64  << "It should be " << shouldBe << ".\n";
65  }
std::string const & label() const
std::string parameterTypeEnumToString(ParameterTypes iType)

◆ throwParameterWrongType()

void ParameterDescriptionBase::throwParameterWrongType ( ) const
protected

Definition at line 67 of file ParameterDescriptionBase.cc.

References edm::errors::Configuration, Exception, isTracked(), label(), edm::parameterTypeEnumToString(), AlCaHLTBitMon_QueryRunRegistry::string, and type().

Referenced by validate_(), and edm::ParameterDescription< ParameterSetDescription >::validate_().

67  {
68  std::string tr("an untracked");
69  if (isTracked())
70  tr = "a tracked";
71 
72  throw Exception(errors::Configuration) << "Parameter \"" << label()
73  << "\" should be defined "
74  "as "
75  << tr << " " << parameterTypeEnumToString(type()) << ".\n"
76  << "The type in the configuration is incorrect.\n";
77  }
std::string const & label() const
std::string parameterTypeEnumToString(ParameterTypes iType)

◆ type()

ParameterTypes edm::ParameterDescriptionBase::type ( ) const
inline

◆ validate_()

void ParameterDescriptionBase::validate_ ( ParameterSet pset,
std::set< std::string > &  validatedLabels,
bool  optional 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 98 of file ParameterDescriptionBase.cc.

References edm::ParameterDescriptionNode::exists(), exists_(), hasDefault(), insertDefault_(), isTracked(), label(), Types::optional, muonDTDigis_cfi::pset, throwMissingRequiredNoDefault(), throwParameterWrongTrackiness(), and throwParameterWrongType().

100  {
101  bool exists = exists_(pset, isTracked());
102 
103  if (exists) {
104  validatedLabels.insert(label());
105  } else if (exists_(pset, !isTracked())) {
107  } else if (pset.exists(label())) {
109  }
110 
111  if (!exists && !optional) {
112  if (hasDefault()) {
114  validatedLabels.insert(label());
115  } else {
117  }
118  }
119  }
std::string const & label() const
optional
Definition: Types.py:245
bool exists(ParameterSet const &pset) const
virtual bool exists_(ParameterSet const &pset, bool isTracked) const =0
virtual void insertDefault_(ParameterSet &pset) const =0

◆ writeCfi_() [1/2]

void ParameterDescriptionBase::writeCfi_ ( std::ostream &  os,
bool  optional,
bool &  startWithComma,
int  indentation,
CfiOptions options,
bool &  wroteSomething 
) const
overrideprivatevirtual

Implements edm::ParameterDescriptionNode.

Definition at line 121 of file ParameterDescriptionBase.cc.

References edm::check(), relativeConstraints::empty, printContent_cfi::indentation, label(), edm::cfi::needToSwitchToTyped(), Types::optional, or, edm::cfi::shouldWriteUntyped(), writeFullCfi(), and writeLabelValueCfi().

Referenced by writeFullCfi(), and writeLabelValueCfi().

126  {
127  if (label().empty() or label()[0] == '@') {
128  return;
129  }
130 
132  if (check.first) {
133  CfiOptions fullOp = cfi::Typed{};
134  writeFullCfi(os, optional, startWithComma, indentation, fullOp, wroteSomething);
135  } else if (shouldWriteUntyped(options)) {
136  writeLabelValueCfi(os, optional, startWithComma, indentation, options, wroteSomething);
137  } else {
138  writeFullCfi(os, optional, startWithComma, indentation, options, wroteSomething);
139  }
140  }
bool shouldWriteUntyped(CfiOptions const &iOps) noexcept
std::string const & label() const
void writeLabelValueCfi(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const
void writeFullCfi(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
optional
Definition: Types.py:245
static void check(T const &p, std::string const &id, SelectedProducts const &iProducts, bool iVerbose)
std::pair< bool, NodeGuard > needToSwitchToTyped(std::string_view iNode, CfiOptions &iOpt) noexcept
cfi::CfiOptions CfiOptions

◆ writeCfi_() [2/2]

virtual void edm::ParameterDescriptionBase::writeCfi_ ( std::ostream &  os,
int  indentation,
CfiOptions  
) const
privatepure virtual

◆ writeDoc_()

virtual void edm::ParameterDescriptionBase::writeDoc_ ( std::ostream &  os,
int  indentation 
) const
privatepure virtual

◆ writeFullCfi()

void ParameterDescriptionBase::writeFullCfi ( std::ostream &  os,
bool  optional,
bool &  startWithComma,
int  indentation,
CfiOptions options,
bool &  wroteSomething 
) const
private

Definition at line 201 of file ParameterDescriptionBase.cc.

References hasDefault(), printContent_cfi::indentation, isTracked(), label(), Types::optional, edm::parameterTypeEnumToString(), edm::ParameterDescriptionNode::printSpaces(), type(), and writeCfi_().

Referenced by writeCfi_().

206  {
207  wroteSomething = true;
208  if (startWithComma)
209  os << ",";
210  startWithComma = true;
211 
212  os << "\n";
214 
215  os << label() << " = cms.";
216 
217  if (!hasDefault()) {
218  if (optional) {
219  os << "optional.";
220  } else {
221  os << "required.";
222  }
223  if (!isTracked())
224  os << "untracked.";
226  } else {
227  if (!isTracked())
228  os << "untracked.";
229  os << parameterTypeEnumToString(type()) << "(";
231  os << ")";
232  }
233  }
std::string const & label() const
std::string parameterTypeEnumToString(ParameterTypes iType)
void writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const override
optional
Definition: Types.py:245
static void printSpaces(std::ostream &os, int n)

◆ writeLabelValueCfi()

void ParameterDescriptionBase::writeLabelValueCfi ( std::ostream &  os,
bool  optional,
bool &  startWithComma,
int  indentation,
CfiOptions options,
bool &  wroteSomething 
) const
private

Definition at line 142 of file ParameterDescriptionBase.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), hasDefault(), printContent_cfi::indentation, edm::k_ESInputTag, edm::k_EventID, edm::k_EventRange, edm::k_InputTag, edm::k_LuminosityBlockID, edm::k_LuminosityBlockRange, edm::k_PSet, edm::k_vdouble, edm::k_VESInputTag, edm::k_VEventID, edm::k_VEventRange, edm::k_VInputTag, edm::k_vint32, edm::k_vint64, edm::k_VLuminosityBlockID, edm::k_VLuminosityBlockRange, edm::k_VPSet, edm::k_vstringRaw, edm::k_vuint32, edm::k_vuint64, label(), edm::ParameterDescriptionNode::printSpaces(), type(), and writeCfi_().

Referenced by writeCfi_().

147  {
148  constexpr std::string_view k_endList = "]";
149  constexpr std::string_view k_endParenthesis = ")";
150  constexpr std::string_view k_endBasicType = "";
151  if (not hasDefault()) {
152  return;
153  }
154  wroteSomething = true;
155  if (startWithComma)
156  os << ",";
157  startWithComma = true;
158  os << "\n";
160 
161  os << label() << " = ";
162  std::string_view endDelimiter = k_endBasicType;
163  switch (type()) {
164  case k_vdouble:
165  case k_vint32:
166  case k_vint64:
167  case k_vstringRaw:
168  case k_vuint32:
169  case k_vuint64:
170  case k_VESInputTag:
171  case k_VEventID:
172  case k_VEventRange:
173  case k_VInputTag:
176  case k_VPSet:
177  os << "[";
178  endDelimiter = k_endList;
179  break;
180  case k_PSet:
181  os << "dict(";
182  endDelimiter = k_endParenthesis;
183  break;
184  case k_EventID:
185  case k_EventRange:
186  case k_ESInputTag:
187  case k_InputTag:
188  case k_LuminosityBlockID:
190  os << "(";
191  endDelimiter = k_endParenthesis;
192  break;
193  default:
194  break;
195  }
197  os << endDelimiter;
198  return;
199  }
std::string const & label() const
void writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const override
static void printSpaces(std::ostream &os, int n)

Member Data Documentation

◆ hasDefault_

bool edm::ParameterDescriptionBase::hasDefault_
private

Definition at line 106 of file ParameterDescriptionBase.h.

Referenced by hasDefault().

◆ isTracked_

bool edm::ParameterDescriptionBase::isTracked_
private

Definition at line 105 of file ParameterDescriptionBase.h.

Referenced by isTracked().

◆ label_

std::string edm::ParameterDescriptionBase::label_
private

◆ type_

ParameterTypes edm::ParameterDescriptionBase::type_
private