comparison runner/FeatureExtractionManager.cpp @ 58:350f61d5d9be

Small simplification
author Chris Cannam
date Mon, 09 Jan 2012 14:55:17 +0000
parents 513230b19248
children 03b1d83fca29
comparison
equal deleted inserted replaced
57:513230b19248 58:350f61d5d9be
771 // used as keys to m_plugins. But the plugin type comes from the 771 // used as keys to m_plugins. But the plugin type comes from the
772 // Vamp SDK, so this change is more localised. 772 // Vamp SDK, so this change is more localised.
773 773
774 // Thanks to Matthias for this. 774 // Thanks to Matthias for this.
775 775
776 // Not the same as PluginMap::value_type (which has const key) 776 typedef map<Transform, PluginMap::value_type> OrderedPluginMap;
777 typedef pair<PluginMap::key_type, PluginMap::mapped_type> PluginMapEntry; 777 OrderedPluginMap orderedPlugins;
778 typedef map<Transform, PluginMapEntry> TransformOrderedPluginMap;
779 TransformOrderedPluginMap orderedPlugins;
780 778
781 for (PluginMap::iterator pi = m_plugins.begin(); 779 for (PluginMap::iterator pi = m_plugins.begin();
782 pi != m_plugins.end(); ++pi) { 780 pi != m_plugins.end(); ++pi) {
783 Transform firstForPlugin = (pi->second).begin()->first; 781 Transform firstForPlugin = (pi->second).begin()->first;
784 orderedPlugins[firstForPlugin] = PluginMapEntry(pi->first, pi->second); 782 orderedPlugins.insert(OrderedPluginMap::value_type(firstForPlugin, *pi));
785 } 783 }
786 784
787 for (TransformOrderedPluginMap::iterator superPi = orderedPlugins.begin(); 785 for (OrderedPluginMap::iterator superPi = orderedPlugins.begin();
788 superPi != orderedPlugins.end(); ++superPi) { 786 superPi != orderedPlugins.end(); ++superPi) {
789 787
790 // The value we extract from this map is just the same as the 788 // The value we extract from this map is just the same as the
791 // value_type we get from iterating over our PluginMap 789 // value_type we get from iterating over our PluginMap
792 // directly -- but we happen to get them in the right order 790 // directly -- but we happen to get them in the right order
793 // now because the map iterator is ordered by the Transform 791 // now because the map iterator is ordered by the Transform
794 // key type ordering 792 // key type ordering
795 PluginMapEntry pi = superPi->second; 793 PluginMap::value_type pi = superPi->second;
796 794
797 Plugin *plugin = pi.first; 795 Plugin *plugin = pi.first;
798 Plugin::FeatureSet featureSet = plugin->getRemainingFeatures(); 796 Plugin::FeatureSet featureSet = plugin->getRemainingFeatures();
799 797
800 if (!m_summariesOnly) { 798 if (!m_summariesOnly) {