Repository navigation
Services typesupport cpp - #140
Conversation
|
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.: 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. |
|
I'll address the Windows warning and retrigger CI. |
|
The try/catch pattern for explicitly calling the destructor is copied from rosidl_typesupport_opensplice_cpp: If the destructor for the Connext Replier were annotated as But I couldn't find anything in the Connext documentation to indicate that the destructor of Requester or Replier is |
|
A destructor in C++ can't throw an exception. See http://c2.com/cgi/wiki?BewareOfExceptionsInTheDestructor |
|
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." |
|
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. |
|
The new warnings are fixed (back to 60 warnings) so I will squash and merge this. |
4ba0496 to
4317fb3
Compare
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.