From e00a58a05f9895008e1a3d7939a125d5c3c3ba04 Mon Sep 17 00:00:00 2001 From: Sayed Adel Date: Thu, 3 May 2018 20:12:24 +0000 Subject: [PATCH] samples: add C++11 override to virtual methods --- .../cpp/tutorial_code/dnn/custom_layers.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/samples/cpp/tutorial_code/dnn/custom_layers.cpp b/samples/cpp/tutorial_code/dnn/custom_layers.cpp index 3fc9e61279..217e53659f 100644 --- a/samples/cpp/tutorial_code/dnn/custom_layers.cpp +++ b/samples/cpp/tutorial_code/dnn/custom_layers.cpp @@ -16,18 +16,18 @@ public: virtual bool getMemoryShapes(const std::vector > &inputs, const int requiredOutputs, std::vector > &outputs, - std::vector > &internals) const; + std::vector > &internals) const CV_OVERRIDE; //! [MyLayer::getMemoryShapes] //! [MyLayer::forward] - virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals); + virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE; //! [MyLayer::forward] //! [MyLayer::finalize] - virtual void finalize(const std::vector &inputs, std::vector &outputs); + virtual void finalize(const std::vector &inputs, std::vector &outputs) CV_OVERRIDE; //! [MyLayer::finalize] - virtual void forward(cv::InputArrayOfArrays inputs, cv::OutputArrayOfArrays outputs, cv::OutputArrayOfArrays internals); + virtual void forward(cv::InputArrayOfArrays inputs, cv::OutputArrayOfArrays outputs, cv::OutputArrayOfArrays internals) CV_OVERRIDE; }; //! [A custom layer interface] @@ -49,7 +49,7 @@ public: virtual bool getMemoryShapes(const std::vector > &inputs, const int requiredOutputs, std::vector > &outputs, - std::vector > &internals) const + std::vector > &internals) const CV_OVERRIDE { CV_UNUSED(requiredOutputs); CV_UNUSED(internals); std::vector outShape(4); @@ -62,7 +62,7 @@ public: } // Implementation of this custom layer is based on https://github.com/cdmh/deeplab-public/blob/master/src/caffe/layers/interp_layer.cpp - virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_UNUSED(internals); cv::Mat& inp = *inputs[0]; @@ -105,7 +105,7 @@ public: } } - virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) {} + virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) CV_OVERRIDE {} private: int outWidth, outHeight; @@ -132,7 +132,7 @@ public: virtual bool getMemoryShapes(const std::vector > &inputs, const int requiredOutputs, std::vector > &outputs, - std::vector > &internals) const + std::vector > &internals) const CV_OVERRIDE { CV_UNUSED(requiredOutputs); CV_UNUSED(internals); std::vector outShape(4); @@ -146,7 +146,7 @@ public: // This implementation is based on a reference implementation from // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/kernels/internal/reference/reference_ops.h - virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) + virtual void forward(std::vector &inputs, std::vector &outputs, std::vector &internals) CV_OVERRIDE { CV_UNUSED(internals); cv::Mat& inp = *inputs[0]; @@ -187,7 +187,7 @@ public: } } - virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) {} + virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) CV_OVERRIDE {} private: static inline int offset(const cv::MatSize& size, int c, int x, int y, int b)