15 : node_left_(node_left.
clone()), node_right_(node_right.
clone()) {}
19 : node_left_(std::
move(node_left)), node_right_(node_right.
clone()) {}
22 std::unique_ptr<ParameterDescriptionNode> node_right)
23 : node_left_(node_left.
clone()), node_right_(std::
move(node_right)) {}
26 std::unique_ptr<ParameterDescriptionNode> node_right)
27 : node_left_(std::
move(node_left)), node_right_(std::
move(node_right)) {}
30 std::set<ParameterTypes>& parameterTypes,
31 std::set<ParameterTypes>& wildcardTypes)
const {
32 std::set<std::string> labelsLeft;
33 std::set<ParameterTypes> parameterTypesLeft;
34 std::set<ParameterTypes> wildcardTypesLeft;
35 node_left_->checkAndGetLabelsAndTypes(labelsLeft, parameterTypesLeft, wildcardTypesLeft);
37 std::set<std::string> labelsRight;
38 std::set<ParameterTypes> parameterTypesRight;
39 std::set<ParameterTypes> wildcardTypesRight;
40 node_right_->checkAndGetLabelsAndTypes(labelsRight, parameterTypesRight, wildcardTypesRight);
46 usedLabels.insert(labelsLeft.begin(), labelsLeft.end());
47 usedLabels.insert(labelsRight.begin(), labelsRight.end());
49 parameterTypes.insert(parameterTypesRight.begin(), parameterTypesRight.end());
50 parameterTypes.insert(parameterTypesLeft.begin(), parameterTypesLeft.end());
52 wildcardTypes.insert(wildcardTypesRight.begin(), wildcardTypesRight.end());
53 wildcardTypes.insert(wildcardTypesLeft.begin(), wildcardTypesLeft.end());
60 if (leftExists || rightExists) {
62 node_left_->validate(pset, validatedLabels,
false);
64 node_right_->validate(pset, validatedLabels,
false);
71 node_left_->validate(pset, validatedLabels,
false);
75 std::ostream& os,
bool optional,
bool& startWithComma,
int indentation,
bool& wroteSomething)
const {
76 node_left_->writeCfi(os, optional, startWithComma, indentation, wroteSomething);
87 if (dfh.
pass() == 1) {
96 os <<
" (do not write to cfi)";
98 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
108 os <<
" (do not write to cfi)";
109 if (optional || !writeToCfi) {
114 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
127 node_left_->printNestedContent(os,
false, dfh);
137 std::stringstream
ss;
142 os <<
"Section " << newSection <<
" OR group description:\n";
148 os <<
"This optional OR group requires at least one or none of the following to be in the PSet\n";
150 os <<
"This OR group requires at least one of the following to be in the PSet\n";
173 node_left_->printNestedContent(os,
false, new_dfh);
174 node_right_->printNestedContent(os,
false, new_dfh);
186 std::set<std::string>
const& labelsRight)
const {
187 std::set<std::string> duplicateLabels;
188 std::insert_iterator<std::set<std::string> > insertIter(duplicateLabels, duplicateLabels.begin());
189 std::set_intersection(labelsLeft.begin(), labelsLeft.end(), labelsRight.begin(), labelsRight.end(), insertIter);
190 if (!duplicateLabels.empty()) {
191 std::stringstream
ss;
192 for (std::set<std::string>::const_iterator iter = duplicateLabels.begin(), iEnd = duplicateLabels.end();
195 ss <<
" \"" << *iter <<
"\"\n";
198 <<
"\"or\" expression must be not be the same as labels used\n"
199 <<
"in other nodes of the expression. The following duplicate\n"
200 <<
"labels were detected:\n"
206 std::set<ParameterTypes>
const& types2)
const {
207 if (!types1.empty()) {
208 std::set<ParameterTypes> duplicateTypes;
209 std::insert_iterator<std::set<ParameterTypes> > insertIter(duplicateTypes, duplicateTypes.begin());
211 if (!duplicateTypes.empty()) {
212 std::stringstream
ss;
213 for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes.begin(), iEnd = duplicateTypes.end();
219 <<
"Types used for wildcards in a node of a ParameterSetDescription\n"
220 <<
"\"or\" expression must be different from types used for other parameters\n"
221 <<
"in other nodes. The following duplicate types were detected:\n"
void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh) const override
edm::value_ptr< ParameterDescriptionNode > node_left_
bool exists_(ParameterSet const &pset) const override
std::string parameterTypeEnumToString(ParameterTypes iType)
void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh) const override
std::string const & comment() const
int howManyXORSubNodesExist_(ParameterSet const &pset) const override
void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const override
void writeCfi_(std::ostream &os, bool optional, bool &startWithComma, int indentation, bool &wroteSomething) const override
bool partiallyExists_(ParameterSet const &pset) const override
static void printSpaces(std::ostream &os, int n)
ORGroupDescription(ParameterDescriptionNode const &node_left, ParameterDescriptionNode const &node_right)
bool exists(ParameterSet const &pset) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
void throwIfDuplicateTypes(std::set< ParameterTypes > const &types1, std::set< ParameterTypes > const &types2) const
void throwIfDuplicateLabels(std::set< std::string > const &labelsLeft, std::set< std::string > const &labelsRight) const
void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const override
edm::value_ptr< ParameterDescriptionNode > node_right_