diff --git a/src/core/include/ecal/ecal_publisher.h b/src/core/include/ecal/ecal_publisher.h index 6c789ea..3711f80 100644 --- a/src/core/include/ecal/ecal_publisher.h +++ b/src/core/include/ecal/ecal_publisher.h @@ -125,7 +125,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - ECAL_API virtual bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_); + ECAL_API bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_); /** * @brief Creates this object. @@ -134,14 +134,14 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - ECAL_API virtual bool Create(const std::string& topic_name_); + ECAL_API bool Create(const std::string& topic_name_); /** * @brief Destroys this object. * * @return True if it succeeds, false if it fails. **/ - ECAL_API virtual bool Destroy(); + ECAL_API bool Destroy(); /** * @brief Setup topic information. @@ -282,7 +282,7 @@ namespace eCAL * * @return The topic information. **/ - ECAL_API virtual SDataTypeInformation GetDataTypeInformation() const; + ECAL_API SDataTypeInformation GetDataTypeInformation() const; /** * @brief Dump the whole class state into a string. diff --git a/src/core/include/ecal/ecal_subscriber.h b/src/core/include/ecal/ecal_subscriber.h index d9ac940..b3d8f32 100644 --- a/src/core/include/ecal/ecal_subscriber.h +++ b/src/core/include/ecal/ecal_subscriber.h @@ -136,7 +136,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - ECAL_API virtual bool Create(const std::string& topic_name_); + ECAL_API bool Create(const std::string& topic_name_); /** * @brief Creates this object. @@ -146,14 +146,14 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - ECAL_API virtual bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_); + ECAL_API bool Create(const std::string& topic_name_, const SDataTypeInformation& topic_info_); /** * @brief Destroys this object. * * @return true if it succeeds, false if it fails. **/ - ECAL_API virtual bool Destroy(); + ECAL_API bool Destroy(); /** * @brief Set a set of id's to prefiltering topics (see CPublisher::SetID). @@ -209,7 +209,7 @@ namespace eCAL * * @return True if succeeded, false if not. **/ - ECAL_API virtual bool RemReceiveCallback(); + ECAL_API bool RemReceiveCallback(); /** * @brief Add callback function for subscriber events. @@ -256,7 +256,7 @@ namespace eCAL * * @return The topic information. **/ - ECAL_API virtual SDataTypeInformation GetDataTypeInformation() const; + ECAL_API SDataTypeInformation GetDataTypeInformation() const; /** * @brief Dump the whole class state into a string. diff --git a/src/core/include/ecal/msg/dynamic.h b/src/core/include/ecal/msg/dynamic.h index 7f7b2fe..6f85fa8 100644 --- a/src/core/include/ecal/msg/dynamic.h +++ b/src/core/include/ecal/msg/dynamic.h @@ -34,8 +34,8 @@ namespace eCAL class DynamicReflectionException : public std::exception { public: - explicit DynamicReflectionException(const std::string& message) : message_(message) {} - const char* what() const noexcept override { return message_.c_str(); } + DynamicReflectionException(const std::string& message) : message_(message) {} + virtual const char* what() const throw() { return message_.c_str(); } private: std::string message_; }; diff --git a/src/core/include/ecal/msg/protobuf/ecal_proto_dyn.h b/src/core/include/ecal/msg/protobuf/ecal_proto_dyn.h index 2041770..1b4f15a 100644 --- a/src/core/include/ecal/msg/protobuf/ecal_proto_dyn.h +++ b/src/core/include/ecal/msg/protobuf/ecal_proto_dyn.h @@ -170,7 +170,7 @@ namespace eCAL * * @return true if succeeded otherwise false (details see error_s_) **/ - static bool GetFileDescriptorFromString(const std::string& proto_string_, google::protobuf::FileDescriptorProto* file_desc_proto_, std::string& error_s_); + bool GetFileDescriptorFromString(const std::string& proto_string_, google::protobuf::FileDescriptorProto* file_desc_proto_, std::string& error_s_); protected: google::protobuf::DescriptorPool m_descriptor_pool; @@ -180,15 +180,15 @@ namespace eCAL class ParserErrorCollector : public google::protobuf::io::ErrorCollector { public: - ParserErrorCollector() = default; - ~ParserErrorCollector() override = default; + ParserErrorCollector() {} + ~ParserErrorCollector() {} std::string Get() { return (m_ss.str()); } // Indicates that there was an error in the input at the given line and // column numbers. The numbers are zero-based, so you may want to add // 1 to each before printing them. - void AddError(int line_, int column_, const std::string& msg_) override + void AddError(int line_, int column_, const std::string& msg_) { Add(line_, column_, "ERROR: " + msg_); } @@ -196,7 +196,7 @@ namespace eCAL // Indicates that there was a warning in the input at the given line and // column numbers. The numbers are zero-based, so you may want to add // 1 to each before printing them. - void AddWarning(int line_, int column_, const std::string& msg_) override + void AddWarning(int line_, int column_, const std::string& msg_) { Add(line_, column_, "WARNING: " + msg_); } @@ -213,8 +213,8 @@ namespace eCAL class DescriptorErrorCollector : public google::protobuf::DescriptorPool::ErrorCollector { public: - DescriptorErrorCollector() = default; - ~DescriptorErrorCollector() override = default; + DescriptorErrorCollector() {} + ~DescriptorErrorCollector() {} std::string Get() { return (m_ss.str()); } @@ -224,7 +224,7 @@ namespace eCAL const google::protobuf::Message* descriptor, // Descriptor of the erroneous element. ErrorLocation location, // One of the location constants, above. const std::string& message // Human-readable error message. - ) override + ) { Add(filename, element_name, descriptor, location, "ERROR: " + message); } @@ -235,7 +235,7 @@ namespace eCAL const google::protobuf::Message* descriptor, // Descriptor of the erroneous element. ErrorLocation location, // One of the location constants, above. const std::string& message // Human-readable error message. - ) override + ) { Add(filename, element_name, descriptor, location, "WARNING: " + message); } diff --git a/src/core/include/ecal/msg/protobuf/publisher.h b/src/core/include/ecal/msg/protobuf/publisher.h index bc65dd9..894fc19 100644 --- a/src/core/include/ecal/msg/protobuf/publisher.h +++ b/src/core/include/ecal/msg/protobuf/publisher.h @@ -76,10 +76,11 @@ namespace eCAL } size_t GetSize() override { + size_t size(0); #if GOOGLE_PROTOBUF_VERSION >= 3001000 - auto size = static_cast(message.ByteSizeLong()); + size = static_cast(message.ByteSizeLong()); #else - auto size = static_cast(message.ByteSize()); + size = static_cast(message.ByteSize()); #endif return(size); }; @@ -142,7 +143,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - bool Create(const std::string& topic_name_) override + bool Create(const std::string& topic_name_) { return(eCAL::CPublisher::Create(topic_name_, GetDataTypeInformation())); } diff --git a/src/core/include/ecal/msg/protobuf/server.h b/src/core/include/ecal/msg/protobuf/server.h index 67c897c..2f6cb8c 100644 --- a/src/core/include/ecal/msg/protobuf/server.h +++ b/src/core/include/ecal/msg/protobuf/server.h @@ -67,7 +67,7 @@ namespace eCAL * * @param service_ Google protobuf service instance. **/ - explicit CServiceServer(std::shared_ptr service_) : m_service(nullptr) + CServiceServer(std::shared_ptr service_) : m_service(nullptr) { Create(service_); } @@ -86,7 +86,7 @@ namespace eCAL /** * @brief Destructor. **/ - ~CServiceServer() override + ~CServiceServer() { Destroy(); } diff --git a/src/core/include/ecal/msg/publisher.h b/src/core/include/ecal/msg/publisher.h index 9e5e928..ae1556b 100644 --- a/src/core/include/ecal/msg/publisher.h +++ b/src/core/include/ecal/msg/publisher.h @@ -106,7 +106,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - bool Create(const std::string& topic_name_, const struct SDataTypeInformation& topic_info_) override + bool Create(const std::string& topic_name_, const struct SDataTypeInformation& topic_info_) { return(CPublisher::Create(topic_name_, topic_info_)); } @@ -116,7 +116,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - bool Destroy() override + bool Destroy() { return(CPublisher::Destroy()); } @@ -163,7 +163,7 @@ namespace eCAL protected: // We cannot make it pure virtual, as it would break a bunch of implementations, who are not (yet) implementing this function - struct SDataTypeInformation GetDataTypeInformation() const override { return SDataTypeInformation{}; } + virtual struct SDataTypeInformation GetDataTypeInformation() const { return SDataTypeInformation{}; } private: virtual size_t GetSize(const T& msg_) const = 0; virtual bool Serialize(const T& msg_, char* buffer_, size_t size_) const = 0; diff --git a/src/core/include/ecal/msg/subscriber.h b/src/core/include/ecal/msg/subscriber.h index bb4426c..cf92e67 100644 --- a/src/core/include/ecal/msg/subscriber.h +++ b/src/core/include/ecal/msg/subscriber.h @@ -64,7 +64,7 @@ namespace eCAL { } - ~CMsgSubscriber() override = default; + virtual ~CMsgSubscriber() = default; /** * @brief Copy Constructor is not available. @@ -79,7 +79,7 @@ namespace eCAL /** * @brief Move Constructor **/ - CMsgSubscriber(CMsgSubscriber&& rhs) noexcept + CMsgSubscriber(CMsgSubscriber&& rhs) : CSubscriber(std::move(rhs)) , m_cb_callback(std::move(rhs.m_cb_callback)) { @@ -97,7 +97,7 @@ namespace eCAL /** * @brief Move assignment **/ - CMsgSubscriber& operator=(CMsgSubscriber&& rhs) noexcept + CMsgSubscriber& operator=(CMsgSubscriber&& rhs) { CSubscriber::operator=(std::move(rhs)); @@ -123,7 +123,7 @@ namespace eCAL * * @return true if it succeeds, false if it fails. **/ - bool Create(const std::string& topic_name_, const struct SDataTypeInformation& topic_info_) override + bool Create(const std::string& topic_name_, const struct SDataTypeInformation& topic_info_) { return(CSubscriber::Create(topic_name_, topic_info_)); } @@ -133,7 +133,7 @@ namespace eCAL * * @return true if it succeeds, false if it fails. **/ - bool Destroy() override + bool Destroy() { RemReceiveCallback(); return(CSubscriber::Destroy()); @@ -193,7 +193,7 @@ namespace eCAL * * @return True if it succeeds, false if it fails. **/ - bool RemReceiveCallback() override + bool RemReceiveCallback() { bool ret = CSubscriber::RemReceiveCallback(); @@ -205,7 +205,7 @@ namespace eCAL protected: // We cannot make it pure virtual, as it would break a bunch of implementations, who are not (yet) implementing this function - struct SDataTypeInformation GetDataTypeInformation() const override { return SDataTypeInformation{}; } + virtual struct SDataTypeInformation GetDataTypeInformation() const { return SDataTypeInformation{}; } virtual bool Deserialize(T& msg_, const void* buffer_, size_t size_) const = 0; private: