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  {
35  public:
36  ~ParameterDescriptionBase() override;
37 
38  std::string const& label() const { return label_; }
39  ParameterTypes type() const { return type_; }
40  bool isTracked() const { return isTracked_; }
41  bool hasDefault() const { return hasDefault_; }
42 
43  virtual ParameterSetDescription const* parameterSetDescription() const { return nullptr; }
44  virtual ParameterSetDescription * parameterSetDescription() { return nullptr; }
45 
46  protected:
47  void throwParameterWrongTrackiness() const;
48  void throwParameterWrongType() const;
49  void throwMissingRequiredNoDefault() const;
50 
52  ParameterTypes iType,
53  bool isTracked,
54  bool hasDefault,
55  Comment const& iComment
56  );
57 
58  ParameterDescriptionBase(char const* iLabel,
59  ParameterTypes iType,
60  bool isTracked,
61  bool hasDefault,
62  Comment const& iComment
63  );
64 
65  private:
66 
67  void checkAndGetLabelsAndTypes_(std::set<std::string> & usedLabels,
68  std::set<ParameterTypes> & parameterTypes,
69  std::set<ParameterTypes> & wildcardTypes) const override;
70 
72  std::set<std::string> & validatedLabels,
73  bool optional) const override;
74 
75  void writeCfi_(std::ostream & os,
76  bool & startWithComma,
77  int indentation,
78  bool & wroteSomething) const override;
79 
80  bool partiallyExists_(ParameterSet const& pset) const override;
81 
82  int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
83 
84  virtual void writeCfi_(std::ostream & os, int indentation) const = 0;
85 
86  virtual void writeDoc_(std::ostream & os, int indentation) const = 0;
87 
88  void print_(std::ostream & os,
89  bool optional,
90  bool writeToCfi,
91  DocFormatHelper & dfh) const override;
92 
93  virtual void printDefault_(std::ostream & os,
94  bool writeToCfi,
95  DocFormatHelper & dfh) const;
96 
97  void printNestedContent_(std::ostream & os,
98  bool optional,
99  DocFormatHelper & dfh) const override;
100 
102  virtual bool exists_(ParameterSet const& pset, bool isTracked) const = 0;
103 
104  virtual void insertDefault_(ParameterSet & pset) const = 0;
105 
110  };
111 }
112 #endif
void writeCfi_(std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const override
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
virtual void printDefault_(std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) const
bool partiallyExists_(ParameterSet const &pset) const override
virtual bool exists_(ParameterSet const &pset) const =0
void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
virtual bool exists_(ParameterSet const &pset, bool isTracked) const =0
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const override
virtual ParameterSetDescription * parameterSetDescription()
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
virtual void insertDefault_(ParameterSet &pset) const =0
virtual ParameterSetDescription const * parameterSetDescription() const
HLT enums.
ParameterDescriptionBase(std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)
virtual void writeDoc_(std::ostream &os, int indentation) const =0
std::string const & label() const