From 59a399bbffd2c11c31ff87f600e99029e41831cd Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Fri, 14 Aug 2015 14:14:46 -0700 Subject: [PATCH] Replace usage of typedef with using --- rclcpp/include/rclcpp/client.hpp | 8 ++++---- rclcpp/include/rclcpp/executor.hpp | 6 +++--- rclcpp/include/rclcpp/node.hpp | 6 +++--- rclcpp/include/rclcpp/rate.hpp | 4 ++-- rclcpp/include/rclcpp/rclcpp.hpp | 2 +- rclcpp/include/rclcpp/service.hpp | 12 ++++++------ rclcpp/include/rclcpp/subscription.hpp | 2 +- rclcpp/include/rclcpp/timer.hpp | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/rclcpp/include/rclcpp/client.hpp b/rclcpp/include/rclcpp/client.hpp index 024d0f2..9631167 100644 --- a/rclcpp/include/rclcpp/client.hpp +++ b/rclcpp/include/rclcpp/client.hpp @@ -93,11 +93,11 @@ template class Client : public ClientBase { public: - typedef std::promise Promise; - typedef std::shared_ptr SharedPromise; - typedef std::shared_future SharedFuture; + using Promise = std::promise; + using SharedPromise = std::shared_ptr; + using SharedFuture = std::shared_future; - typedef std::function CallbackType; + using CallbackType = std::function; RCLCPP_SMART_PTR_DEFINITIONS(Client); diff --git a/rclcpp/include/rclcpp/executor.hpp b/rclcpp/include/rclcpp/executor.hpp index e560018..f32daa6 100644 --- a/rclcpp/include/rclcpp/executor.hpp +++ b/rclcpp/include/rclcpp/executor.hpp @@ -861,11 +861,11 @@ private: RCLCPP_DISABLE_COPY(Executor); std::vector> weak_nodes_; - typedef std::list SubscriberHandles; + using SubscriberHandles = std::list; SubscriberHandles subscriber_handles_; - typedef std::list ServiceHandles; + using ServiceHandles = std::list; ServiceHandles service_handles_; - typedef std::list ClientHandles; + using ClientHandles = std::list; ClientHandles client_handles_; }; diff --git a/rclcpp/include/rclcpp/node.hpp b/rclcpp/include/rclcpp/node.hpp index 61a916d..95d916d 100644 --- a/rclcpp/include/rclcpp/node.hpp +++ b/rclcpp/include/rclcpp/node.hpp @@ -151,9 +151,9 @@ public: rclcpp::timer::CallbackType callback, rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr); - typedef rclcpp::callback_group::CallbackGroup CallbackGroup; - typedef std::weak_ptr CallbackGroupWeakPtr; - typedef std::list CallbackGroupWeakPtrList; + using CallbackGroup = rclcpp::callback_group::CallbackGroup; + using CallbackGroupWeakPtr = std::weak_ptr; + using CallbackGroupWeakPtrList = std::list; /* Create and return a Client. */ template diff --git a/rclcpp/include/rclcpp/rate.hpp b/rclcpp/include/rclcpp/rate.hpp index e3a11cb..b9bbb23 100644 --- a/rclcpp/include/rclcpp/rate.hpp +++ b/rclcpp/include/rclcpp/rate.hpp @@ -112,8 +112,8 @@ private: }; -typedef GenericRate Rate; -typedef GenericRate WallRate; +using Rate = GenericRate; +using WallRate = GenericRate; } // namespace rate } // namespace rclcpp diff --git a/rclcpp/include/rclcpp/rclcpp.hpp b/rclcpp/include/rclcpp/rclcpp.hpp index 35893ac..6d388d1 100644 --- a/rclcpp/include/rclcpp/rclcpp.hpp +++ b/rclcpp/include/rclcpp/rclcpp.hpp @@ -60,7 +60,7 @@ using rclcpp::rate::WallRate; using rclcpp::timer::GenericTimer; using rclcpp::timer::TimerBase; using rclcpp::timer::WallTimer; -typedef rclcpp::context::Context::SharedPtr ContextSharedPtr; +using ContextSharedPtr = rclcpp::context::Context::SharedPtr; using rclcpp::utilities::ok; using rclcpp::utilities::shutdown; using rclcpp::utilities::init; diff --git a/rclcpp/include/rclcpp/service.hpp b/rclcpp/include/rclcpp/service.hpp index 2b94c18..4726b76 100644 --- a/rclcpp/include/rclcpp/service.hpp +++ b/rclcpp/include/rclcpp/service.hpp @@ -95,16 +95,16 @@ template class Service : public ServiceBase { public: - typedef std::function< - void ( + using CallbackType = std::function< + void( const std::shared_ptr &, - std::shared_ptr &)> CallbackType; + std::shared_ptr &)>; - typedef std::function< - void ( + using CallbackWithHeaderType = std::function< + void( const std::shared_ptr &, const std::shared_ptr &, - std::shared_ptr &)> CallbackWithHeaderType; + std::shared_ptr &)>; RCLCPP_SMART_PTR_DEFINITIONS(Service); Service( diff --git a/rclcpp/include/rclcpp/subscription.hpp b/rclcpp/include/rclcpp/subscription.hpp index 297ca3f..141747c 100644 --- a/rclcpp/include/rclcpp/subscription.hpp +++ b/rclcpp/include/rclcpp/subscription.hpp @@ -96,7 +96,7 @@ template class Subscription : public SubscriptionBase { public: - typedef std::function &)> CallbackType; + using CallbackType = std::function &)>; RCLCPP_SMART_PTR_DEFINITIONS(Subscription); Subscription( diff --git a/rclcpp/include/rclcpp/timer.hpp b/rclcpp/include/rclcpp/timer.hpp index ed738d3..2f97740 100644 --- a/rclcpp/include/rclcpp/timer.hpp +++ b/rclcpp/include/rclcpp/timer.hpp @@ -40,7 +40,7 @@ class Executor; namespace timer { -typedef std::function CallbackType; +using CallbackType = std::function; class TimerBase { @@ -151,7 +151,7 @@ private: }; -typedef GenericTimer WallTimer; +using WallTimer = GenericTimer; } /* namespace timer */ } /* namespace rclcpp */