|
|
Go to the documentation of this file.
17 <<
"associated with the different cases must be unique. Duplicate\n"
18 <<
"values were found for the switch with label: \"" << switchLabel <<
"\"\n";
22 std::set<std::string>& usedLabels,
23 std::set<std::string>&
labels)
const {
24 std::pair<std::set<std::string>::iterator,
bool>
status =
labels.insert(switchLabel);
25 if (
status.second ==
false) {
27 <<
"The label used for the switch parameter in a ParameterSetDescription\n"
28 <<
"must be different from the labels used in the associated cases. The following\n"
29 <<
"duplicate label was found: \"" << switchLabel <<
"\"\n";
35 std::set<ParameterTypes>
const& caseParameterTypes,
36 std::set<ParameterTypes>
const& caseWildcardTypes,
37 std::set<ParameterTypes>& parameterTypes,
38 std::set<ParameterTypes>& wildcardTypes)
const {
39 if (caseWildcardTypes.find(switchType) != caseWildcardTypes.end()) {
41 <<
"The type used for the switch parameter in a ParameterSetDescription\n"
42 <<
"must be different from the types used for wildcards in the associated cases. The following\n"
45 parameterTypes.insert(switchType);
46 parameterTypes.insert(caseParameterTypes.begin(), caseParameterTypes.end());
47 wildcardTypes.insert(caseWildcardTypes.begin(), caseWildcardTypes.end());
52 <<
"The default value used for the switch parameter in a ParameterSetDescription\n"
53 <<
"must match the value used to select one of the associated cases. This is not\n"
54 <<
"true for the switch named \"" << switchLabel <<
"\"\n";
68 if (dfh.
pass() == 0) {
77 if (dfh.
pass() == 1) {
82 ss << switchLabel <<
" (switch)";
83 std::ios::fmtflags oldFlags = os.flags();
84 os << std::left << std::setw(dfh.
column1()) <<
ss.str();
91 std::stringstream ss1;
92 ss1 <<
"untracked " << typeString;
96 os <<
" " << std::setw(dfh.
column3());
103 os <<
" (do not write to cfi)";
105 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
110 os << switchLabel <<
" (switch)\n";
116 os << typeString <<
" ";
122 os <<
" (do not write to cfi)";
126 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
147 std::stringstream
ss;
152 os <<
"Section " << newSection <<
" " << switchLabel <<
" (switch):\n";
156 os <<
"The value of \"" << switchLabel <<
"\" controls which other parameters\n";
158 os <<
"are required or allowed to be in the PSet.\n";
174 if (dfh.
pass() == 0) {
175 p.second->print(os,
false,
true, dfh);
177 if (dfh.
pass() == 1) {
179 os <<
"if " << switchLabel <<
" = ";
185 p.second->print(os,
false,
true, dfh);
187 if (dfh.
pass() == 2) {
188 p.second->printNestedContent(os,
false, dfh);
197 if (dfh.
pass() == 0) {
198 p.second->print(os,
false,
true, dfh);
200 if (dfh.
pass() == 1) {
202 os <<
"if " << switchLabel <<
" = " <<
p.first <<
"\n";
203 p.second->print(os,
false,
true, dfh);
205 if (dfh.
pass() == 2) {
206 p.second->printNestedContent(os,
false, dfh);
215 if (dfh.
pass() == 0) {
216 p.second->print(os,
false,
true, dfh);
218 if (dfh.
pass() == 1) {
220 os <<
"if " << switchLabel <<
" = \"" <<
p.first <<
"\"\n";
221 p.second->print(os,
false,
true, dfh);
223 if (dfh.
pass() == 2) {
224 p.second->printNestedContent(os,
false, dfh);
void throwNoCaseForSwitchValue(std::string const &message) const
bool partiallyExists_(ParameterSet const &pset) const override
bool exists(ParameterSet const &pset) const
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
std::string parameterTypeEnumToString(ParameterTypes iType)
~ParameterSwitchBase() override
void printNestedContentBase(std::ostream &os, DocFormatHelper &dfh, DocFormatHelper &new_dfh, std::string const &switchLabel) const
void insertAndCheckLabels(std::string const &switchLabel, std::set< std::string > &usedLabels, std::set< std::string > &labels) const
bool hasNestedContent_() const override
void throwDuplicateCaseValues(std::string const &switchLabel) const
void insertAndCheckTypes(ParameterTypes switchType, std::set< ParameterTypes > const &caseParameterTypes, std::set< ParameterTypes > const &caseWildcardTypes, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const
void printBase(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh, std::string const &switchLabel, bool isTracked, std::string const &typeString) const
static void printSpaces(std::ostream &os, int n)
std::string const & comment() const
void throwNoCaseForDefault(std::string const &switchLabel) const
static void printCase(std::pair< bool, edm::value_ptr< ParameterDescriptionNode > > const &p, std::ostream &os, bool optional, DocFormatHelper &dfh, std::string const &switchLabel)