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_(std::ostream& os,
64  bool optional,
65  bool& startWithComma,
66  int indentation,
67  CfiOptions&,
68  bool& wroteSomething) const override;
69 
70  void writeLabelValueCfi(std::ostream& os,
71  bool optional,
72  bool& startWithComma,
73  int indentation,
74  CfiOptions&,
75  bool& wroteSomething) const;
76 
77  void writeFullCfi(std::ostream& os,
78  bool optional,
79  bool& startWithComma,
80  int indentation,
81  CfiOptions&,
82  bool& wroteSomething) const;
83 
84  bool partiallyExists_(ParameterSet const& pset) const override;
85 
86  int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
87 
88  virtual void writeCfi_(std::ostream& os, int indentation, CfiOptions&) const = 0;
89 
90  virtual void writeDoc_(std::ostream& os, int indentation) const = 0;
91 
92  void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
93 
94  virtual void printDefault_(std::ostream& os, bool writeToCfi, DocFormatHelper& dfh) const;
95 
96  void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override;
97 
99  virtual bool exists_(ParameterSet const& pset, bool isTracked) const = 0;
100 
101  virtual void insertDefault_(ParameterSet& pset) const = 0;
102 
107  };
108 } // namespace edm
109 #endif
std::string const & label() const
bool partiallyExists_(ParameterSet const &pset) const override
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
virtual ParameterSetDescription const * parameterSetDescription() const
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
void writeLabelValueCfi(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const
void writeFullCfi(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const
void writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething) const override
optional
Definition: Types.py:245
virtual ParameterSetDescription * parameterSetDescription()
void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
virtual bool exists_(ParameterSet const &pset, bool isTracked) const =0
HLT enums.
virtual void insertDefault_(ParameterSet &pset) const =0
ParameterDescriptionBase(std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault, Comment const &iComment)
virtual void writeDoc_(std::ostream &os, int indentation) const =0
virtual void printDefault_(std::ostream &os, bool writeToCfi, DocFormatHelper &dfh) const
virtual bool exists_(ParameterSet const &pset) const =0
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
cfi::CfiOptions CfiOptions
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const override