From 3a3d22ae2378d4d5e47c5d65493ecba825ab466d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Hern=C3=A1ndez=20Cordero?= Date: Fri, 23 Feb 2024 16:23:39 +0100 Subject: [PATCH] Add a virtual destructor to suppress compiler warning (#502) (#505) Signed-off-by: Michael Carroll Co-authored-by: Michael Carroll --- ros_gz_bridge/CMakeLists.txt | 1 + .../src/service_factory_interface.cpp | 24 +++++++++++++++++++ .../src/service_factory_interface.hpp | 2 ++ 3 files changed, 27 insertions(+) create mode 100644 ros_gz_bridge/src/service_factory_interface.cpp diff --git a/ros_gz_bridge/CMakeLists.txt b/ros_gz_bridge/CMakeLists.txt index 4d0e4057..596dfd80 100644 --- a/ros_gz_bridge/CMakeLists.txt +++ b/ros_gz_bridge/CMakeLists.txt @@ -129,6 +129,7 @@ add_library(${bridge_lib} src/bridge_handle_ros_to_gz.cpp src/bridge_handle_gz_to_ros.cpp src/factory_interface.cpp + src/service_factory_interface.cpp src/service_factories/ros_gz_interfaces.cpp src/ros_gz_bridge.cpp ${convert_files} diff --git a/ros_gz_bridge/src/service_factory_interface.cpp b/ros_gz_bridge/src/service_factory_interface.cpp new file mode 100644 index 00000000..4789e066 --- /dev/null +++ b/ros_gz_bridge/src/service_factory_interface.cpp @@ -0,0 +1,24 @@ +// Copyright 2024 Open Source Robotics Foundation, Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#include "service_factory_interface.hpp" + +namespace ros_gz_bridge +{ + +ServiceFactoryInterface::~ServiceFactoryInterface() +{ +} + +} // namespace ros_gz_bridge diff --git a/ros_gz_bridge/src/service_factory_interface.hpp b/ros_gz_bridge/src/service_factory_interface.hpp index 9d4f7334..766ce515 100644 --- a/ros_gz_bridge/src/service_factory_interface.hpp +++ b/ros_gz_bridge/src/service_factory_interface.hpp @@ -29,6 +29,8 @@ namespace ros_gz_bridge class ServiceFactoryInterface { public: + virtual ~ServiceFactoryInterface() = 0; + virtual rclcpp::ServiceBase::SharedPtr create_ros_service(