CMS 3D CMS Logo

ConfigurationDescriptions.h
Go to the documentation of this file.
1 #ifndef FWCore_ParameterSet_ConfigurationDescriptions_h
2 #define FWCore_ParameterSet_ConfigurationDescriptions_h
3 // -*- C++ -*-
4 //
5 // Package: ParameterSet
6 // Class : ConfigurationDescriptions
7 //
13 //
14 // Original Author: W. David Dagenhart
15 // Created: 17 December 2008
16 //
17 
19 
20 #include <vector>
21 #include <set>
22 #include <string>
23 #include <utility>
24 #include <iosfwd>
25 
26 namespace edm {
27 
29  public:
30 
31  typedef std::vector<std::pair<std::string, ParameterSetDescription> >::iterator iterator;
32 
33  //NOTE: This does not take ownership of the PreValidatorBase instance so
34  // this instance must remain valid for as long as the ConfigurationDescriptions
35  // is being modified
36  ConfigurationDescriptions(std::string const& baseType);
37 
39 
40  // ---------------------------------------------------------
41  // These functions are used by module developers to create
42  // a description for a module.
43  // ---------------------------------------------------------
44 
45  std::string const& comment() const { return comment_; }
46  void setComment(std::string const & value);
47  void setComment(char const* value);
48 
49  void add(std::string const& label, ParameterSetDescription const& psetDescription);
50  void add(char const* label, ParameterSetDescription const& psetDescription);
51 
52  void addDefault(ParameterSetDescription const& psetDescription);
53 
56  iterator begin();
57  iterator end();
58 
59  // ---------------------------------------------------------
60  // These functions use the information in the descriptions
61  // ---------------------------------------------------------
62 
63  void validate(ParameterSet & pset, std::string const& moduleLabel) const;
64 
65  void writeCfis(std::string const& baseType,
66  std::string const& pluginName,
67  std::set<std::string>& usedCfiFileNames) const;
68 
69  void print(std::ostream & os,
70  std::string const& moduleLabel,
71  bool brief,
72  bool printOnlyLabels,
73  size_t lineWidth,
74  int indentation,
75  int iPlugin) const;
76 
77  // ---------------------------------------------------------
78 
79  private:
80 
82  public:
83  int iPlugin;
85  int iModule;
86  };
87 
88  static void writeCfiForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
89  std::string const& baseType,
90  std::string const& pluginName,
91  std::set<std::string>& usedCfiFileNames);
92 
93  void printForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
94  std::ostream & os,
95  std::string const& moduleLabel,
96  bool brief,
97  bool printOnlyLabels,
98  size_t lineWidth,
99  int indentationn,
100  DescriptionCounter & counter) const;
101 
102  void printForLabel(std::ostream & os,
103  std::string const& label,
105  std::string const& moduleLabel,
106  bool brief,
107  bool printOnlyLabels,
108  size_t lineWidth,
109  int indentationn,
110  DescriptionCounter & counter) const;
111 
113 
114  std::vector<std::pair<std::string, ParameterSetDescription> > descriptions_;
115 
117 
120  };
121 }
122 
123 #endif
static void writeCfiForLabel(std::pair< std::string, ParameterSetDescription > const &labelAndDesc, std::string const &baseType, std::string const &pluginName, std::set< std::string > &usedCfiFileNames)
void printForLabel(std::pair< std::string, ParameterSetDescription > const &labelAndDesc, std::ostream &os, std::string const &moduleLabel, bool brief, bool printOnlyLabels, size_t lineWidth, int indentationn, DescriptionCounter &counter) const
ParameterSetDescription * defaultDescription()
Returns 0 if no default has been assigned.
ConfigurationDescriptions(std::string const &baseType)
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< std::pair< std::string, ParameterSetDescription > > descriptions_
void writeCfis(std::string const &baseType, std::string const &pluginName, std::set< std::string > &usedCfiFileNames) const
Definition: value.py:1
void setComment(std::string const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
void print(std::ostream &os, std::string const &moduleLabel, bool brief, bool printOnlyLabels, size_t lineWidth, int indentation, int iPlugin) const
void validate(ParameterSet &pset, std::string const &moduleLabel) const
std::string const & comment() const
std::vector< std::pair< std::string, ParameterSetDescription > >::iterator iterator