Replace usage of typedef with using

This commit is contained in:
Esteve Fernandez 2015-08-14 14:14:46 -07:00
parent 32160febc1
commit 59a399bbff
8 changed files with 22 additions and 22 deletions

View file

@ -93,11 +93,11 @@ template<typename ServiceT>
class Client : public ClientBase class Client : public ClientBase
{ {
public: public:
typedef std::promise<typename ServiceT::Response::SharedPtr> Promise; using Promise = std::promise<typename ServiceT::Response::SharedPtr>;
typedef std::shared_ptr<Promise> SharedPromise; using SharedPromise = std::shared_ptr<Promise>;
typedef std::shared_future<typename ServiceT::Response::SharedPtr> SharedFuture; using SharedFuture = std::shared_future<typename ServiceT::Response::SharedPtr>;
typedef std::function<void (SharedFuture)> CallbackType; using CallbackType = std::function<void(SharedFuture)>;
RCLCPP_SMART_PTR_DEFINITIONS(Client); RCLCPP_SMART_PTR_DEFINITIONS(Client);

View file

@ -861,11 +861,11 @@ private:
RCLCPP_DISABLE_COPY(Executor); RCLCPP_DISABLE_COPY(Executor);
std::vector<std::weak_ptr<rclcpp::node::Node>> weak_nodes_; std::vector<std::weak_ptr<rclcpp::node::Node>> weak_nodes_;
typedef std::list<void *> SubscriberHandles; using SubscriberHandles = std::list<void *>;
SubscriberHandles subscriber_handles_; SubscriberHandles subscriber_handles_;
typedef std::list<void *> ServiceHandles; using ServiceHandles = std::list<void *>;
ServiceHandles service_handles_; ServiceHandles service_handles_;
typedef std::list<void *> ClientHandles; using ClientHandles = std::list<void *>;
ClientHandles client_handles_; ClientHandles client_handles_;
}; };

View file

@ -151,9 +151,9 @@ public:
rclcpp::timer::CallbackType callback, rclcpp::timer::CallbackType callback,
rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr); rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr);
typedef rclcpp::callback_group::CallbackGroup CallbackGroup; using CallbackGroup = rclcpp::callback_group::CallbackGroup;
typedef std::weak_ptr<CallbackGroup> CallbackGroupWeakPtr; using CallbackGroupWeakPtr = std::weak_ptr<CallbackGroup>;
typedef std::list<CallbackGroupWeakPtr> CallbackGroupWeakPtrList; using CallbackGroupWeakPtrList = std::list<CallbackGroupWeakPtr>;
/* Create and return a Client. */ /* Create and return a Client. */
template<typename ServiceT> template<typename ServiceT>

View file

@ -112,8 +112,8 @@ private:
}; };
typedef GenericRate<std::chrono::system_clock> Rate; using Rate = GenericRate<std::chrono::system_clock>;
typedef GenericRate<std::chrono::steady_clock> WallRate; using WallRate = GenericRate<std::chrono::steady_clock>;
} // namespace rate } // namespace rate
} // namespace rclcpp } // namespace rclcpp

View file

@ -60,7 +60,7 @@ using rclcpp::rate::WallRate;
using rclcpp::timer::GenericTimer; using rclcpp::timer::GenericTimer;
using rclcpp::timer::TimerBase; using rclcpp::timer::TimerBase;
using rclcpp::timer::WallTimer; using rclcpp::timer::WallTimer;
typedef rclcpp::context::Context::SharedPtr ContextSharedPtr; using ContextSharedPtr = rclcpp::context::Context::SharedPtr;
using rclcpp::utilities::ok; using rclcpp::utilities::ok;
using rclcpp::utilities::shutdown; using rclcpp::utilities::shutdown;
using rclcpp::utilities::init; using rclcpp::utilities::init;

View file

@ -95,16 +95,16 @@ template<typename ServiceT>
class Service : public ServiceBase class Service : public ServiceBase
{ {
public: public:
typedef std::function< using CallbackType = std::function<
void ( void(
const std::shared_ptr<typename ServiceT::Request> &, const std::shared_ptr<typename ServiceT::Request> &,
std::shared_ptr<typename ServiceT::Response> &)> CallbackType; std::shared_ptr<typename ServiceT::Response> &)>;
typedef std::function< using CallbackWithHeaderType = std::function<
void ( void(
const std::shared_ptr<rmw_request_id_t> &, const std::shared_ptr<rmw_request_id_t> &,
const std::shared_ptr<typename ServiceT::Request> &, const std::shared_ptr<typename ServiceT::Request> &,
std::shared_ptr<typename ServiceT::Response> &)> CallbackWithHeaderType; std::shared_ptr<typename ServiceT::Response> &)>;
RCLCPP_SMART_PTR_DEFINITIONS(Service); RCLCPP_SMART_PTR_DEFINITIONS(Service);
Service( Service(

View file

@ -96,7 +96,7 @@ template<typename MessageT>
class Subscription : public SubscriptionBase class Subscription : public SubscriptionBase
{ {
public: public:
typedef std::function<void (const std::shared_ptr<MessageT> &)> CallbackType; using CallbackType = std::function<void(const std::shared_ptr<MessageT> &)>;
RCLCPP_SMART_PTR_DEFINITIONS(Subscription); RCLCPP_SMART_PTR_DEFINITIONS(Subscription);
Subscription( Subscription(

View file

@ -40,7 +40,7 @@ class Executor;
namespace timer namespace timer
{ {
typedef std::function<void ()> CallbackType; using CallbackType = std::function<void()>;
class TimerBase class TimerBase
{ {
@ -151,7 +151,7 @@ private:
}; };
typedef GenericTimer<std::chrono::steady_clock> WallTimer; using WallTimer = GenericTimer<std::chrono::steady_clock>;
} /* namespace timer */ } /* namespace timer */
} /* namespace rclcpp */ } /* namespace rclcpp */