diff bits/PluginHandleMapper.h @ 51:f4244a2d55ac

Introduce and use output id mappers
author Chris Cannam <c.cannam@qmul.ac.uk>
date Fri, 16 Sep 2016 15:10:57 +0100
parents 55d69b26d4db
children 7aec704705c7
line wrap: on
line diff
--- a/bits/PluginHandleMapper.h	Fri Sep 16 14:15:41 2016 +0100
+++ b/bits/PluginHandleMapper.h	Fri Sep 16 15:10:57 2016 +0100
@@ -37,6 +37,8 @@
 
 #include <vamp-hostsdk/Plugin.h>
 
+#include "PluginOutputIdMapper.h"
+
 namespace vampipe {
 
 class PluginHandleMapper
@@ -44,13 +46,20 @@
     // NB the handle type must fit in a JSON number
     
 public:
+    typedef int32_t Handle;
+
+    virtual ~PluginHandleMapper() { }
+    
     class NotFound : virtual public std::runtime_error {
     public:
         NotFound() : runtime_error("plugin or handle not found in mapper") { }
     };
     
-    virtual int32_t pluginToHandle(Vamp::Plugin *) const = 0; // may throw NotFound
-    virtual Vamp::Plugin *handleToPlugin(int32_t)  const = 0; // may throw NotFound
+    virtual Handle pluginToHandle(Vamp::Plugin *) const = 0; // may throw NotFound
+    virtual Vamp::Plugin *handleToPlugin(Handle)  const = 0; // may throw NotFound
+
+    virtual const PluginOutputIdMapper &pluginToOutputIdMapper(Vamp::Plugin *p) const = 0; // may throw NotFound
+    virtual const PluginOutputIdMapper &handleToOutputIdMapper(Handle h) const = 0; // may throw NotFound
 };
 
 }