1 #ifndef FWCore_MessageService_MessageServicePSetValidation_h 2 #define FWCore_MessageService_MessageServicePSetValidation_h 59 void noDuplicates(vString
const & v1, vString
const & v2,
70 void noBadParams(vString
const &
v, vString
const & params,
103 template <
typename T>
111 if (!pset.
exists(parameterLabel))
return val;
112 if ( pset.
existsAs<
T> (parameterLabel,
false) ) {
116 if ( pset.
existsAs<
T> (parameterLabel,
true) ) {
117 flaws << psetName <<
" PSet: \n" 119 <<
" is declared as tracked - needs to be untracked \n";
122 flaws << psetName <<
" PSet: \n" 124 <<
" is declared with incorrect type \n";
128 flaws << psetName <<
" PSet: \n" 130 <<
" is declared but causes an exception when processed: \n" 136 template <
typename T>
145 noBadParams(v, params, psetName, parameterLabel, type);
147 noBadParams(v, params, psetName, parameterLabel, type);
150 template <
typename T>
154 vString
x = pset.template getParameterNamesForType <T> (
false);
155 vString::const_iterator
end = x.end();
156 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
157 flaws << psetName <<
" PSet: \n" 158 << (*i) <<
" is used as a " << type <<
"\n" 159 <<
"Usage of " << type <<
" is not recognized here\n";
161 x = pset.template getParameterNamesForType <T> (
true);
163 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
164 if ( (*
i) ==
"@service_type" )
continue;
165 flaws << psetName <<
" PSet: \n" 166 << (*i) <<
" is used as a tracked " << type <<
"\n" 167 <<
"Tracked parameters not allowed here, " 168 <<
" and even untracked it would not be recognized\n";
172 template <
typename T>
177 vString
x = pset.template getParameterNamesForType <T> (
false);
178 vString::const_iterator
end = x.end();
179 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
182 flaws << psetName <<
" PSet: \n" 183 << val <<
" is used as a " << type <<
"\n" 184 <<
"This usage is not recognized in this type of PSet\n";
187 x = pset.template getParameterNamesForType <T> (
true);
189 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
190 if ( (*
i) ==
"@service_type" )
continue;
191 flaws << psetName <<
" PSet: \n" 192 << (*i) <<
" is used as a tracked " << type <<
"\n" 193 <<
"Tracked parameters not allowed here\n";
197 template <
typename T>
200 T const & ok1,
T const & ok2 )
202 vString
x = pset.template getParameterNamesForType <T> (
false);
203 vString::const_iterator
end = x.end();
204 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
206 if ( (val != ok1) && (val != ok2) ) {
207 flaws << psetName <<
" PSet: \n" 208 << val <<
" is used as a " << type <<
"\n" 209 <<
"This usage is not recognized in this type of PSet\n";
212 x = pset.template getParameterNamesForType <T> (
true);
214 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
215 if ( (*
i) ==
"@service_type" )
continue;
216 flaws << psetName <<
" PSet: \n" 217 << (*i) <<
" is used as a tracked " << type <<
"\n" 218 <<
"Tracked parameters not allowed here\n";
222 template <
typename T>
225 vString
const & vok )
227 vString
x = pset.template getParameterNamesForType <T> (
false);
228 vString::const_iterator
end = x.end();
229 vString::const_iterator
vend = vok.end();
230 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
232 for (vString::const_iterator vit = vok.begin(); vit!=
vend; ++vit) {
233 if ( *
i == *vit ) found =
true;
236 flaws << psetName <<
" PSet: \n" 237 << *
i <<
" is used as a " << type <<
"\n" 238 <<
"This usage is not recognized in this type of PSet\n";
241 x = pset.template getParameterNamesForType <T> (
true);
243 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
244 if ( (*
i) ==
"@service_type" )
continue;
245 flaws << psetName <<
" PSet: \n" 246 << (*i) <<
" is used as a tracked " << type <<
"\n" 247 <<
"Tracked parameters not allowed here\n";
251 template <
typename T>
257 vString
x = pset.template getParameterNamesForType <T> (
false);
258 vString::const_iterator
end = x.end();
259 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
260 flaws << categoryName <<
" category PSet nested in " 261 << psetName <<
" PSet: \n" 262 << (*i) <<
" is used as a " << type <<
"\n" 263 <<
"Usage of " << type <<
" is not recognized here\n";
265 x = pset.template getParameterNamesForType <T> (
true);
267 for ( vString::const_iterator
i = x.begin();
i !=
end; ++
i ) {
268 flaws << categoryName <<
" category PSet nested in " 269 << psetName <<
" PSet: \n" 270 << (*i) <<
" is used as a tracked " << type <<
"\n" 271 <<
"Tracked parameters not allowed here, " 272 <<
" and even untracked it would not be recognized\n";
301 #endif // FWCore_MessageService_MessageServicePSetValidation_h virtual char const * what() const
std::vector< std::string > messageIDs
T getParameter(std::string const &) const
void psetLists(ParameterSet const &pset)
T getUntrackedParameter(std::string const &, T const &) const
void statisticsPSet(ParameterSet const &pset, std::string const &psetName)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
bool lookForMatch(vString const &v, std::string const &s)
void categoryPSets(ParameterSet const &pset, std::string const &psetName)
bool wildcard(vString const &v)
void destinationPSet(ParameterSet const &pset, std::string const &psetName)
void disallowedParam(ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const ¶meterLabel, std::string const &type)
void vStringsCheck(ParameterSet const &pset, std::string const &psetName)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::vector< std::string > suppressInfo
std::vector< std::string > suppressWarning
std::vector< String > vString
void noCoutCerrClash(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type, std::string const &ok)
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
T x() const
Cartesian x coordinate.
std::vector< std::string > fwkJobReports
std::vector< std::string > suppressDebug
void fwkJobReportPSet(ParameterSet const &pset, std::string const &psetName)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type, vString const &vok)
T check(ParameterSet const &pset, std::string const &psetName, std::string const ¶meterLabel)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type, T const &ok1, T const &ok2)
void noKeywords(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
void catNone(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
void noneExcept(ParameterSet const &pset, std::string const &psetName, std::string const &type)
void noDuplicates(vString const &v, std::string const &psetName, std::string const ¶meterLabel)
std::vector< std::string > suppressError
std::vector< std::string > statistics
void catNoPSets(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
std::vector< std::string > destinations
bool keywordCheck(std::string const &word)
void noBadParams(vString const &v, vString const ¶ms, std::string const &psetName, std::string const ¶meterLabel, std::string const &type)
void noNonPSetUsage(ParameterSet const &pset, vString const &v, std::string const &psetName, std::string const ¶meterLabel)
std::vector< std::string > categories
void destinationPSets(ParameterSet const &pset)
void noOtherPsets(ParameterSet const &pset)
bool checkThreshold(std::string const &thresh)
std::string operator()(ParameterSet const &pset)
bool validateThreshold(std::string const &thresh, std::string const &psetName)
bool allowedVstring(std::string const &s)
void noNoncategoryPsets(ParameterSet const &pset, std::string const &psetName)
void catBoolRestriction(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName, std::string const &type)
void statisticsPSets(ParameterSet const &pset)
void categoryPSet(ParameterSet const &pset, std::string const &OuterPsetName, std::string const &categoryName)
void catInts(ParameterSet const &pset, std::string const &psetName, std::string const &categoryName)
void messageLoggerPSet(ParameterSet const &pset)
std::vector< std::string > debugModules
void defaultPSet(ParameterSet const &main_pset)
void fwkJobReportPSets(ParameterSet const &pset)
void suppressionLists(ParameterSet const &pset)