comparison 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
comparison
equal deleted inserted replaced
59:77833938f0f8 60:8a4bcb3dc3a6
40 #include <map> 40 #include <map>
41 #include <string> 41 #include <string>
42 42
43 namespace vampipe { 43 namespace vampipe {
44 44
45 //!!! doc interface
46 class PluginOutputIdMapper 45 class PluginOutputIdMapper
47 { 46 {
48 public: 47 public:
49 virtual ~PluginOutputIdMapper() { } 48 virtual ~PluginOutputIdMapper() { }
50 49
51 virtual int idToIndex(std::string outputId) const = 0; 50 /**
52 virtual std::string indexToId(int index) const = 0; 51 * Return the index of the given output id in the plugin. The
52 * first output has index 0. If the given output id is unknown,
53 * return -1.
54 */
55 virtual int idToIndex(std::string outputId) const noexcept = 0;
56
57 /**
58 * Return the id of the output with the given index in the
59 * plugin. If the index is out of range, return the empty string.
60 */
61 virtual std::string indexToId(int index) const noexcept = 0;
53 }; 62 };
54 63
55 } 64 }
56 65
57 #endif 66 #endif