Mercurial > hg > piper-cpp
comparison vamp-support/PreservingPluginOutputIdMapper.h @ 280:4b581a498981
Use override throughout
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Mon, 26 Nov 2018 13:39:01 +0000 |
parents | 7ada63fe1084 |
children |
comparison
equal
deleted
inserted
replaced
279:b7eec400cd94 | 280:4b581a498981 |
---|---|
50 class PreservingPluginOutputIdMapper : public PluginOutputIdMapper | 50 class PreservingPluginOutputIdMapper : public PluginOutputIdMapper |
51 { | 51 { |
52 public: | 52 public: |
53 PreservingPluginOutputIdMapper() { } | 53 PreservingPluginOutputIdMapper() { } |
54 | 54 |
55 virtual int idToIndex(std::string outputId) const noexcept { | 55 int idToIndex(std::string outputId) const noexcept override { |
56 int n = int(m_ids.size()); | 56 int n = int(m_ids.size()); |
57 int i = 0; | 57 int i = 0; |
58 while (i < n) { | 58 while (i < n) { |
59 if (outputId == m_ids[i]) { | 59 if (outputId == m_ids[i]) { |
60 return i; | 60 return i; |
63 } | 63 } |
64 m_ids.push_back(outputId); | 64 m_ids.push_back(outputId); |
65 return i; | 65 return i; |
66 } | 66 } |
67 | 67 |
68 virtual std::string indexToId(int index) const noexcept { | 68 std::string indexToId(int index) const noexcept override { |
69 if (index < 0 || size_t(index) >= m_ids.size()) return ""; | 69 if (index < 0 || size_t(index) >= m_ids.size()) return ""; |
70 return m_ids[index]; | 70 return m_ids[index]; |
71 } | 71 } |
72 | 72 |
73 private: | 73 private: |