From 789c11f89af0160bbd65b9bff033557e6dd79b78 Mon Sep 17 00:00:00 2001 From: Dirk Thomas Date: Fri, 28 Aug 2015 14:02:30 -0700 Subject: [PATCH] remove references on smart pointers --- rclcpp/include/rclcpp/callback_group.hpp | 8 ++--- rclcpp/include/rclcpp/client.hpp | 4 +-- rclcpp/include/rclcpp/executor.hpp | 36 ++++++++++----------- rclcpp/include/rclcpp/executors.hpp | 2 +- rclcpp/include/rclcpp/node.hpp | 2 +- rclcpp/include/rclcpp/node_impl.hpp | 2 +- rclcpp/include/rclcpp/parameter_client.hpp | 8 ++--- rclcpp/include/rclcpp/parameter_service.hpp | 2 +- rclcpp/include/rclcpp/rclcpp.hpp | 6 ++-- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/rclcpp/include/rclcpp/callback_group.hpp b/rclcpp/include/rclcpp/callback_group.hpp index d3834e8..03a3262 100644 --- a/rclcpp/include/rclcpp/callback_group.hpp +++ b/rclcpp/include/rclcpp/callback_group.hpp @@ -63,25 +63,25 @@ private: void add_subscription( - const subscription::SubscriptionBase::SharedPtr & subscription_ptr) + const subscription::SubscriptionBase::SharedPtr subscription_ptr) { subscription_ptrs_.push_back(subscription_ptr); } void - add_timer(const timer::TimerBase::SharedPtr & timer_ptr) + add_timer(const timer::TimerBase::SharedPtr timer_ptr) { timer_ptrs_.push_back(timer_ptr); } void - add_service(const service::ServiceBase::SharedPtr & service_ptr) + add_service(const service::ServiceBase::SharedPtr service_ptr) { service_ptrs_.push_back(service_ptr); } void - add_client(const client::ClientBase::SharedPtr & client_ptr) + add_client(const client::ClientBase::SharedPtr client_ptr) { client_ptrs_.push_back(client_ptr); } diff --git a/rclcpp/include/rclcpp/client.hpp b/rclcpp/include/rclcpp/client.hpp index 9631167..4b70998 100644 --- a/rclcpp/include/rclcpp/client.hpp +++ b/rclcpp/include/rclcpp/client.hpp @@ -136,13 +136,13 @@ public: } SharedFuture async_send_request( - typename ServiceT::Request::SharedPtr & request) + typename ServiceT::Request::SharedPtr request) { return async_send_request(request, [](SharedFuture) {}); } SharedFuture async_send_request( - typename ServiceT::Request::SharedPtr & request, + typename ServiceT::Request::SharedPtr request, CallbackType cb) { int64_t sequence_number; diff --git a/rclcpp/include/rclcpp/executor.hpp b/rclcpp/include/rclcpp/executor.hpp index 12d0aa4..3538d7e 100644 --- a/rclcpp/include/rclcpp/executor.hpp +++ b/rclcpp/include/rclcpp/executor.hpp @@ -116,7 +116,7 @@ public: * waiting for work in another thread, because otherwise the executor would never be notified. */ virtual void - remove_node(rclcpp::node::Node::SharedPtr & node_ptr, bool notify = true) + remove_node(rclcpp::node::Node::SharedPtr node_ptr, bool notify = true) { bool node_removed = false; weak_nodes_.erase( @@ -147,7 +147,7 @@ public: * function to be non-blocking. */ template - void spin_node_once(rclcpp::node::Node::SharedPtr & node, + void spin_node_once(rclcpp::node::Node::SharedPtr node, std::chrono::duration timeout = std::chrono::duration(-1)) { this->add_node(node, false); @@ -163,7 +163,7 @@ public: /** * \param[in] node Shared pointer to the node to add. */ - void spin_node_some(rclcpp::node::Node::SharedPtr & node) + void spin_node_some(rclcpp::node::Node::SharedPtr node) { this->add_node(node, false); spin_some(); @@ -207,7 +207,7 @@ protected: * service, client). */ void - execute_any_executable(AnyExecutable::SharedPtr & any_exec) + execute_any_executable(AnyExecutable::SharedPtr any_exec) { if (!any_exec) { return; @@ -239,7 +239,7 @@ protected: static void execute_subscription( - rclcpp::subscription::SubscriptionBase::SharedPtr & subscription) + rclcpp::subscription::SubscriptionBase::SharedPtr subscription) { std::shared_ptr message = subscription->create_message(); bool taken = false; @@ -261,7 +261,7 @@ protected: static void execute_intra_process_subscription( - rclcpp::subscription::SubscriptionBase::SharedPtr & subscription) + rclcpp::subscription::SubscriptionBase::SharedPtr subscription) { rcl_interfaces::msg::IntraProcessMessage ipm; bool taken = false; @@ -285,14 +285,14 @@ protected: static void execute_timer( - rclcpp::timer::TimerBase::SharedPtr & timer) + rclcpp::timer::TimerBase::SharedPtr timer) { timer->callback_(); } static void execute_service( - rclcpp::service::ServiceBase::SharedPtr & service) + rclcpp::service::ServiceBase::SharedPtr service) { std::shared_ptr request_header = service->create_request_header(); std::shared_ptr request = service->create_request(); @@ -315,7 +315,7 @@ protected: static void execute_client( - rclcpp::client::ClientBase::SharedPtr & client) + rclcpp::client::ClientBase::SharedPtr client) { std::shared_ptr request_header = client->create_request_header(); std::shared_ptr response = client->create_response(); @@ -623,7 +623,7 @@ protected: } rclcpp::node::Node::SharedPtr - get_node_by_group(rclcpp::callback_group::CallbackGroup::SharedPtr & group) + get_node_by_group(rclcpp::callback_group::CallbackGroup::SharedPtr group) { if (!group) { return rclcpp::node::Node::SharedPtr(); @@ -645,7 +645,7 @@ protected: rclcpp::callback_group::CallbackGroup::SharedPtr get_group_by_timer( - rclcpp::timer::TimerBase::SharedPtr & timer) + rclcpp::timer::TimerBase::SharedPtr timer) { for (auto & weak_node : weak_nodes_) { auto node = weak_node.lock(); @@ -669,7 +669,7 @@ protected: } void - get_next_timer(AnyExecutable::SharedPtr & any_exec) + get_next_timer(AnyExecutable::SharedPtr any_exec) { for (auto & weak_node : weak_nodes_) { auto node = weak_node.lock(); @@ -727,7 +727,7 @@ protected: rclcpp::callback_group::CallbackGroup::SharedPtr get_group_by_subscription( - rclcpp::subscription::SubscriptionBase::SharedPtr & subscription) + rclcpp::subscription::SubscriptionBase::SharedPtr subscription) { for (auto & weak_node : weak_nodes_) { auto node = weak_node.lock(); @@ -751,7 +751,7 @@ protected: } void - get_next_subscription(AnyExecutable::SharedPtr & any_exec) + get_next_subscription(AnyExecutable::SharedPtr any_exec) { auto it = subscriber_handles_.begin(); while (it != subscriber_handles_.end()) { @@ -794,7 +794,7 @@ protected: rclcpp::callback_group::CallbackGroup::SharedPtr get_group_by_service( - rclcpp::service::ServiceBase::SharedPtr & service) + rclcpp::service::ServiceBase::SharedPtr service) { for (auto & weak_node : weak_nodes_) { auto node = weak_node.lock(); @@ -817,7 +817,7 @@ protected: } void - get_next_service(AnyExecutable::SharedPtr & any_exec) + get_next_service(AnyExecutable::SharedPtr any_exec) { auto it = service_handles_.begin(); while (it != service_handles_.end()) { @@ -851,7 +851,7 @@ protected: rclcpp::callback_group::CallbackGroup::SharedPtr get_group_by_client( - rclcpp::client::ClientBase::SharedPtr & client) + rclcpp::client::ClientBase::SharedPtr client) { for (auto & weak_node : weak_nodes_) { auto node = weak_node.lock(); @@ -874,7 +874,7 @@ protected: } void - get_next_client(AnyExecutable::SharedPtr & any_exec) + get_next_client(AnyExecutable::SharedPtr any_exec) { auto it = client_handles_.begin(); while (it != client_handles_.end()) { diff --git a/rclcpp/include/rclcpp/executors.hpp b/rclcpp/include/rclcpp/executors.hpp index 1be454a..c168912 100644 --- a/rclcpp/include/rclcpp/executors.hpp +++ b/rclcpp/include/rclcpp/executors.hpp @@ -32,7 +32,7 @@ using rclcpp::executors::single_threaded_executor::SingleThreadedExecutor; template std::shared_future & spin_node_until_future_complete( - rclcpp::executor::Executor & executor, rclcpp::node::Node::SharedPtr & node_ptr, + rclcpp::executor::Executor & executor, rclcpp::node::Node::SharedPtr node_ptr, std::shared_future & future) { std::future_status status; diff --git a/rclcpp/include/rclcpp/node.hpp b/rclcpp/include/rclcpp/node.hpp index d82b130..ed38731 100644 --- a/rclcpp/include/rclcpp/node.hpp +++ b/rclcpp/include/rclcpp/node.hpp @@ -213,7 +213,7 @@ private: static const rosidl_message_type_support_t * ipm_ts_; bool - group_in_node(callback_group::CallbackGroup::SharedPtr & group); + group_in_node(callback_group::CallbackGroup::SharedPtr group); std::string name_; diff --git a/rclcpp/include/rclcpp/node_impl.hpp b/rclcpp/include/rclcpp/node_impl.hpp index 80c9325..1668451 100644 --- a/rclcpp/include/rclcpp/node_impl.hpp +++ b/rclcpp/include/rclcpp/node_impl.hpp @@ -185,7 +185,7 @@ Node::create_publisher( } bool -Node::group_in_node(callback_group::CallbackGroup::SharedPtr & group) +Node::group_in_node(callback_group::CallbackGroup::SharedPtr group) { bool group_belongs_to_this_node = false; for (auto & weak_group : this->callback_groups_) { diff --git a/rclcpp/include/rclcpp/parameter_client.hpp b/rclcpp/include/rclcpp/parameter_client.hpp index a825441..fe27e3e 100644 --- a/rclcpp/include/rclcpp/parameter_client.hpp +++ b/rclcpp/include/rclcpp/parameter_client.hpp @@ -46,7 +46,7 @@ class AsyncParametersClient public: RCLCPP_SMART_PTR_DEFINITIONS(AsyncParametersClient); - AsyncParametersClient(const rclcpp::node::Node::SharedPtr & node, + AsyncParametersClient(const rclcpp::node::Node::SharedPtr node, const std::string & remote_node_name = "") : node_(node) { @@ -255,7 +255,7 @@ public: RCLCPP_SMART_PTR_DEFINITIONS(SyncParametersClient); SyncParametersClient( - rclcpp::node::Node::SharedPtr & node) + rclcpp::node::Node::SharedPtr node) : node_(node) { executor_ = std::make_shared(); @@ -263,8 +263,8 @@ public: } SyncParametersClient( - rclcpp::executor::Executor::SharedPtr & executor, - rclcpp::node::Node::SharedPtr & node) + rclcpp::executor::Executor::SharedPtr executor, + rclcpp::node::Node::SharedPtr node) : executor_(executor), node_(node) { async_parameters_client_ = std::make_shared(node); diff --git a/rclcpp/include/rclcpp/parameter_service.hpp b/rclcpp/include/rclcpp/parameter_service.hpp index 12beaff..95d2b0d 100644 --- a/rclcpp/include/rclcpp/parameter_service.hpp +++ b/rclcpp/include/rclcpp/parameter_service.hpp @@ -43,7 +43,7 @@ class ParameterService public: RCLCPP_SMART_PTR_DEFINITIONS(ParameterService); - ParameterService(const rclcpp::node::Node::SharedPtr & node) + ParameterService(const rclcpp::node::Node::SharedPtr node) : node_(node) { get_parameters_service_ = node_->create_service( diff --git a/rclcpp/include/rclcpp/rclcpp.hpp b/rclcpp/include/rclcpp/rclcpp.hpp index df72462..b63457a 100644 --- a/rclcpp/include/rclcpp/rclcpp.hpp +++ b/rclcpp/include/rclcpp/rclcpp.hpp @@ -82,7 +82,7 @@ using rclcpp::utilities::sleep_for; /// Create a default single-threaded executor and execute any immediately available work. // \param[in] node_ptr Shared pointer to the node to spin. -void spin_some(Node::SharedPtr & node_ptr) +void spin_some(Node::SharedPtr node_ptr) { rclcpp::executors::SingleThreadedExecutor executor; executor.spin_node_some(node_ptr); @@ -90,7 +90,7 @@ void spin_some(Node::SharedPtr & node_ptr) /// Create a default single-threaded executor and spin the specified node. // \param[in] node_ptr Shared pointer to the node to spin. -void spin(Node::SharedPtr & node_ptr) +void spin(Node::SharedPtr node_ptr) { rclcpp::executors::SingleThreadedExecutor executor; executor.add_node(node_ptr); @@ -100,7 +100,7 @@ void spin(Node::SharedPtr & node_ptr) template std::shared_future & spin_until_future_complete( - Node::SharedPtr & node_ptr, std::shared_future & future) + Node::SharedPtr node_ptr, std::shared_future & future) { rclcpp::executors::SingleThreadedExecutor executor; rclcpp::executors::spin_node_until_future_complete(