Mercurial > hg > piper-cpp
diff bits/CountingPluginHandleMapper.h @ 52:e90fd30990eb
Error handling, and pass plugin handles through
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 16 Sep 2016 16:20:05 +0100 |
parents | f4244a2d55ac |
children | 7aec704705c7 |
line wrap: on
line diff
--- a/bits/CountingPluginHandleMapper.h Fri Sep 16 15:10:57 2016 +0100 +++ b/bits/CountingPluginHandleMapper.h Fri Sep 16 16:20:05 2016 +0100 @@ -67,6 +67,7 @@ void removePlugin(Handle h) { if (m_plugins.find(h) == m_plugins.end()) { + std::cerr << "remove: no handle " << h << std::endl; throw NotFound(); } Vamp::Plugin *p = m_plugins[h]; @@ -82,6 +83,7 @@ Handle pluginToHandle(Vamp::Plugin *p) const { if (m_rplugins.find(p) == m_rplugins.end()) { + std::cerr << "pluginToHandle: no plugin " << p << std::endl; throw NotFound(); } return m_rplugins.at(p); @@ -89,6 +91,7 @@ Vamp::Plugin *handleToPlugin(Handle h) const { if (m_plugins.find(h) == m_plugins.end()) { + std::cerr << "handleToPlugin: no handle " << h << std::endl; throw NotFound(); } return m_plugins.at(h); @@ -97,11 +100,13 @@ //!!! iffy: mapper will move when another plugin is added. return by value? const PluginOutputIdMapper &pluginToOutputIdMapper(Vamp::Plugin *p) const { // pluginToHandle checks the plugin has been registered with us + std::cerr << "output id mapper requested for plugin with handle " << pluginToHandle(p) << std::endl; return *m_outputMappers.at(pluginToHandle(p)); } //!!! iffy: mapper will move when another plugin is added. return by value? const PluginOutputIdMapper &handleToOutputIdMapper(Handle h) const { + std::cerr << "output id mapper requested for handle " << h << std::endl; if (m_plugins.find(h) == m_plugins.end()) { throw NotFound(); }