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
void insertAndCheckTypes(ParameterTypes switchType, std::set< ParameterTypes > const &caseParameterTypes, std::set< ParameterTypes > const &caseWildcardTypes, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
bool partiallyExists_(ParameterSet const &pset) const override
void printNestedContentBase(std::ostream &os, DocFormatHelper &dfh, DocFormatHelper &new_dfh, std::string const &switchLabel) const
void insertAndCheckLabels(std::string const &switchLabel, std::set< std::string > &usedLabels, std::set< std::string > &labels) const
static void printCase(std::pair< bool, edm::value_ptr< ParameterDescriptionNode > > const &p, std::ostream &os, bool optional, DocFormatHelper &dfh, std::string const &switchLabel)
void throwDuplicateCaseValues(std::string const &switchLabel) const
void throwNoCaseForDefault(std::string const &switchLabel) const
void printBase(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh, std::string const &switchLabel, bool isTracked, std::string const &typeString) const
void throwNoCaseForSwitchValue(std::string const &message) const
HLT enums.
bool hasNestedContent_() const override
long double T
static void printCaseT(std::pair< T, edm::value_ptr< ParameterDescriptionNode > > const &p, std::ostream &os, bool optional, DocFormatHelper &dfh, std::string const &switchLabel)