changeset 280:4b581a498981

Use override throughout
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 26 Nov 2018 13:39:01 +0000
parents b7eec400cd94
children c0b29d2af155
files vamp-client/PiperVampPlugin.h vamp-client/qt/PiperAutoPlugin.h vamp-support/AssignedPluginHandleMapper.h vamp-support/CountingPluginHandleMapper.h vamp-support/DefaultPluginOutputIdMapper.h vamp-support/PreservingPluginHandleMapper.h vamp-support/PreservingPluginOutputIdMapper.h
diffstat 7 files changed, 74 insertions(+), 74 deletions(-) [+]
line wrap: on
line diff
--- a/vamp-client/PiperVampPlugin.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-client/PiperVampPlugin.h	Mon Nov 26 13:39:01 2018 +0000
@@ -129,35 +129,35 @@
         }
     }
     
-    virtual std::string getIdentifier() const {
+    std::string getIdentifier() const override {
         return m_psd.basic.identifier;
     }
 
-    virtual std::string getName() const {
+    std::string getName() const override {
         return m_psd.basic.name;
     }
 
-    virtual std::string getDescription() const {
+    std::string getDescription() const override {
         return m_psd.basic.description;
     }
 
-    virtual std::string getMaker() const {
+    std::string getMaker() const override {
         return m_psd.maker;
     }
 
-    virtual std::string getCopyright() const {
+    std::string getCopyright() const override {
         return m_psd.copyright;
     }
 
-    virtual int getPluginVersion() const {
+    int getPluginVersion() const override {
         return m_psd.pluginVersion;
     }
 
-    virtual ParameterList getParameterDescriptors() const {
+    ParameterList getParameterDescriptors() const override {
         return m_psd.parameters;
     }
 
-    virtual float getParameter(std::string name) const {
+    float getParameter(std::string name) const override {
         if (m_config.parameterValues.find(name) != m_config.parameterValues.end()) {
             return m_config.parameterValues.at(name);
         } else {
@@ -165,7 +165,7 @@
         }
     }
 
-    virtual void setParameter(std::string name, float value) {
+    void setParameter(std::string name, float value) override {
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
         }
@@ -176,15 +176,15 @@
         m_config.parameterValues[name] = value;
     }
 
-    virtual ProgramList getPrograms() const {
+    ProgramList getPrograms() const override {
         return m_psd.programs;
     }
 
-    virtual std::string getCurrentProgram() const {
+    std::string getCurrentProgram() const override {
         return m_config.currentProgram;
     }
     
-    virtual void selectProgram(std::string program) {
+    void selectProgram(std::string program) override {
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
         }
@@ -195,9 +195,9 @@
         m_config.currentProgram = program;
     }
 
-    virtual bool initialise(size_t inputChannels,
+    bool initialise(size_t inputChannels,
                             size_t stepSize,
-                            size_t blockSize) {
+                            size_t blockSize) override {
 
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
@@ -257,7 +257,7 @@
         }
     }
 
-    virtual void reset() {
+    void reset() override {
         
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
@@ -277,33 +277,33 @@
         m_state = Configured;
     }
 
-    virtual InputDomain getInputDomain() const {
+    InputDomain getInputDomain() const override {
         return m_psd.inputDomain;
     }
 
-    virtual size_t getPreferredBlockSize() const {
+    size_t getPreferredBlockSize() const override {
         // Return this from m_config instead of m_defaultConfig, so
         // that it gets updated in the event of an initialise() call
         // that fails for the wrong value
         return m_config.framing.blockSize;
     }
 
-    virtual size_t getPreferredStepSize() const {
+    size_t getPreferredStepSize() const override {
         // Return this from m_config instead of m_defaultConfig, so
         // that it gets updated in the event of an initialise() call
         // that fails for the wrong value
         return m_config.framing.stepSize;
     }
 
-    virtual size_t getMinChannelCount() const {
+    size_t getMinChannelCount() const override {
         return m_psd.minChannelCount;
     }
 
-    virtual size_t getMaxChannelCount() const {
+    size_t getMaxChannelCount() const override {
         return m_psd.maxChannelCount;
     }
 
-    virtual OutputList getOutputDescriptors() const {
+    OutputList getOutputDescriptors() const override {
 
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
@@ -328,8 +328,8 @@
         return staticOutputs;
     }
 
-    virtual FeatureSet process(const float *const *inputBuffers,
-                               Vamp::RealTime timestamp) {
+    FeatureSet process(const float *const *inputBuffers,
+                               Vamp::RealTime timestamp) override {
 
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
@@ -365,7 +365,7 @@
         }
     }
 
-    virtual FeatureSet getRemainingFeatures() {
+    FeatureSet getRemainingFeatures() override {
 
         if (m_state == Failed) {
             throw std::logic_error("Plugin is in failed state");
--- a/vamp-client/qt/PiperAutoPlugin.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-client/qt/PiperAutoPlugin.h	Mon Nov 26 13:39:01 2018 +0000
@@ -117,94 +117,94 @@
         return (m_plugin != nullptr);
     }
     
-    virtual std::string getIdentifier() const {
+    std::string getIdentifier() const override {
         return getPlugin()->getIdentifier();
     }
 
-    virtual std::string getName() const {
+    std::string getName() const override {
         return getPlugin()->getName();
     }
 
-    virtual std::string getDescription() const {
+    std::string getDescription() const override {
         return getPlugin()->getDescription();
     }
 
-    virtual std::string getMaker() const {
+    std::string getMaker() const override {
         return getPlugin()->getMaker();
     }
 
-    virtual std::string getCopyright() const {
+    std::string getCopyright() const override {
         return getPlugin()->getCopyright();
     }
 
-    virtual int getPluginVersion() const {
+    int getPluginVersion() const override {
         return getPlugin()->getPluginVersion();
     }
 
-    virtual ParameterList getParameterDescriptors() const {
+    ParameterList getParameterDescriptors() const override {
         return getPlugin()->getParameterDescriptors();
     }
 
-    virtual float getParameter(std::string name) const {
+    float getParameter(std::string name) const override {
         return getPlugin()->getParameter(name);
     }
 
-    virtual void setParameter(std::string name, float value) {
+    void setParameter(std::string name, float value) override {
         getPlugin()->setParameter(name, value);
     }
 
-    virtual ProgramList getPrograms() const {
+    ProgramList getPrograms() const override {
         return getPlugin()->getPrograms();
     }
 
-    virtual std::string getCurrentProgram() const {
+    std::string getCurrentProgram() const override {
         return getPlugin()->getCurrentProgram();
     }
     
-    virtual void selectProgram(std::string program) {
+    void selectProgram(std::string program) override {
         getPlugin()->selectProgram(program);
     }
 
-    virtual bool initialise(size_t inputChannels,
+    bool initialise(size_t inputChannels,
                             size_t stepSize,
-                            size_t blockSize) {
+                            size_t blockSize) override {
         return getPlugin()->initialise(inputChannels, stepSize, blockSize);
     }
 
-    virtual void reset() {
+    void reset() override {
         getPlugin()->reset();
     }
 
-    virtual InputDomain getInputDomain() const {
+    InputDomain getInputDomain() const override {
         return getPlugin()->getInputDomain();
     }
 
-    virtual size_t getPreferredBlockSize() const {
+    size_t getPreferredBlockSize() const override {
         return getPlugin()->getPreferredBlockSize();
     }
 
-    virtual size_t getPreferredStepSize() const {
+    size_t getPreferredStepSize() const override {
         return getPlugin()->getPreferredStepSize();
     }
 
-    virtual size_t getMinChannelCount() const {
+    size_t getMinChannelCount() const override {
         return getPlugin()->getMinChannelCount();
     }
 
-    virtual size_t getMaxChannelCount() const {
+    size_t getMaxChannelCount() const override {
         return getPlugin()->getMaxChannelCount();
     }
 
-    virtual OutputList getOutputDescriptors() const {
+    OutputList getOutputDescriptors() const override {
         return getPlugin()->getOutputDescriptors();
     }
 
-    virtual FeatureSet process(const float *const *inputBuffers,
-                               Vamp::RealTime timestamp) {
+    FeatureSet process(const float *const *inputBuffers,
+                               Vamp::RealTime timestamp) override {
         return getPlugin()->process(inputBuffers, timestamp);
     }
 
-    virtual FeatureSet getRemainingFeatures() {
+    FeatureSet getRemainingFeatures() override {
         return getPlugin()->getRemainingFeatures();
     }
 
--- a/vamp-support/AssignedPluginHandleMapper.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-support/AssignedPluginHandleMapper.h	Mon Nov 26 13:39:01 2018 +0000
@@ -82,14 +82,14 @@
         return (m_rplugins.find(p) != m_rplugins.end());
     }
     
-    Handle pluginToHandle(Vamp::Plugin *p) const noexcept {
+    Handle pluginToHandle(Vamp::Plugin *p) const noexcept override {
 	if (m_rplugins.find(p) == m_rplugins.end()) {
             return INVALID_HANDLE;
 	}
 	return m_rplugins.at(p);
     }
     
-    Vamp::Plugin *handleToPlugin(Handle h) const noexcept {
+    Vamp::Plugin *handleToPlugin(Handle h) const noexcept override {
 	if (m_plugins.find(h) == m_plugins.end()) {
             return nullptr;
 	}
@@ -97,12 +97,12 @@
     }
 
     const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper
-    (Vamp::Plugin *p) const noexcept {
+    (Vamp::Plugin *p) const noexcept override {
         return handleToOutputIdMapper(pluginToHandle(p));
     }
 
     const std::shared_ptr<PluginOutputIdMapper> handleToOutputIdMapper
-    (Handle h) const noexcept {
+    (Handle h) const noexcept override {
 	if (h != INVALID_HANDLE &&
             m_outputMappers.find(h) != m_outputMappers.end()) {
             return m_outputMappers.at(h);
--- a/vamp-support/CountingPluginHandleMapper.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-support/CountingPluginHandleMapper.h	Mon Nov 26 13:39:01 2018 +0000
@@ -58,21 +58,21 @@
         m_sub.removePlugin(h);
     }
     
-    Handle pluginToHandle(Vamp::Plugin *p) const noexcept {
+    Handle pluginToHandle(Vamp::Plugin *p) const noexcept override {
         return m_sub.pluginToHandle(p);
     }
     
-    Vamp::Plugin *handleToPlugin(Handle h) const noexcept {
+    Vamp::Plugin *handleToPlugin(Handle h) const noexcept override {
         return m_sub.handleToPlugin(h);
     }
 
     const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper
-    (Vamp::Plugin *p) const noexcept {
+    (Vamp::Plugin *p) const noexcept override {
         return m_sub.pluginToOutputIdMapper(p);
     }
 
     const std::shared_ptr<PluginOutputIdMapper> handleToOutputIdMapper
-    (Handle h) const noexcept {
+    (Handle h) const noexcept override {
         return m_sub.handleToOutputIdMapper(h);
     }
 
--- a/vamp-support/DefaultPluginOutputIdMapper.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-support/DefaultPluginOutputIdMapper.h	Mon Nov 26 13:39:01 2018 +0000
@@ -49,7 +49,7 @@
 	}
     }
 
-    virtual int idToIndex(std::string outputId) const noexcept {
+    int idToIndex(std::string outputId) const noexcept override {
 	int n = int(m_ids.size());
 	for (int i = 0; i < n; ++i) {
 	    if (outputId == m_ids[i]) {
@@ -59,7 +59,7 @@
 	return -1;
     }
 
-    virtual std::string indexToId(int index) const noexcept {
+    std::string indexToId(int index) const noexcept override {
         if (index < 0 || size_t(index) >= m_ids.size()) return "";
 	return m_ids[index];
     }
--- a/vamp-support/PreservingPluginHandleMapper.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-support/PreservingPluginHandleMapper.h	Mon Nov 26 13:39:01 2018 +0000
@@ -54,16 +54,16 @@
 {
     class NotAPlugin : public Vamp::Plugin
     {
-        #define STR(x) std::string get##x() const { return "not-a-plugin"; }
+        #define STR(x) std::string get##x() const override { return "not-a-plugin"; }
     public:
         STR(Identifier) STR(Name) STR(Description) STR(Maker) STR(Copyright)
-        int getPluginVersion() const { return 1; }
-        bool initialise(size_t, size_t, size_t) { return false; }
-        void reset() { }
-        InputDomain getInputDomain() const { return TimeDomain; }
-        OutputList getOutputDescriptors() const { return {}; }
-        FeatureSet process(const float *const *, Vamp::RealTime) { return {}; }
-        FeatureSet getRemainingFeatures() { return {}; }
+        int getPluginVersion() const override { return 1; }
+        bool initialise(size_t, size_t, size_t) override { return false; }
+        void reset() override { }
+        InputDomain getInputDomain() const override { return TimeDomain; }
+        OutputList getOutputDescriptors() const override { return {}; }
+        FeatureSet process(const float *const *, Vamp::RealTime) override { return {}; }
+        FeatureSet getRemainingFeatures() override { return {}; }
         NotAPlugin() : Plugin(1) { }
     };
     
@@ -77,7 +77,7 @@
         delete m_plugin;
     }
 
-    virtual Handle pluginToHandle(Vamp::Plugin *p) const noexcept {
+    Handle pluginToHandle(Vamp::Plugin *p) const noexcept override {
         if (!p) return INVALID_HANDLE;
 	if (p == m_plugin) return m_handle;
 	else {
@@ -89,7 +89,7 @@
 	}
     }
 
-    virtual Vamp::Plugin *handleToPlugin(Handle h) const noexcept {
+    Vamp::Plugin *handleToPlugin(Handle h) const noexcept override {
         if (h == INVALID_HANDLE) return nullptr;
         if (h == m_handle) return m_plugin;
         if (m_handle != INVALID_HANDLE) {
@@ -111,14 +111,14 @@
         return m_plugin;
     }
 
-    virtual const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper
-    (Vamp::Plugin *p) const noexcept {
+    const std::shared_ptr<PluginOutputIdMapper> pluginToOutputIdMapper
+    (Vamp::Plugin *p) const noexcept override {
         if (!p) return {};
         return m_omapper;
     }
         
-    virtual const std::shared_ptr<PluginOutputIdMapper> handleToOutputIdMapper
-    (Handle h) const noexcept {
+    const std::shared_ptr<PluginOutputIdMapper> handleToOutputIdMapper
+    (Handle h) const noexcept override {
         if (h == INVALID_HANDLE) return {};
         return m_omapper;
     }
--- a/vamp-support/PreservingPluginOutputIdMapper.h	Thu Nov 01 14:04:58 2018 +0000
+++ b/vamp-support/PreservingPluginOutputIdMapper.h	Mon Nov 26 13:39:01 2018 +0000
@@ -52,7 +52,7 @@
 public:
     PreservingPluginOutputIdMapper() { }
 
-    virtual int idToIndex(std::string outputId) const noexcept {
+    int idToIndex(std::string outputId) const noexcept override {
 	int n = int(m_ids.size());
 	int i = 0;
 	while (i < n) {
@@ -65,7 +65,7 @@
 	return i;
     }
 
-    virtual std::string indexToId(int index) const noexcept {
+    std::string indexToId(int index) const noexcept override {
         if (index < 0 || size_t(index) >= m_ids.size()) return "";
 	return m_ids[index];
     }