CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~ParameterSwitchBase();
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 
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  virtual bool hasNestedContent_();
46 
47  void printNestedContentBase(std::ostream & os,
48  DocFormatHelper & dfh,
49  DocFormatHelper & new_dfh,
50  std::string const& switchLabel);
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 
63  static void printCase(std::pair<bool, edm::value_ptr<ParameterDescriptionNode> > const& p,
64  std::ostream & os,
65  bool optional,
66  DocFormatHelper & dfh,
67  std::string const& switchLabel);
68 
69  static void printCase(std::pair<int, edm::value_ptr<ParameterDescriptionNode> > const& p,
70  std::ostream & os,
71  bool optional,
72  DocFormatHelper & dfh,
73  std::string const& switchLabel);
74 
75  static void printCase(std::pair<std::string, edm::value_ptr<ParameterDescriptionNode> > const& p,
76  std::ostream & os,
77  bool optional,
78  DocFormatHelper & dfh,
79  std::string const& switchLabel);
80 
81  virtual bool partiallyExists_(ParameterSet const& pset) const;
82 
83  virtual int howManyXORSubNodesExist_(ParameterSet const& pset) const;
84 
85  };
86 }
87 
88 #endif
void insertAndCheckTypes(ParameterTypes switchType, std::set< ParameterTypes > const &caseParameterTypes, std::set< ParameterTypes > const &caseWildcardTypes, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) 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
virtual int howManyXORSubNodesExist_(ParameterSet const &pset) const
void printNestedContentBase(std::ostream &os, DocFormatHelper &dfh, DocFormatHelper &new_dfh, std::string const &switchLabel)
long double T
virtual bool partiallyExists_(ParameterSet const &pset) const
static void printCaseT(std::pair< T, edm::value_ptr< ParameterDescriptionNode > > const &p, std::ostream &os, bool optional, DocFormatHelper &dfh, std::string const &switchLabel)