13 : node_left_(node_left.
clone()), node_right_(node_right.
clone()) {}
20 std::unique_ptr<ParameterDescriptionNode> node_right)
24 std::unique_ptr<ParameterDescriptionNode> node_right)
28 std::set<ParameterTypes>& parameterTypes,
29 std::set<ParameterTypes>& wildcardTypes)
const {
30 std::set<std::string> labelsLeft;
31 std::set<ParameterTypes> parameterTypesLeft;
32 std::set<ParameterTypes> wildcardTypesLeft;
33 node_left_->checkAndGetLabelsAndTypes(labelsLeft, parameterTypesLeft, wildcardTypesLeft);
35 std::set<std::string> labelsRight;
36 std::set<ParameterTypes> parameterTypesRight;
37 std::set<ParameterTypes> wildcardTypesRight;
38 node_right_->checkAndGetLabelsAndTypes(labelsRight, parameterTypesRight, wildcardTypesRight);
40 usedLabels.insert(labelsLeft.begin(), labelsLeft.end());
41 usedLabels.insert(labelsRight.begin(), labelsRight.end());
43 parameterTypes.insert(parameterTypesRight.begin(), parameterTypesRight.end());
44 parameterTypes.insert(parameterTypesLeft.begin(), parameterTypesLeft.end());
46 wildcardTypes.insert(wildcardTypesRight.begin(), wildcardTypesRight.end());
47 wildcardTypes.insert(wildcardTypesLeft.begin(), wildcardTypesLeft.end());
51 int nExistLeft =
node_left_->howManyXORSubNodesExist(pset);
52 int nExistRight =
node_right_->howManyXORSubNodesExist(pset);
53 int nTotal = nExistLeft + nExistRight;
55 if (nTotal == 0 && optional)
62 if (nExistLeft == 1) {
63 node_left_->validate(pset, validatedLabels,
false);
64 }
else if (nExistRight == 1) {
65 node_right_->validate(pset, validatedLabels,
false);
66 }
else if (nTotal == 0) {
67 node_left_->validate(pset, validatedLabels,
false);
71 nExistLeft =
node_left_->howManyXORSubNodesExist(pset);
72 nExistRight =
node_right_->howManyXORSubNodesExist(pset);
73 nTotal = nExistLeft + nExistRight;
84 bool& wroteSomething)
const {
85 node_left_->writeCfi(os, startWithComma, indentation, wroteSomething);
96 if (dfh.
pass() == 1) {
105 os <<
" (do not write to cfi)";
107 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
117 os <<
" (do not write to cfi)";
118 if (optional || !writeToCfi) {
123 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
136 node_left_->printNestedContent(os,
false, dfh);
146 std::stringstream ss;
151 os <<
"Section " << newSection <<
" XOR group description:\n";
154 os <<
"This optional XOR group requires exactly one or none of the following to be in the PSet\n";
156 os <<
"This XOR group requires exactly one of the following to be in the PSet\n";
179 node_left_->printNestedContent(os,
false, new_dfh);
180 node_right_->printNestedContent(os,
false, new_dfh);
199 <<
"Exactly one parameter can exist in a ParameterSet from a list of\n" 200 <<
"parameters described by an \"xor\" operator in a ParameterSetDescription.\n" 201 <<
"This rule also applies in a more general sense to the other types\n" 202 <<
"of nodes that can appear within a ParameterSetDescription. Only one\n" 203 <<
"can pass validation as \"existing\".\n";
211 <<
"Exactly one parameter can exist in a ParameterSet from a list of\n" 212 <<
"parameters described by an \"xor\" operator in a ParameterSetDescription.\n" 213 <<
"This rule also applies in a more general sense to the other types\n" 214 <<
"of nodes that can appear within a ParameterSetDescription. Only one\n" 215 <<
"can pass validation as \"existing\". This error has occurred after an\n" 216 <<
"attempt to insert missing parameters to fix the problem.\n";
void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
void throwAfterValidation() const
std::string const & comment() const
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
ParameterDescriptionNode * clone() const override
void throwMoreThanOneParameter() const
bool partiallyExists_(ParameterSet const &pset) const override
static void printSpaces(std::ostream &os, int n)
bool exists(ParameterSet const &pset) const
XORGroupDescription(ParameterDescriptionNode const &node_left, ParameterDescriptionNode const &node_right)
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
edm::value_ptr< ParameterDescriptionNode > node_left_
void writeCfi_(std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const override
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const override
bool exists_(ParameterSet const &pset) const override
edm::value_ptr< ParameterDescriptionNode > node_right_