Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Services typesupport cpp - #140

Merged
jackieokay merged 2 commits into
masterfrom
services_typesupport_cpp
Mar 2, 2016
Merged

jackieokay merged 2 commits into
masterfrom
services_typesupport_cpp

Conversation

@jackieokay

Copy link
Copy Markdown
Contributor

Improve Connext client/service type support by not type-erasing the request header, adding an allocate function to create_requester/create_replier, and implementing destroy_requester and destroy_replier functions.

@jackieokay jackieokay added the in progress Actively being worked on (Kanban column) label Mar 1, 2016
@jackieokay jackieokay changed the title Services typesupport cpp Services typesupport improvements Mar 1, 2016
@jackieokay jackieokay changed the title Services typesupport improvements Services typesupport cpp Mar 1, 2016
@jackieokay jackieokay self-assigned this Mar 1, 2016
@jackieokay jackieokay added in review Waiting for review (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Mar 1, 2016
@jackieokay jackieokay mentioned this pull request Mar 1, 2016
@wjwwood

wjwwood commented Mar 2, 2016

Copy link
Copy Markdown
Member

The code changes lgtm and the CI looks good for Linux and OS X. For Windows there appear to be some new warnings, e.g.:

http://ci.ros2.org/job/ci_windows/1105/warnings34Result/new/package.1133270863/file.-93741396/

Looks like Windows thinks the catching of the explicit destructor call is unreachable? Not sure why that's a warning.

Other than the new warnings on Windows, +1.

@jackieokay

Copy link
Copy Markdown
Contributor Author

I'll address the Windows warning and retrigger CI.

@jackieokay

Copy link
Copy Markdown
Contributor Author

The try/catch pattern for explicitly calling the destructor is copied from rosidl_typesupport_opensplice_cpp:

https://github.com/ros2/rmw_opensplice/blob/master/rosidl_typesupport_opensplice_cpp/resource/srv__type_support.cpp.template#L528-L536

If the destructor for the Connext Replier were annotated as noexcept, then the catch block would be considered unreachable code.

But I couldn't find anything in the Connext documentation to indicate that the destructor of Requester or Replier is noexcept.

@dirk-thomas

Copy link
Copy Markdown
Member

@jackieokay

Copy link
Copy Markdown
Contributor Author

I believe destructors in C++ can throw exceptions, but the page you linked to is giving good reasons why we shouldn't write destructors that can throw exceptions.

See bottom of this page: http://en.cppreference.com/w/cpp/language/destructor

"As any other function, a destructor may terminate by throwing an exception (this usually requires it to be explicitly declared noexcept(false)) (since C++11), however if this destructor happens to be called during stack unwinding, std::terminate is called instead."

@jackieokay

Copy link
Copy Markdown
Contributor Author

I think it's safe to remove the try/catch block around the lines that are giving warnings in Windows.

I still find it strange because those lines are vendor code (Connext Requester/Replier API), and the original try/catch block in rosidl_typesupport_opensplice_cpp is for code that we control which is explicitly marked noexcept... yet we don't see any warnings from Windows about the opensplice code.

http://ci.ros2.org/job/ci_windows/1111/

@jackieokay

Copy link
Copy Markdown
Contributor Author

The new warnings are fixed (back to 60 warnings) so I will squash and merge this.

@jackieokay
jackieokay force-pushed the services_typesupport_cpp branch from 4ba0496 to 4317fb3 Compare March 2, 2016 21:09
jackieokay added a commit that referenced this pull request Mar 2, 2016
@jackieokay
jackieokay merged commit 36eb0b9 into master Mar 2, 2016
@jackieokay
jackieokay deleted the services_typesupport_cpp branch March 2, 2016 21:10
@jackieokay jackieokay removed the in review Waiting for review (Kanban column) label Mar 2, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants