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_(
64  std::ostream& os, bool optional, bool& startWithComma, int indentation, bool& wroteSomething) const override;
65 
66  bool partiallyExists_(ParameterSet const& pset) const override;
67 
68  int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
69 
70  virtual void writeCfi_(std::ostream& os, int indentation) const = 0;
71 
72  virtual void writeDoc_(std::ostream& os, int indentation) const = 0;
73 
74  void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
75 
76  virtual void printDefault_(std::ostream& os, bool writeToCfi, DocFormatHelper& dfh) const;
77 
78  void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override;
79 
81  virtual bool exists_(ParameterSet const& pset, bool isTracked) const = 0;
82 
83  virtual void insertDefault_(ParameterSet& pset) const = 0;
84 
87  bool isTracked_;
89  };
90 } // namespace edm
91 #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 writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, bool &wroteSomething) const override
optional
Definition: Types.py:198
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
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const override