CMS 3D CMS Logo

ParameterSwitchBase.h
Go to the documentation of this file.
1 #ifndef FWCore_ParameterSet_ParameterSwitchBase_h
2 #define FWCore_ParameterSet_ParameterSwitchBase_h
3 
6 
7 #include <string>
8 #include <set>
9 #include <utility>
10 #include <iosfwd>
11 
12 namespace edm {
13 
14  class DocFormatHelper;
15 
17  public:
18  ~ParameterSwitchBase() override;
19 
20  protected:
21  void insertAndCheckLabels(std::string const& switchLabel,
22  std::set<std::string>& usedLabels,
23  std::set<std::string>& labels) const;
24 
25  void insertAndCheckTypes(ParameterTypes switchType,
26  std::set<ParameterTypes> const& caseParameterTypes,
27  std::set<ParameterTypes> const& caseWildcardTypes,
28  std::set<ParameterTypes>& parameterTypes,
29  std::set<ParameterTypes>& wildcardTypes) const;
30 
31  void throwDuplicateCaseValues(std::string const& switchLabel) const;
32 
33  void throwNoCaseForDefault(std::string const& switchLabel) const;
34 
35  void throwNoCaseForSwitchValue(std::string const& message) const;
36 
37  void printBase(std::ostream& os,
38  bool optional,
39  bool writeToCfi,
40  DocFormatHelper& dfh,
41  std::string const& switchLabel,
42  bool isTracked,
43  std::string const& typeString) const;
44 
45  bool hasNestedContent_() const override;
46 
47  void printNestedContentBase(std::ostream& os,
48  DocFormatHelper& dfh,
49  DocFormatHelper& new_dfh,
50  std::string const& switchLabel) const;
51 
52  template <typename T>
53  static void printCaseT(std::pair<T, edm::value_ptr<ParameterDescriptionNode> > const& p,
54  std::ostream& os,
55  bool optional,
56  DocFormatHelper& dfh,
57  std::string const& switchLabel) {
58  ParameterSwitchBase::printCase(p, os, optional, dfh, switchLabel);
59  }
60 
61  private:
62  static void printCase(std::pair<bool, edm::value_ptr<ParameterDescriptionNode> > const& p,
63  std::ostream& os,
64  bool optional,
65  DocFormatHelper& dfh,
66  std::string const& switchLabel);
67 
68  static void printCase(std::pair<int, edm::value_ptr<ParameterDescriptionNode> > const& p,
69  std::ostream& os,
70  bool optional,
71  DocFormatHelper& dfh,
72  std::string const& switchLabel);
73 
74  static void printCase(std::pair<std::string, edm::value_ptr<ParameterDescriptionNode> > const& p,
75  std::ostream& os,
76  bool optional,
77  DocFormatHelper& dfh,
78  std::string const& switchLabel);
79 
80  bool partiallyExists_(ParameterSet const& pset) const override;
81 
82  int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
83  };
84 } // namespace edm
85 
86 #endif
edm::ParameterSwitchBase::throwNoCaseForSwitchValue
void throwNoCaseForSwitchValue(std::string const &message) const
Definition: ParameterSwitchBase.cc:57
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
edm::ParameterSwitchBase::partiallyExists_
bool partiallyExists_(ParameterSet const &pset) const override
Definition: ParameterSwitchBase.cc:228
edm::ParameterSwitchBase::howManyXORSubNodesExist_
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
Definition: ParameterSwitchBase.cc:230
edm::ParameterTypes
ParameterTypes
Definition: ParameterDescriptionNode.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Types.optional
optional
Definition: Types.py:167
edm::ParameterSwitchBase::~ParameterSwitchBase
~ParameterSwitchBase() override
Definition: ParameterSwitchBase.cc:13
edm::DocFormatHelper
Definition: DocFormatHelper.h:15
ParameterDescriptionNode.h
edm::ParameterSwitchBase::printNestedContentBase
void printNestedContentBase(std::ostream &os, DocFormatHelper &dfh, DocFormatHelper &new_dfh, std::string const &switchLabel) const
Definition: ParameterSwitchBase.cc:138
value_ptr.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSwitchBase::insertAndCheckLabels
void insertAndCheckLabels(std::string const &switchLabel, std::set< std::string > &usedLabels, std::set< std::string > &labels) const
Definition: ParameterSwitchBase.cc:21
edm::ParameterSwitchBase::hasNestedContent_
bool hasNestedContent_() const override
Definition: ParameterSwitchBase.cc:136
edm::ParameterSet
Definition: ParameterSet.h:36
edm::value_ptr
Definition: value_ptr.h:63
edm::ParameterSwitchBase::throwDuplicateCaseValues
void throwDuplicateCaseValues(std::string const &switchLabel) const
Definition: ParameterSwitchBase.cc:15
edm::ParameterSwitchBase::insertAndCheckTypes
void insertAndCheckTypes(ParameterTypes switchType, std::set< ParameterTypes > const &caseParameterTypes, std::set< ParameterTypes > const &caseWildcardTypes, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const
Definition: ParameterSwitchBase.cc:34
edm::ParameterSwitchBase::printBase
void printBase(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh, std::string const &switchLabel, bool isTracked, std::string const &typeString) const
Definition: ParameterSwitchBase.cc:61
edm::ParameterSwitchBase
Definition: ParameterSwitchBase.h:16
T
long double T
Definition: Basic3DVectorLD.h:48
edm::ParameterSwitchBase::throwNoCaseForDefault
void throwNoCaseForDefault(std::string const &switchLabel) const
Definition: ParameterSwitchBase.cc:50
edm::ParameterSwitchBase::printCase
static void printCase(std::pair< bool, edm::value_ptr< ParameterDescriptionNode > > const &p, std::ostream &os, bool optional, DocFormatHelper &dfh, std::string const &switchLabel)
Definition: ParameterSwitchBase.cc:169
edm::ParameterDescriptionNode
Definition: ParameterDescriptionNode.h:82
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::ParameterSwitchBase::printCaseT
static void printCaseT(std::pair< T, edm::value_ptr< ParameterDescriptionNode > > const &p, std::ostream &os, bool optional, DocFormatHelper &dfh, std::string const &switchLabel)
Definition: ParameterSwitchBase.h:53