345 auto buildMatcher = [](
auto&
nodes) -> std::unique_ptr<DataDescriptorMatcher> {
347 std::make_unique<DataDescriptorMatcher>(DataDescriptorMatcher::Op::Just,
349 for (
size_t ni = 0, ne =
nodes.size(); ni < ne; ++ni) {
351 auto tmp = std::make_unique<DataDescriptorMatcher>(DataDescriptorMatcher::Op::And,
353 std::move(lastMatcher));
354 assert(lastMatcher.get() ==
nullptr);
355 lastMatcher = std::move(tmp);
360 std::unique_ptr<DataDescriptorMatcher> matcher;
361 if (
auto* pval = std::get_if<std::unique_ptr<DataDescriptorMatcher>>(&
inputMatcherNodes[0])) {
363 matcher = std::move(*pval);
368 if (concrete.has_value()) {
380 auto* matcher = std::get_if<std::unique_ptr<DataDescriptorMatcher>>(&child);
381 assert(matcher !=
nullptr);
382 auto* parent = std::get_if<std::unique_ptr<DataDescriptorMatcher>>(&
inputMatcherNodes.back());
383 assert(parent !=
nullptr);
384 std::unique_ptr<DataDescriptorMatcher>
node;
385 auto mergeDown = [&
node, &parent, &child]() ->
bool {
387 if (
auto* pval1 = std::get_if<ConstantValueMatcher>(&((*parent)->getLeft()))) {
389 node = std::make_unique<DataDescriptorMatcher>((*parent)->getOp(),
391 std::move((*parent)->getRight()));
395 if (
auto* pval2 = std::get_if<ConstantValueMatcher>(&((*parent)->getRight()))) {
397 node = std::make_unique<DataDescriptorMatcher>((*parent)->getOp(),
398 std::move((*parent)->getLeft()),
413 auto* parent = std::get_if<std::unique_ptr<DataDescriptorMatcher>>(&
inputMatcherNodes[nMatchers - 2]);
414 assert(parent !=
nullptr);
415 auto node = std::make_unique<DataDescriptorMatcher>((*parent)->getOp(),
417 std::move((*parent)->getRight()));
424 auto* parent = std::get_if<std::unique_ptr<DataDescriptorMatcher>>(&
inputMatcherNodes.back());
425 assert(parent !=
nullptr);
426 auto node = std::make_unique<DataDescriptorMatcher>((*parent)->getOp(),
427 std::move((*parent)->getLeft()),
439 std::unique_ptr<ConfigParamSpec> opt{
nullptr};
442 std::stringstream is;
527 metadata.back().workflowOptions.push_back(*opt);
740 std::string
v(s.c_str(), std::min(s.size(), 4UL));
744 std::string
v(s.c_str(), std::min(s.size(), 16UL));
754 op = DataDescriptorMatcher::Op::And;
755 }
else if (s ==
"or") {
756 op = DataDescriptorMatcher::Op::Or;
757 }
else if (s ==
"xor") {
758 op = DataDescriptorMatcher::Op::Xor;
759 }
else if (s ==
"just") {
760 op = DataDescriptorMatcher::Op::Just;
761 }
else if (s ==
"not") {
762 op = DataDescriptorMatcher::Op::Not;
796 metadata.back().cmdLineArgs.push_back(s);
801 metadata.back().channels.push_back(s);
808 std::stringstream errstr;
809 errstr <<
"No string handling for argument '" << std::string(
str,
length) <<
"' in state " <<
states.back() << std::endl;
810 throw std::runtime_error(errstr.str());