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, bool& startWithComma, int indentation, bool& wroteSomething) const override;
64 
65  bool partiallyExists_(ParameterSet const& pset) const override;
66 
67  int howManyXORSubNodesExist_(ParameterSet const& pset) const override;
68 
69  virtual void writeCfi_(std::ostream& os, int indentation) const = 0;
70 
71  virtual void writeDoc_(std::ostream& os, int indentation) const = 0;
72 
73  void print_(std::ostream& os, bool optional, bool writeToCfi, DocFormatHelper& dfh) const override;
74 
75  virtual void printDefault_(std::ostream& os, bool writeToCfi, DocFormatHelper& dfh) const;
76 
77  void printNestedContent_(std::ostream& os, bool optional, DocFormatHelper& dfh) const override;
78 
80  virtual bool exists_(ParameterSet const& pset, bool isTracked) const = 0;
81 
82  virtual void insertDefault_(ParameterSet& pset) const = 0;
83 
86  bool isTracked_;
88  };
89 } // namespace edm
90 #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