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 }
else if (leftExists && rightExists) {
65 }
else if (leftExists && !rightExists) {
69 }
else if (!leftExists && rightExists) {
76 std::ostream& os,
bool optional,
bool& startWithComma,
int indentation,
bool& wroteSomething)
const {
82 if (dfh.
pass() == 1) {
84 os <<
"IfExists pair:";
91 os <<
" (do not write to cfi)";
93 os <<
" see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
103 os <<
" (do not write to cfi)";
109 os <<
"see Section " << dfh.
section() <<
"." << dfh.
counter() <<
"\n";
125 std::stringstream
ss;
130 os <<
"Section " << newSection;
133 os <<
" IfExists pair description:\n";
136 os <<
"If the first parameter exists, then the second is allowed to exist\n";
138 os <<
"If the first parameter exists, then the second is required to exist\n";
161 node_left_->printNestedContent(os,
false, new_dfh);
162 node_right_->printNestedContent(os,
false, new_dfh);
169 if (leftExists && rightExists)
171 else if (!leftExists && !rightExists)
181 std::set<std::string>
const& labelsRight)
const {
182 std::set<std::string> duplicateLabels;
183 std::insert_iterator<std::set<std::string> > insertIter(duplicateLabels, duplicateLabels.begin());
184 std::set_intersection(labelsLeft.begin(), labelsLeft.end(), labelsRight.begin(), labelsRight.end(), insertIter);
185 if (!duplicateLabels.empty()) {
186 std::stringstream
ss;
187 for (std::set<std::string>::const_iterator iter = duplicateLabels.begin(), iEnd = duplicateLabels.end();
190 ss <<
" \"" << *iter <<
"\"\n";
193 <<
"\"ifExists\" expression must be not be the same as labels used\n"
194 <<
"in other nodes of the expression. The following duplicate\n"
195 <<
"labels were detected:\n"
201 std::set<ParameterTypes>
const& types2)
const {
202 if (!types1.empty()) {
203 std::set<ParameterTypes> duplicateTypes;
204 std::insert_iterator<std::set<ParameterTypes> > insertIter(duplicateTypes, duplicateTypes.begin());
205 std::set_intersection(types1.begin(), types1.end(), types2.begin(), types2.end(), insertIter);
206 if (!duplicateTypes.empty()) {
207 std::stringstream
ss;
208 for (std::set<ParameterTypes>::const_iterator iter = duplicateTypes.begin(), iEnd = duplicateTypes.end();
214 <<
"Types used for wildcards in a node of a ParameterSetDescription\n"
215 <<
"\"ifExists\" expression must be different from types used for other parameters\n"
216 <<
"in other nodes. The following duplicate types were detected:\n"