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
edm::ConfigurationDescriptions::iterator
std::vector< std::pair< std::string, ParameterSetDescription > >::iterator iterator
Definition: ConfigurationDescriptions.h:30
counter
Definition: counter.py:1
edm::ConfigurationDescriptions::DescriptionCounter::iPlugin
int iPlugin
Definition: ConfigurationDescriptions.h:80
edm::ConfigurationDescriptions::DescriptionCounter::iModule
int iModule
Definition: ConfigurationDescriptions.h:82
edm::ConfigurationDescriptions::defaultDescDefined_
bool defaultDescDefined_
Definition: ConfigurationDescriptions.h:117
edm
HLT enums.
Definition: AlignableModifier.h:19
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::ConfigurationDescriptions::ConfigurationDescriptions
ConfigurationDescriptions(std::string const &baseType, std::string const &pluginName)
Definition: ConfigurationDescriptions.cc:43
edm::ConfigurationDescriptions::printForLabel
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
Definition: ConfigurationDescriptions.cc:319
edm::ConfigurationDescriptions::descriptions_
std::vector< std::pair< std::string, ParameterSetDescription > > descriptions_
Definition: ConfigurationDescriptions.h:112
edm::ConfigurationDescriptions::print
void print(std::ostream &os, std::string const &moduleLabel, bool brief, bool printOnlyLabels, size_t lineWidth, int indentation, int iPlugin) const
Definition: ConfigurationDescriptions.cc:223
edm::ConfigurationDescriptions::begin
iterator begin()
Definition: ConfigurationDescriptions.cc:119
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ConfigurationDescriptions::comment_
std::string comment_
Definition: ConfigurationDescriptions.h:116
edm::ConfigurationDescriptions::validate
void validate(ParameterSet &pset, std::string const &moduleLabel) const
Definition: ConfigurationDescriptions.cc:123
edm::ConfigurationDescriptions::writeCfiForLabel
static void writeCfiForLabel(std::pair< std::string, ParameterSetDescription > const &labelAndDesc, std::string const &baseType, std::string const &pluginName, std::set< std::string > &usedCfiFileNames)
Definition: ConfigurationDescriptions.cc:152
ParameterSetDescription.h
edm::ConfigurationDescriptions::writeCfis
void writeCfis(std::set< std::string > &usedCfiFileNames) const
Definition: ConfigurationDescriptions.cc:143
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ConfigurationDescriptions::baseType_
std::string baseType_
Definition: ConfigurationDescriptions.h:109
edm::ConfigurationDescriptions::comment
std::string const & comment() const
Definition: ConfigurationDescriptions.h:44
edm::ParameterSet
Definition: ParameterSet.h:47
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
edm::ConfigurationDescriptions::~ConfigurationDescriptions
~ConfigurationDescriptions()
Definition: ConfigurationDescriptions.cc:46
value
Definition: value.py:1
RecoTauValidation_cfi.lineWidth
lineWidth
Definition: RecoTauValidation_cfi.py:305
edm::ConfigurationDescriptions::end
iterator end()
Definition: ConfigurationDescriptions.cc:121
edm::ConfigurationDescriptions::DescriptionCounter::iSelectedModule
int iSelectedModule
Definition: ConfigurationDescriptions.h:81
edm::ConfigurationDescriptions::defaultDescription
ParameterSetDescription * defaultDescription()
Returns 0 if no default has been assigned.
Definition: ConfigurationDescriptions.cc:112
printContent_cfi.indentation
indentation
Definition: printContent_cfi.py:10
edm::ConfigurationDescriptions::defaultDesc_
ParameterSetDescription defaultDesc_
Definition: ConfigurationDescriptions.h:114
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::ConfigurationDescriptions::pluginName_
std::string pluginName_
Definition: ConfigurationDescriptions.h:110
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
edm::ConfigurationDescriptions::DescriptionCounter
Definition: ConfigurationDescriptions.h:78