comparison runner/FeatureExtractionManager.cpp @ 129:7a7a46d4bd3c

Fail explicitly if a nonexistent plugin output is requested
author Chris Cannam
date Fri, 10 Oct 2014 15:00:47 +0100
parents b514bae9555e
children 65dabaebe604
comparison
equal deleted inserted replaced
128:c24270fc6635 129:7a7a46d4bd3c
341 } 341 }
342 342
343 if (transform.getOutput() == "") { 343 if (transform.getOutput() == "") {
344 transform.setOutput 344 transform.setOutput
345 (plugin->getOutputDescriptors()[0].identifier.c_str()); 345 (plugin->getOutputDescriptors()[0].identifier.c_str());
346 } else {
347 if (m_pluginOutputs[plugin].find
348 (transform.getOutput().toLocal8Bit().data()) ==
349 m_pluginOutputs[plugin].end()) {
350 cerr << "ERROR: Transform requests nonexistent plugin output \""
351 << transform.getOutput()
352 << "\"" << endl;
353 return false;
354 }
346 } 355 }
347 356
348 m_transformPluginMap[transform] = plugin; 357 m_transformPluginMap[transform] = plugin;
349 358
350 if (!(originalTransform == transform)) { 359 if (!(originalTransform == transform)) {
661 haveExtents = true; 670 haveExtents = true;
662 671
663 string outputId = transform.getOutput().toStdString(); 672 string outputId = transform.getOutput().toStdString();
664 if (m_pluginOutputs[plugin].find(outputId) == 673 if (m_pluginOutputs[plugin].find(outputId) ==
665 m_pluginOutputs[plugin].end()) { 674 m_pluginOutputs[plugin].end()) {
666 //!!! throw? 675 // We shouldn't actually reach this point:
667 cerr << "WARNING: Nonexistent plugin output \"" << outputId << "\" requested for transform \"" 676 // addFeatureExtractor tests whether the output exists
677 cerr << "ERROR: Nonexistent plugin output \"" << outputId << "\" requested for transform \""
668 << transform.getIdentifier().toStdString() << "\", ignoring this transform" 678 << transform.getIdentifier().toStdString() << "\", ignoring this transform"
669 << endl; 679 << endl;
670 /* 680 /*
671 cerr << "Known outputs for all plugins are as follows:" << endl; 681 cerr << "Known outputs for all plugins are as follows:" << endl;
672 for (PluginOutputMap::const_iterator k = m_pluginOutputs.begin(); 682 for (PluginOutputMap::const_iterator k = m_pluginOutputs.begin();