test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~ParameterDescriptionBase();
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 0; }
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  );
56 
57  ParameterDescriptionBase(char const* iLabel,
58  ParameterTypes iType,
59  bool isTracked,
60  bool hasDefault
61  );
62 
63  private:
64 
65  virtual void checkAndGetLabelsAndTypes_(std::set<std::string> & usedLabels,
66  std::set<ParameterTypes> & parameterTypes,
67  std::set<ParameterTypes> & wildcardTypes) const;
68 
69  virtual void validate_(ParameterSet & pset,
70  std::set<std::string> & validatedLabels,
71  bool optional) const;
72 
73  virtual void writeCfi_(std::ostream & os,
74  bool & startWithComma,
75  int indentation,
76  bool & wroteSomething) const;
77 
78  virtual bool partiallyExists_(ParameterSet const& pset) const;
79 
80  virtual int howManyXORSubNodesExist_(ParameterSet const& pset) const;
81 
82  virtual void writeCfi_(std::ostream & os, int indentation) const = 0;
83 
84  virtual void writeDoc_(std::ostream & os, int indentation) const = 0;
85 
86  virtual void print_(std::ostream & os,
87  bool optional,
88  bool writeToCfi,
89  DocFormatHelper & dfh);
90 
91  virtual void printDefault_(std::ostream & os,
92  bool writeToCfi,
93  DocFormatHelper & dfh);
94 
95  virtual void printNestedContent_(std::ostream & os,
96  bool optional,
97  DocFormatHelper & dfh);
98 
100  virtual bool exists_(ParameterSet const& pset, bool isTracked) const = 0;
101 
102  virtual void insertDefault_(ParameterSet & pset) const = 0;
103 
108  };
109 }
110 #endif
virtual void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const
virtual void printDefault_(std::ostream &os, bool writeToCfi, DocFormatHelper &dfh)
ParameterDescriptionBase(std::string const &iLabel, ParameterTypes iType, bool isTracked, bool hasDefault)
virtual int howManyXORSubNodesExist_(ParameterSet const &pset) const
virtual void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > &parameterTypes, std::set< ParameterTypes > &wildcardTypes) const
virtual ParameterSetDescription * parameterSetDescription()
virtual bool partiallyExists_(ParameterSet const &pset) const
virtual ParameterSetDescription const * parameterSetDescription() const
virtual bool exists_(ParameterSet const &pset, bool isTracked) const =0
virtual void writeCfi_(std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const
virtual void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh)
virtual void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh)
virtual void insertDefault_(ParameterSet &pset) const =0
virtual void writeDoc_(std::ostream &os, int indentation) const =0
virtual bool exists_(ParameterSet const &pset) const =0
std::string const & label() const