13 : node_left_(node_left.
clone()), node_right_(node_right.
clone()) {}
17 : node_left_(std::
move(node_left)), node_right_(node_right.
clone()) {}
20 std::unique_ptr<ParameterDescriptionNode> node_right)
21 : node_left_(node_left.
clone()), node_right_(std::
move(node_right)) {}
24 std::unique_ptr<ParameterDescriptionNode> node_right)
25 : node_left_(std::
move(node_left)), node_right_(std::
move(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;
82 std::ostream& os,
bool optional,
bool& startWithComma,
int indentation,
bool& wroteSomething)
const {
83 node_left_->writeCfi(os, optional, startWithComma, indentation, wroteSomething);
94 if (dfh.
pass() == 1) {
103 os <<
" (do not write to cfi)";
105 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
115 os <<
" (do not write to cfi)";
116 if (optional || !writeToCfi) {
121 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
134 node_left_->printNestedContent(os,
false, dfh);
144 std::stringstream
ss;
149 os <<
"Section " << newSection <<
" XOR group description:\n";
152 os <<
"This optional XOR group requires exactly one or none of the following to be in the PSet\n";
154 os <<
"This XOR group requires exactly one of the following to be in the PSet\n";
177 node_left_->printNestedContent(os,
false, new_dfh);
178 node_right_->printNestedContent(os,
false, new_dfh);
197 <<
"Exactly one parameter can exist in a ParameterSet from a list of\n"
198 <<
"parameters described by an \"xor\" operator in a ParameterSetDescription.\n"
199 <<
"This rule also applies in a more general sense to the other types\n"
200 <<
"of nodes that can appear within a ParameterSetDescription. Only one\n"
201 <<
"can pass validation as \"existing\".\n";
209 <<
"Exactly one parameter can exist in a ParameterSet from a list of\n"
210 <<
"parameters described by an \"xor\" operator in a ParameterSetDescription.\n"
211 <<
"This rule also applies in a more general sense to the other types\n"
212 <<
"of nodes that can appear within a ParameterSetDescription. Only one\n"
213 <<
"can pass validation as \"existing\". This error has occurred after an\n"
214 <<
"attempt to insert missing parameters to fix the problem.\n";
bool exists_(ParameterSet const &pset) const override
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
void throwAfterValidation() const
void writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, bool &wroteSomething) const override
std::string const & comment() const
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const override
bool partiallyExists_(ParameterSet const &pset) const override
void throwMoreThanOneParameter() const
static void printSpaces(std::ostream &os, int n)
bool exists(ParameterSet const &pset) const
XORGroupDescription(ParameterDescriptionNode const &node_left, ParameterDescriptionNode const &node_right)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
edm::value_ptr< ParameterDescriptionNode > node_left_
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
edm::value_ptr< ParameterDescriptionNode > node_right_