comparison vamp-support/PreservingPluginHandleMapper.h @ 263:9a044706ab73

Comments on dubiousness of all this
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 12 Oct 2018 11:12:09 +0100
parents 427c4c725085
children 7ada63fe1084
comparison
equal deleted inserted replaced
262:853aeab95acf 263:9a044706ab73
42 42
43 namespace piper_vamp { 43 namespace piper_vamp {
44 44
45 //!!! document -- this is a passthrough thing for a single plugin 45 //!!! document -- this is a passthrough thing for a single plugin
46 //!!! handle only, it does not use actually valid Plugin pointers at 46 //!!! handle only, it does not use actually valid Plugin pointers at
47 //!!! all 47 //!!! all. Or, better, reimplement in a way that doesn't involve
48 //!!! such alarmingly invalid reinterpret_casts
48 49
49 class PreservingPluginHandleMapper : public PluginHandleMapper 50 class PreservingPluginHandleMapper : public PluginHandleMapper
50 { 51 {
51 public: 52 public:
52 PreservingPluginHandleMapper() : 53 PreservingPluginHandleMapper() :
67 } 68 }
68 69
69 virtual Vamp::Plugin *handleToPlugin(Handle h) const noexcept { 70 virtual Vamp::Plugin *handleToPlugin(Handle h) const noexcept {
70 if (h == INVALID_HANDLE) return nullptr; 71 if (h == INVALID_HANDLE) return nullptr;
71 m_handle = h; 72 m_handle = h;
73 //!!! see comment at top
72 m_plugin = reinterpret_cast<Vamp::Plugin *>(h); 74 m_plugin = reinterpret_cast<Vamp::Plugin *>(h);
73 return m_plugin; 75 return m_plugin;
74 } 76 }
75 77
76 virtual const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper 78 virtual const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper