42 std::unique_ptr<ParameterDescriptionNode> clonedNode(node.
clone());
52 std::unique_ptr<ParameterDescriptionNode> clonedNode(node.
clone());
64 std::set<std::string> nodeLabels;
65 std::set<ParameterTypes> nodeParameterTypes;
66 std::set<ParameterTypes> nodeWildcardTypes;
73 entry.setWriteToCfi(writeToCfi);
79 using std::placeholders::_1;
83 std::set<std::string> validatedLabels;
86 std::vector<std::string> parameterNames =
pset.getParameterNames();
87 if (validatedLabels.size() != parameterNames.size()) {
94 if (
pset.exists(module_label)) {
95 validatedLabels.insert(module_label);
99 if (
pset.exists(module_type)) {
100 validatedLabels.insert(module_type);
104 if (
pset.exists(module_edm_type)) {
105 validatedLabels.insert(module_edm_type);
109 if (
pset.exists(service_type)) {
110 validatedLabels.insert(service_type);
115 if (
pset.exists(tryToContinue)) {
116 validatedLabels.insert(tryToContinue);
120 if (validatedLabels.size() != parameterNames.size()) {
132 bool wroteSomething =
false;
134 bool seenWildcard =
false;
135 bool seenMultipleWildcards =
false;
138 if (
entry.node()->isWildcard()) {
139 if (seenWildcard ==
true) {
140 seenMultipleWildcards =
true;
152 if (wroteSomething) {
153 char oldFill =
os.fill();
154 os <<
"\n" << std::setfill(
' ') << std::setw(
indentation - 2) <<
"" << std::setfill(oldFill);
160 std::set<std::string>& validatedLabels) {
165 using std::placeholders::_1;
168 os <<
"Description is unknown. The configured PSet will not be validated\n";
170 os <<
"because the plugin has not defined this parameter set description.\n";
177 os <<
"Description allows anything. If the configured PSet contains illegal parameters,\n";
179 os <<
"then validation will ignore them instead of throwing an exception.\n";
186 os <<
"Description is empty\n";
214 std::set<std::string>
const& validatedLabels) {
215 std::set<std::string>
parNames(parameterNames.begin(), parameterNames.end());
217 std::set<std::string> diffNames;
218 std::insert_iterator<std::set<std::string> > insertIter(diffNames, diffNames.begin());
221 std::stringstream
ss;
222 for (std::set<std::string>::const_iterator iter = diffNames.begin(), iEnd = diffNames.end(); iter != iEnd; ++iter) {
223 ss <<
" '" << *iter <<
"'\n";
225 if (diffNames.size() == 1
U) {
227 <<
"Illegal parameter found in configuration. The parameter is named:\n" 228 <<
ss.str() <<
"You could be trying to use a parameter name that is not\n" 229 <<
"allowed for this plugin or it could be misspelled.\n";
232 <<
"Illegal parameters found in configuration. The parameters are named:\n" 233 <<
ss.str() <<
"You could be trying to use parameter names that are not\n" 234 <<
"allowed for this plugin or they could be misspelled.\n";
240 bool& startWithComma,
243 bool& wroteSomething) {
244 if (
entry.writeToCfi()) {
253 if (dfh.
pass() < 2) {
256 entry.node()->printNestedContent(
os,
entry.optional(), dfh);
261 std::set<std::string> duplicateLabels;
262 std::insert_iterator<std::set<std::string> > insertIter(duplicateLabels, duplicateLabels.begin());
264 if (duplicateLabels.empty()) {
265 usedLabels_.insert(nodeLabels.begin(), nodeLabels.end());
267 std::stringstream
ss;
268 for (std::set<std::string>::const_iterator iter = duplicateLabels.begin(), iEnd = duplicateLabels.end();
271 ss <<
" \"" << *iter <<
"\"\n";
274 <<
"must be unique. The following duplicate labels were detected:\n" 280 std::set<ParameterTypes>
const& nodeWildcardTypes) {
292 if (!nodeWildcardTypes.empty()) {
293 std::set<ParameterTypes> duplicateTypes1;
294 std::insert_iterator<std::set<ParameterTypes> > insertIter1(duplicateTypes1, duplicateTypes1.begin());
297 nodeWildcardTypes.begin(),
298 nodeWildcardTypes.end(),
301 if (!duplicateTypes1.empty()) {
302 std::stringstream
ss;
303 for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes1.begin(), iEnd = duplicateTypes1.end();
309 <<
"Within a ParameterSetDescription, the type used for a wildcard must\n" 310 <<
"not be the same as the type used for other parameters. This rule\n" 311 <<
"is violated for the following types:\n" 317 std::set<ParameterTypes> duplicateTypes2;
318 std::insert_iterator<std::set<ParameterTypes> > insertIter2(duplicateTypes2, duplicateTypes2.begin());
321 nodeParameterTypes.begin(),
322 nodeParameterTypes.end(),
325 if (!duplicateTypes2.empty()) {
326 std::stringstream
ss;
327 for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes2.begin(), iEnd = duplicateTypes2.end();
333 <<
"Within a ParameterSetDescription, the type used for a wildcard must\n" 334 <<
"not be the same as the type used for other parameters. This rule is\n" 335 <<
"violated for the following types :\n" 348 std::unique_ptr<ParameterDescriptionNode> pdIfExists = std::make_unique<IfExistsDescription>(node1, node2);
SetDescriptionEntries entries_
bool isLabelUnused(std::string const &label) const
virtual ParameterDescriptionNode * clone() const =0
static void throwIllegalParameters(std::vector< std::string > const ¶meterNames, std::set< std::string > const &validatedNames)
void print(std::ostream &os, DocFormatHelper &dfh) const
void throwIfWildcardCollision(std::set< ParameterTypes > const &nodeParameterTypes, std::set< ParameterTypes > const &nodeWildcardTypes)
void setAllowAnything()
allow any parameter label/value pairs
std::set< std::string > usedLabels_
static bool throwAnException()
ParameterDescriptionNode * ifExists(ParameterDescriptionNode const &node1, ParameterDescriptionNode const &node2)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
std::string parameterTypeEnumToString(ParameterTypes iType)
std::set< ParameterTypes > typesUsedForParameters_
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
void setComment(std::string const &value)
void parameterMustBeTyped(CfiOptions &iOps) noexcept
void throwIfLabelsAlreadyUsed(std::set< std::string > const &nodeLabels)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
static void validateNode(SetDescriptionEntry const &entry, ParameterSet &pset, std::set< std::string > &validatedNames)
static void printNode(SetDescriptionEntry const &entry, std::ostream &os, DocFormatHelper &dfh)
void checkAndGetLabelsAndTypes(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const
ParameterSetDescription()
void validate(ParameterSet &pset) const
static const uint16_t unknown_
std::set< ParameterTypes > typesUsedForWildcards_
static void writeNode(SetDescriptionEntry const &entry, std::ostream &os, bool &startWithComma, int indentation, CfiOptions &, bool &wroteSomething)
bool anythingAllowed() const
void writeCfi(std::ostream &os, bool startWithComma, int indentation, CfiOptions &) const
virtual ~ParameterSetDescription()
cfi::CfiOptions CfiOptions