Skip to content

Commit

Permalink
Merge pull request #32 from ros2/service_check_third_arg
Browse files Browse the repository at this point in the history
ensure type of third argument of service method
  • Loading branch information
dirk-thomas committed May 18, 2015
2 parents 1fe3fe0 + aeb68ba commit 150facd
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions rclcpp/include/rclcpp/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,21 @@ class Node
typename ServiceT,
typename FunctorT,
typename std::enable_if<
function_traits<FunctorT>::arity == 2 &&
function_traits<FunctorT>::arity == 2
>::type * = nullptr,
typename std::enable_if<
std::is_same<
typename function_traits<FunctorT>::template argument_type<0>,
typename std::shared_ptr<typename ServiceT::Request>
>::value &&
>::value
>::type * = nullptr,
typename std::enable_if<
std::is_same<
typename function_traits<FunctorT>::template argument_type<1>,
typename std::shared_ptr<typename ServiceT::Response>
>::value>::type * = nullptr>
>::value
>::type * = nullptr
>
typename rclcpp::service::Service<ServiceT>::SharedPtr
create_service_internal(
rmw_service_t * service_handle,
Expand All @@ -188,15 +194,27 @@ class Node
typename ServiceT,
typename FunctorT,
typename std::enable_if<
function_traits<FunctorT>::arity == 3 &&
function_traits<FunctorT>::arity == 3
>::type * = nullptr,
typename std::enable_if<
std::is_same<
typename function_traits<FunctorT>::template argument_type<0>,
std::shared_ptr<rmw_request_id_t>
>::value &&
>::value
>::type * = nullptr,
typename std::enable_if<
std::is_same<
typename function_traits<FunctorT>::template argument_type<1>,
typename std::shared_ptr<typename ServiceT::Request>
>::value>::type * = nullptr>
>::value
>::type * = nullptr,
typename std::enable_if<
std::is_same<
typename function_traits<FunctorT>::template argument_type<2>,
typename std::shared_ptr<typename ServiceT::Response>
>::value
>::type * = nullptr
>
typename rclcpp::service::Service<ServiceT>::SharedPtr
create_service_internal(
rmw_service_t * service_handle,
Expand Down

0 comments on commit 150facd

Please sign in to comment.