diff --git a/rclcpp/include/rclcpp/client.hpp b/rclcpp/include/rclcpp/client.hpp index 553c9b5..7bf3921 100644 --- a/rclcpp/include/rclcpp/client.hpp +++ b/rclcpp/include/rclcpp/client.hpp @@ -64,12 +64,12 @@ public: } } - std::string get_service_name() + const std::string & get_service_name() const { return this->service_name_; } - const rmw_client_t * get_client_handle() + const rmw_client_t * get_client_handle() const { return this->client_handle_; } diff --git a/rclcpp/include/rclcpp/subscription.hpp b/rclcpp/include/rclcpp/subscription.hpp index 5aa0878..856c0cb 100644 --- a/rclcpp/include/rclcpp/subscription.hpp +++ b/rclcpp/include/rclcpp/subscription.hpp @@ -48,7 +48,7 @@ public: SubscriptionBase( std::shared_ptr node_handle, rmw_subscription_t * subscription_handle, - std::string & topic_name, + const std::string & topic_name, bool ignore_local_publications) : node_handle_(node_handle), subscription_handle_(subscription_handle), @@ -71,7 +71,7 @@ public: } } - std::string get_topic_name() + const std::string & get_topic_name() const { return this->topic_name_; } @@ -100,7 +100,7 @@ public: Subscription( std::shared_ptr node_handle, rmw_subscription_t * subscription_handle, - std::string & topic_name, + const std::string & topic_name, bool ignore_local_publications, CallbackType callback) : SubscriptionBase(node_handle, subscription_handle, topic_name, ignore_local_publications),