CMS 3D CMS Logo

ParameterDescriptionBase.h
Go to the documentation of this file.
1 
2 #ifndef FWCore_ParameterSet_ParameterDescriptionBase_h
3 #define FWCore_ParameterSet_ParameterDescriptionBase_h
4 // -*- C++ -*-
5 //
6 // Package: ParameterSet
7 // Class : ParameterDescriptionBase
8 //
17 //
18 // Original Author: Chris Jones
19 // Created: Thu Aug 2 15:33:46 EDT 2007
20 //
21 
23 
24 #include <string>
25 #include <set>
26 #include <iosfwd>
27 
28 namespace edm {
29 
31  class DocFormatHelper;
32 
34  public:
35  ~ParameterDescriptionBase() override;
36 
37  std::string const& label() const { return label_; }
38  ParameterTypes type() const { return type_; }
39  bool isTracked() const { return isTracked_; }
40  bool hasDefault() const { return hasDefault_; }
41 
42  virtual ParameterSetDescription const* parameterSetDescription() const { return nullptr; }
43  virtual ParameterSetDescription* parameterSetDescription() { return nullptr; }
44 
45  protected:
46  void throwParameterWrongTrackiness() const;
47  void throwParameterWrongType() const;
48  void throwMissingRequiredNoDefault() const;
49 
51  std::string const& iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const& iComment);
52 
54  char const* iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const& iComment);
55 
56  private:
57  void checkAndGetLabelsAndTypes_(std::set<std::string>& usedLabels,
58  std::set<ParameterTypes>& parameterTypes,
59  std::set<ParameterTypes>& wildcardTypes) const override;
60 
61  void validate_(ParameterSet& pset, std::set<std::string>& validatedLabels, bool optional) const override;
62 
63  void writeCfi_(
64  std::ostream& os, bool optional, bool& startWithComma, int indentation, bool& wroteSomething) const override;
65 
66  bool partiallyExists_(ParameterSet const& pset) const override;
67 
68  int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
69 
70  virtual void writeCfi_(std::ostream& os, int indentation) const = 0;
71 
72  virtual void writeDoc_(std::ostream& os, int indentation) const = 0;
73 
74  void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
75 
76  virtual void printDefault_(std::ostream& os, bool writeToCfi, DocFormatHelper& dfh) const;
77 
78  void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override;
79 
81  virtual bool exists_(ParameterSet const& pset, bool isTracked) const = 0;
82 
83  virtual void insertDefault_(ParameterSet& pset) const = 0;
84 
87  bool isTracked_;
89  };
90 } // namespace edm
91 #endif
edm::ParameterDescriptionBase::printNestedContent_
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
Definition: ParameterDescriptionBase.cc:236
edm::ParameterTypes
ParameterTypes
Definition: ParameterDescriptionNode.h:33
edm::ParameterDescriptionBase::label
std::string const & label() const
Definition: ParameterDescriptionBase.h:37
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ParameterDescriptionBase::label_
std::string label_
Definition: ParameterDescriptionBase.h:85
Types.optional
optional
Definition: Types.py:167
edm::ParameterDescriptionBase::throwParameterWrongTrackiness
void throwParameterWrongTrackiness() const
Definition: ParameterDescriptionBase.cc:52
edm::ParameterDescriptionBase::howManyXORSubNodesExist_
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
Definition: ParameterDescriptionBase.cc:252
edm::ParameterDescriptionBase::hasDefault
bool hasDefault() const
Definition: ParameterDescriptionBase.h:40
edm::ParameterDescriptionBase::writeCfi_
void writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, bool &wroteSomething) const override
Definition: ParameterDescriptionBase.cc:121
edm::DocFormatHelper
Definition: DocFormatHelper.h:15
edm::ParameterDescriptionBase::throwMissingRequiredNoDefault
void throwMissingRequiredNoDefault() const
Definition: ParameterDescriptionBase.cc:79
edm::ParameterDescriptionBase::print_
void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
Definition: ParameterDescriptionBase.cc:151
ParameterDescriptionNode.h
edm::ParameterDescriptionBase::throwParameterWrongType
void throwParameterWrongType() const
Definition: ParameterDescriptionBase.cc:67
edm::ParameterDescriptionBase::parameterSetDescription
virtual ParameterSetDescription const * parameterSetDescription() const
Definition: ParameterDescriptionBase.h:42
edm::ParameterDescriptionBase::insertDefault_
virtual void insertDefault_(ParameterSet &pset) const =0
edm::ParameterDescriptionBase::printDefault_
virtual void printDefault_(std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) const
Definition: ParameterDescriptionBase.cc:215
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterDescriptionBase::~ParameterDescriptionBase
~ParameterDescriptionBase() override
Definition: ParameterDescriptionBase.cc:50
edm::ParameterSet
Definition: ParameterSet.h:36
edm::Comment
Definition: ParameterDescriptionNode.h:71
edm::ParameterDescriptionBase::validate_
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
Definition: ParameterDescriptionBase.cc:98
edm::ParameterDescriptionBase::hasDefault_
bool hasDefault_
Definition: ParameterDescriptionBase.h:88
edm::ParameterDescriptionBase::checkAndGetLabelsAndTypes_
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const override
Definition: ParameterDescriptionBase.cc:91
edm::ParameterDescriptionBase::ParameterDescriptionBase
ParameterDescriptionBase(std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)
Definition: ParameterDescriptionBase.cc:24
edm::ParameterDescriptionBase
Definition: ParameterDescriptionBase.h:33
edm::ParameterDescriptionBase::exists_
virtual bool exists_(ParameterSet const &pset, bool isTracked) const =0
edm::ParameterDescriptionBase::type_
ParameterTypes type_
Definition: ParameterDescriptionBase.h:86
edm::ParameterDescriptionBase::isTracked_
bool isTracked_
Definition: ParameterDescriptionBase.h:87
edm::ParameterDescriptionBase::isTracked
bool isTracked() const
Definition: ParameterDescriptionBase.h:39
edm::ParameterDescriptionNode::exists_
virtual bool exists_(ParameterSet const &pset) const =0
ParameterSetDescription
printContent_cfi.indentation
indentation
Definition: printContent_cfi.py:10
edm::ParameterDescriptionBase::partiallyExists_
bool partiallyExists_(ParameterSet const &pset) const override
Definition: ParameterDescriptionBase.cc:250
edm::ParameterDescriptionBase::type
ParameterTypes type() const
Definition: ParameterDescriptionBase.h:38
edm::ParameterDescriptionNode
Definition: ParameterDescriptionNode.h:82
edm::ParameterDescriptionBase::writeDoc_
virtual void writeDoc_(std::ostream &os, int indentation) const =0
edm::ParameterDescriptionBase::parameterSetDescription
virtual ParameterSetDescription * parameterSetDescription()
Definition: ParameterDescriptionBase.h:43
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27