From f601263cb8db9b046c6c67fe1382b996b93db8bc Mon Sep 17 00:00:00 2001 From: yamacir-kit Date: Wed, 18 Dec 2024 11:55:11 +0900 Subject: [PATCH] Lipsticks Signed-off-by: yamacir-kit --- .../concealer/include/concealer/publisher.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/external/concealer/include/concealer/publisher.hpp b/external/concealer/include/concealer/publisher.hpp index b01730f858c..aeb323084e4 100644 --- a/external/concealer/include/concealer/publisher.hpp +++ b/external/concealer/include/concealer/publisher.hpp @@ -20,23 +20,22 @@ namespace concealer { -template +template class Publisher { -private: - typename rclcpp::Publisher::SharedPtr publisher; + typename rclcpp::Publisher::SharedPtr publisher; public: - auto operator()(const MessageType & message) const -> decltype(auto) + template + explicit Publisher(const std::string & topic, Node & node) + : publisher(node.template create_publisher(topic, rclcpp::QoS(1).reliable())) { - return publisher->publish(message); } - template - explicit Publisher(std::string topic, NodeInterface & autoware_interface) - : publisher( - autoware_interface.template create_publisher(topic, rclcpp::QoS(1).reliable())) + template + auto operator()(Ts &&... xs) const -> decltype(auto) { + return publisher->publish(std::forward(xs)...); } }; } // namespace concealer