16 node_left_(node_left.
clone()),
17 node_right_(node_right.
clone()) {
23 node_left_(node_left),
24 node_right_(node_right.
clone()) {
29 std::auto_ptr<ParameterDescriptionNode> node_right) :
30 node_left_(node_left.
clone()),
31 node_right_(node_right) {
36 std::auto_ptr<ParameterDescriptionNode> node_right) :
37 node_left_(node_left),
38 node_right_(node_right) {
44 std::set<ParameterTypes> & parameterTypes,
45 std::set<ParameterTypes> & wildcardTypes)
const {
47 std::set<std::string> labelsLeft;
48 std::set<ParameterTypes> parameterTypesLeft;
49 std::set<ParameterTypes> wildcardTypesLeft;
50 node_left_->checkAndGetLabelsAndTypes(labelsLeft, parameterTypesLeft, wildcardTypesLeft);
52 std::set<std::string> labelsRight;
53 std::set<ParameterTypes> parameterTypesRight;
54 std::set<ParameterTypes> wildcardTypesRight;
55 node_right_->checkAndGetLabelsAndTypes(labelsRight, parameterTypesRight, wildcardTypesRight);
61 usedLabels.insert(labelsLeft.begin(), labelsLeft.end());
62 usedLabels.insert(labelsRight.begin(), labelsRight.end());
64 parameterTypes.insert(parameterTypesRight.begin(), parameterTypesRight.end());
65 parameterTypes.insert(parameterTypesLeft.begin(), parameterTypesLeft.end());
67 wildcardTypes.insert(wildcardTypesRight.begin(), wildcardTypesRight.end());
68 wildcardTypes.insert(wildcardTypesLeft.begin(), wildcardTypesLeft.end());
74 std::set<std::string> & validatedLabels,
75 bool optional)
const {
77 node_left_->validate(pset, validatedLabels,
false);
78 node_right_->validate(pset, validatedLabels,
false);
85 bool & startWithComma,
87 bool & wroteSomething)
const {
88 node_left_->writeCfi(os, startWithComma, indentation, wroteSomething);
89 node_right_->writeCfi(os, startWithComma, indentation, wroteSomething);
106 if (dfh.
pass() == 1) {
113 if (optional) os <<
" optional";
115 if (!writeToCfi) os <<
" (do not write to cfi)";
117 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
125 if (optional) os <<
"optional";
126 if (!writeToCfi) os <<
" (do not write to cfi)";
127 if (optional || !writeToCfi) {
132 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
153 node_left_->printNestedContent(os,
false, dfh);
163 std::stringstream
ss;
168 os <<
"Section " << newSection
169 <<
" AND group description:\n";
172 os <<
"This optional AND group requires all or none of the following to be in the PSet\n";
175 os <<
"This AND group requires all of the following to be in the PSet\n";
177 if (!dfh.
brief()) os <<
"\n";
197 node_left_->printNestedContent(os,
false, new_dfh);
198 node_right_->printNestedContent(os,
false, new_dfh);
216 return exists(pset) ? 1 : 0;
222 std::set<std::string>
const& labelsRight)
const {
224 std::set<std::string> duplicateLabels;
225 std::insert_iterator<std::set<std::string> > insertIter(duplicateLabels, duplicateLabels.begin());
226 std::set_intersection(labelsLeft.begin(), labelsLeft.end(),
227 labelsRight.begin(), labelsRight.end(),
229 if (!duplicateLabels.empty()) {
230 std::stringstream
ss;
231 for (std::set<std::string>::const_iterator iter = duplicateLabels.begin(),
232 iEnd = duplicateLabels.end();
235 ss <<
" \"" << *iter <<
"\"\n";
238 <<
"Labels used in different nodes of a ParameterSetDescription\n"
239 <<
"\"and\" expression must be unique. The following duplicate\n"
240 <<
"labels were detected:\n"
249 std::set<ParameterTypes>
const& types2)
const
251 if (!types1.empty()) {
252 std::set<ParameterTypes> duplicateTypes;
253 std::insert_iterator<std::set<ParameterTypes> > insertIter(duplicateTypes, duplicateTypes.begin());
254 std::set_intersection(types1.begin(), types1.end(),
255 types2.begin(), types2.end(),
257 if (!duplicateTypes.empty()) {
258 std::stringstream
ss;
259 for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes.begin(),
260 iEnd = duplicateTypes.end();
266 <<
"Types used for wildcards in different nodes of a ParameterSetDescription\n"
267 <<
"\"and\" expression must be different from types used for other parameters.\n"
268 <<
"The following duplicate types were detected:\n"
void throwIfDuplicateTypes(std::set< ParameterTypes > const &types1, std::set< ParameterTypes > const &types2) const
ANDGroupDescription(ParameterDescriptionNode const &node_left, ParameterDescriptionNode const &node_right)
virtual void writeCfi_(std::ostream &os, bool &startWithComma, int indentation, bool &wroteSomething) const
virtual bool partiallyExists_(ParameterSet const &pset) const
virtual void print_(std::ostream &os, bool optional, bool writeToCfi, DocFormatHelper &dfh)
std::string parameterTypeEnumToString(ParameterTypes iType)
edm::value_ptr< ParameterDescriptionNode > node_right_
std::string const & comment() const
virtual void validate_(ParameterSet &pset, std::set< std::string > &validatedLabels, bool optional) const
edm::value_ptr< ParameterDescriptionNode > node_left_
virtual void printNestedContent_(std::ostream &os, bool optional, DocFormatHelper &dfh)
static void printSpaces(std::ostream &os, int n)
virtual int howManyXORSubNodesExist_(ParameterSet const &pset) const
bool exists(ParameterSet const &pset) const
bool partiallyExists(ParameterSet const &pset) const
virtual bool exists_(ParameterSet const &pset) const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
virtual void checkAndGetLabelsAndTypes_(std::set< std::string > &usedLabels, std::set< ParameterTypes > ¶meterTypes, std::set< ParameterTypes > &wildcardTypes) const
void throwIfDuplicateLabels(std::set< std::string > const &labelsLeft, std::set< std::string > const &labelsRight) const