diff bits/PluginHandleMapper.h @ 57:7aec704705c7

Make the output ID mapper stuff safer by using shared_ptr
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 19 Sep 2016 14:43:32 +0100
parents f4244a2d55ac
children 8a4bcb3dc3a6
line wrap: on
line diff
--- a/bits/PluginHandleMapper.h	Mon Sep 19 14:10:19 2016 +0100
+++ b/bits/PluginHandleMapper.h	Mon Sep 19 14:43:32 2016 +0100
@@ -35,9 +35,10 @@
 #ifndef VAMPIPE_PLUGIN_HANDLE_MAPPER_H
 #define VAMPIPE_PLUGIN_HANDLE_MAPPER_H
 
+#include "PluginOutputIdMapper.h"
+
 #include <vamp-hostsdk/Plugin.h>
-
-#include "PluginOutputIdMapper.h"
+#include <memory>
 
 namespace vampipe {
 
@@ -58,8 +59,11 @@
     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
+    virtual const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper
+    (Vamp::Plugin *p) const = 0; // may throw NotFound
+
+    virtual const std::shared_ptr<PluginOutputIdMapper> handleToOutputIdMapper
+    (Handle h) const = 0; // may throw NotFound
 };
 
 }