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, std::string const& pluginName);
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  void addWithDefaultLabel(ParameterSetDescription const& psetDescription);
52 
53  void addDefault(ParameterSetDescription const& psetDescription);
54 
57  iterator begin();
58  iterator end();
59 
60  // ---------------------------------------------------------
61  // These functions use the information in the descriptions
62  // ---------------------------------------------------------
63 
64  void validate(ParameterSet & pset, std::string const& moduleLabel) const;
65 
66  void writeCfis(std::set<std::string>& usedCfiFileNames) const;
67 
68  void print(std::ostream & os,
69  std::string const& moduleLabel,
70  bool brief,
71  bool printOnlyLabels,
72  size_t lineWidth,
73  int indentation,
74  int iPlugin) const;
75 
76  // ---------------------------------------------------------
77 
78  private:
79 
81  public:
82  int iPlugin;
84  int iModule;
85  };
86 
87  static void writeCfiForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
88  std::string const& baseType,
89  std::string const& pluginName,
90  std::set<std::string>& usedCfiFileNames);
91 
92  void printForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
93  std::ostream & os,
94  std::string const& moduleLabel,
95  bool brief,
96  bool printOnlyLabels,
97  size_t lineWidth,
98  int indentationn,
99  DescriptionCounter & counter) const;
100 
101  void printForLabel(std::ostream & os,
102  std::string const& label,
104  std::string const& moduleLabel,
105  bool brief,
106  bool printOnlyLabels,
107  size_t lineWidth,
108  int indentationn,
109  DescriptionCounter & counter) const;
110 
113 
114  std::vector<std::pair<std::string, ParameterSetDescription> > descriptions_;
115 
117 
120  };
121 }
122 
123 #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