Mercurial > hg > piper-cpp
diff bits/PluginOutputIdMapper.h @ 60:8a4bcb3dc3a6
Replace exceptions throughout the JSON-handling and adapter code with string-arg error handling. No longer need exception handling enabled in Emscripten (with its consequent runtime overhead - though we still need to check whether this error handling regime is actually faster).
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 20 Sep 2016 16:35:47 +0100 |
parents | f4244a2d55ac |
children |
line wrap: on
line diff
--- a/bits/PluginOutputIdMapper.h Mon Sep 19 15:52:38 2016 +0100 +++ b/bits/PluginOutputIdMapper.h Tue Sep 20 16:35:47 2016 +0100 @@ -42,14 +42,23 @@ namespace vampipe { -//!!! doc interface class PluginOutputIdMapper { public: virtual ~PluginOutputIdMapper() { } - - virtual int idToIndex(std::string outputId) const = 0; - virtual std::string indexToId(int index) const = 0; + + /** + * Return the index of the given output id in the plugin. The + * first output has index 0. If the given output id is unknown, + * return -1. + */ + virtual int idToIndex(std::string outputId) const noexcept = 0; + + /** + * Return the id of the output with the given index in the + * plugin. If the index is out of range, return the empty string. + */ + virtual std::string indexToId(int index) const noexcept = 0; }; }