18 isTracked_(isTracked),
25 std::string sPattern(pattern);
32 if (pattern != std::string(
"*")) {
34 <<
"Currently, the only supported wildcard in ParameterSetDescriptions\n"
35 <<
"is the single character \"*\". The configuration contains a wildcard\n"
37 <<
"At some future date, globbing or regular expression support may be added\n"
38 <<
"if there are any requests for it from users.\n";
45 std::set<std::string> & validatedLabels,
46 bool optional)
const {
47 validatedLabels.insert(matchingNames.begin(), matchingNames.end());
52 <<
"at least one match\n"
53 <<
"and there are no parameters in the configuration matching\n"
57 if ( (matchingNames.size() < 1U && !optional) ||
58 matchingNames.size() > 1U) {
61 <<
"exactly one match and there are " << matchingNames.size() <<
" matching parameters\n"
62 <<
"in the configuration.\n";
70 std::set<ParameterTypes> & parameterTypes,
71 std::set<ParameterTypes> & wildcardTypes)
const {
72 wildcardTypes.insert(
type());
82 if (dfh.
pass() == 0) {
97 std::ios::fmtflags oldFlags = os.flags();
98 os << std::left << std::setw(dfh.
column1()) <<
"wildcard: *" <<
" ";
104 std::stringstream ss;
110 os << std::setw(dfh.
column3());
111 if (optional) os <<
"optional";
115 os <<
" (require zero or more)";
118 os <<
" (require at least one)";
121 os <<
" (require exactly one)";
126 os <<
" (see Section " << dfh.
section()
127 <<
"." << dfh.
counter() <<
")\n";
135 os <<
"labels must match this wildcard pattern: *\n";
146 if (optional) os <<
" optional";
158 os <<
"(see Section " << dfh.
section()
159 <<
"." << dfh.
counter() <<
")\n";
176 bool & startWithComma,
178 bool & wroteSomething)
const {
192 return exists(pset) ? 1 : 0;
WildcardValidationCriteria
ParameterTypes type() const
virtual void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const
std::string parameterTypeEnumToString(ParameterTypes iType)
WildcardValidationCriteria criteria_
std::string const & comment() const
virtual bool partiallyExists_(ParameterSet const &pset) const
bool exists(ParameterSet const &pset) const
WildcardValidationCriteria criteria() const
void throwIfInvalidPattern(char const *pattern) const
virtual void writeCfi_(std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const
void validateMatchingNames(std::vector< std::string > const &matchingNames, std::set< std::string > &validatedLabels, bool optional) const
virtual void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh)
tuple size
Write out results.
virtual int howManyXORSubNodesExist_(ParameterSet const &pset) const
ParameterWildcardBase(ParameterTypes iType, bool isTracked, WildcardValidationCriteria criteria)
virtual ~ParameterWildcardBase()