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  typedef std::vector<std::pair<std::string, ParameterSetDescription> >::iterator iterator;
31 
32  //NOTE: This does not take ownership of the PreValidatorBase instance so
33  // this instance must remain valid for as long as the ConfigurationDescriptions
34  // is being modified
35  ConfigurationDescriptions(std::string const& baseType, std::string const& pluginName);
36 
38 
39  // ---------------------------------------------------------
40  // These functions are used by module developers to create
41  // a description for a module.
42  // ---------------------------------------------------------
43 
44  std::string const& comment() const { return comment_; }
45  void setComment(std::string const& value);
46  void setComment(char const* value);
47 
48  void add(std::string const& label, ParameterSetDescription const& psetDescription);
49  void add(char const* label, ParameterSetDescription const& psetDescription);
50  void addWithDefaultLabel(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::set<std::string>& usedCfiFileNames) const;
66 
67  void print(std::ostream& os,
68  std::string const& moduleLabel,
69  bool brief,
70  bool printOnlyLabels,
71  size_t lineWidth,
72  int indentation,
73  int iPlugin) const;
74 
75  // ---------------------------------------------------------
76 
77  private:
79  public:
80  int iPlugin;
82  int iModule;
83  };
84 
85  static void writeCfiForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
86  std::string const& baseType,
87  std::string const& pluginName,
88  std::set<std::string>& usedCfiFileNames);
89 
90  void printForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
91  std::ostream& os,
92  std::string const& moduleLabel,
93  bool brief,
94  bool printOnlyLabels,
95  size_t lineWidth,
96  int indentationn,
98 
99  void printForLabel(std::ostream& os,
100  std::string const& label,
102  std::string const& moduleLabel,
103  bool brief,
104  bool printOnlyLabels,
105  size_t lineWidth,
106  int indentationn,
107  DescriptionCounter& counter) const;
108 
111 
112  std::vector<std::pair<std::string, ParameterSetDescription> > descriptions_;
113 
115 
118  };
119 } // namespace edm
120 
121 #endif
ConfigurationDescriptions(std::string const &baseType, std::string const &pluginName)
static void writeCfiForLabel(std::pair< std::string, ParameterSetDescription > const &labelAndDesc, std::string const &baseType, std::string const &pluginName, std::set< std::string > &usedCfiFileNames)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
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.
char const * label
void addDefault(ParameterSetDescription const &psetDescription)
std::vector< std::pair< std::string, ParameterSetDescription > > descriptions_
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
void writeCfis(std::set< std::string > &usedCfiFileNames) const