Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for lambdas #33

Merged
merged 1 commit into from
May 18, 2015
Merged

Added support for lambdas #33

merged 1 commit into from
May 18, 2015

Conversation

esteve
Copy link
Member

@esteve esteve commented May 18, 2015

This is a quick hack to add support for lambdas.

Connects to #29

@dirk-thomas @tfoote @wjwwood

@esteve esteve added the in progress Actively being worked on (Kanban column) label May 18, 2015
@esteve
Copy link
Member Author

esteve commented May 18, 2015

@dirk-thomas let me know what you think of this, it's not very readable, but works.

@dirk-thomas
Copy link
Member

I updated the patch to match style. This works for me with the following userland code:

auto callback = \
  [](
    const std::shared_ptr<rmw_request_id_t> request_header,
    const std::shared_ptr<userland_msgs::AddTwoInts::Request> request,
    std::shared_ptr<userland_msgs::AddTwoInts::Response> response
  ) -> void
  {
    std::cout << "Got request #" << request_header->sequence_number << std::endl;
    response->sum = request->a + request->b;
  };

node->create_service<userland_msgs::AddTwoInts>("service_name", callback);

+1

@dirk-thomas dirk-thomas added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels May 18, 2015
@wjwwood
Copy link
Member

wjwwood commented May 18, 2015

+1

1 similar comment
@tfoote
Copy link
Contributor

tfoote commented May 18, 2015

+1

dirk-thomas added a commit that referenced this pull request May 18, 2015
@dirk-thomas dirk-thomas merged commit 198b40a into master May 18, 2015
@dirk-thomas dirk-thomas deleted the function-traits-lambda branch May 18, 2015 21:34
@dirk-thomas dirk-thomas removed the in review Waiting for review (Kanban column) label May 18, 2015
alsora pushed a commit to alsora/rclcpp that referenced this pull request Jan 15, 2021
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
* ros2GH-84 Cleanup: conform to ROS2 naming conventions

* ros2GH-84 Allow only a single non-end iterator for query results

Reason: multiple iterators for the same query result would interfere
with each other as a single result row can only be retrieved
once. These side effects would be very surprising and are therefore
forbidden.

* ros2GH-84 Do not use noexcept for gcc < 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants