14 node_left_(node_left.
clone()),
15 node_right_(node_right.
clone()) {
21 node_left_(node_left),
22 node_right_(node_right.
clone()) {
27 std::auto_ptr<ParameterDescriptionNode> node_right) :
28 node_left_(node_left.
clone()),
29 node_right_(node_right) {
34 std::auto_ptr<ParameterDescriptionNode> node_right) :
35 node_left_(node_left),
36 node_right_(node_right) {
42 std::set<ParameterTypes> & parameterTypes,
43 std::set<ParameterTypes> & wildcardTypes)
const {
45 std::set<std::string> labelsLeft;
46 std::set<ParameterTypes> parameterTypesLeft;
47 std::set<ParameterTypes> wildcardTypesLeft;
48 node_left_->checkAndGetLabelsAndTypes(labelsLeft, parameterTypesLeft, wildcardTypesLeft);
50 std::set<std::string> labelsRight;
51 std::set<ParameterTypes> parameterTypesRight;
52 std::set<ParameterTypes> wildcardTypesRight;
53 node_right_->checkAndGetLabelsAndTypes(labelsRight, parameterTypesRight, wildcardTypesRight);
55 usedLabels.insert(labelsLeft.begin(), labelsLeft.end());
56 usedLabels.insert(labelsRight.begin(), labelsRight.end());
58 parameterTypes.insert(parameterTypesRight.begin(), parameterTypesRight.end());
59 parameterTypes.insert(parameterTypesLeft.begin(), parameterTypesLeft.end());
61 wildcardTypes.insert(wildcardTypesRight.begin(), wildcardTypesRight.end());
62 wildcardTypes.insert(wildcardTypesLeft.begin(), wildcardTypesLeft.end());
68 std::set<std::string> & validatedLabels,
69 bool optional)
const {
71 int nExistLeft =
node_left_->howManyXORSubNodesExist(pset);
72 int nExistRight =
node_right_->howManyXORSubNodesExist(pset);
73 int nTotal = nExistLeft + nExistRight;
75 if (nTotal == 0 && optional)
return;
81 if (nExistLeft == 1) {
82 node_left_->validate(pset, validatedLabels,
false);
84 else if (nExistRight == 1) {
85 node_right_->validate(pset, validatedLabels,
false);
87 else if (nTotal == 0) {
88 node_left_->validate(pset, validatedLabels,
false);
92 nExistLeft =
node_left_->howManyXORSubNodesExist(pset);
93 nExistRight =
node_right_->howManyXORSubNodesExist(pset);
94 nTotal = nExistLeft + nExistRight;
105 bool & startWithComma,
107 bool & wroteSomething)
const {
108 node_left_->writeCfi(os, startWithComma, indentation, wroteSomething);
125 if (dfh.
pass() == 1) {
132 if (optional) os <<
" optional";
134 if (!writeToCfi) os <<
" (do not write to cfi)";
136 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
144 if (optional) os <<
"optional";
145 if (!writeToCfi) os <<
" (do not write to cfi)";
146 if (optional || !writeToCfi) {
151 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
172 node_left_->printNestedContent(os,
false, dfh);
182 std::stringstream ss;
187 os <<
"Section " << newSection
188 <<
" XOR group description:\n";
191 os <<
"This optional XOR group requires exactly one or none of the following to be in the PSet\n";
194 os <<
"This XOR group requires exactly one of the following to be in the PSet\n";
196 if (!dfh.
brief()) os <<
"\n";
216 node_left_->printNestedContent(os,
false, new_dfh);
217 node_right_->printNestedContent(os,
false, new_dfh);
223 int nTotal =
node_left_->howManyXORSubNodesExist(pset) +
237 return node_left_->howManyXORSubNodesExist(pset) +
248 <<
"Exactly one parameter can exist in a ParameterSet from a list of\n"
249 <<
"parameters described by an \"xor\" operator in a ParameterSetDescription.\n"
250 <<
"This rule also applies in a more general sense to the other types\n"
251 <<
"of nodes that can appear within a ParameterSetDescription. Only one\n"
252 <<
"can pass validation as \"existing\".\n";
262 <<
"Exactly one parameter can exist in a ParameterSet from a list of\n"
263 <<
"parameters described by an \"xor\" operator in a ParameterSetDescription.\n"
264 <<
"This rule also applies in a more general sense to the other types\n"
265 <<
"of nodes that can appear within a ParameterSetDescription. Only one\n"
266 <<
"can pass validation as \"existing\". This error has occurred after an\n"
267 <<
"attempt to insert missing parameters to fix the problem.\n";
virtual void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const
virtual void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh)
virtual bool exists_(ParameterSet const &pset) const
virtual bool partiallyExists_(ParameterSet const &pset) const
virtual void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const
virtual void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh)
void throwAfterValidation() const
std::string const & comment() const
void throwMoreThanOneParameter() const
virtual void writeCfi_(std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const
static void printSpaces(std::ostream &os, int n)
bool exists(ParameterSet const &pset) const
virtual int howManyXORSubNodesExist_(ParameterSet const &pset) const
XORGroupDescription(ParameterDescriptionNode const &node_left, ParameterDescriptionNode const &node_right)
edm::value_ptr< ParameterDescriptionNode > node_left_
edm::value_ptr< ParameterDescriptionNode > node_right_