CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 <string>
22 #include <utility>
23 #include <iosfwd>
24 
25 namespace edm {
26 
28  public:
29 
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);
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 
51  void addDefault(ParameterSetDescription const& psetDescription);
52 
55  iterator begin();
56  iterator end();
57 
58  // ---------------------------------------------------------
59  // These functions use the information in the descriptions
60  // ---------------------------------------------------------
61 
62  void validate(ParameterSet & pset, std::string const& moduleLabel) const;
63 
64  void writeCfis(std::string const& baseType,
65  std::string const& pluginName) 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:
78 
80  public:
81  int iPlugin;
83  int iModule;
84  };
85 
86  static void writeCfiForLabel(std::pair<std::string, ParameterSetDescription> const& labelAndDesc,
87  std::string const& baseType,
88  std::string const& pluginName);
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,
97  DescriptionCounter & counter) const;
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 
109  std::string baseType_;
110 
111  std::vector<std::pair<std::string, ParameterSetDescription> > descriptions_;
112 
114 
115  std::string comment_;
117  };
118 }
119 
120 #endif
void writeCfis(std::string const &baseType, std::string const &pluginName) const
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
static void writeCfiForLabel(std::pair< std::string, ParameterSetDescription > const &labelAndDesc, std::string const &baseType, std::string const &pluginName)
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 setComment(std::string const &value)
tuple description
Definition: idDealer.py:66
void add(std::string const &label, ParameterSetDescription const &psetDescription)
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