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

Update rmw_context_impl_t definition #558

Merged
merged 2 commits into from
Sep 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

#include <mutex>

struct rmw_context_impl_t
// Definition of struct rmw_context_impl_s as declared in rmw/init.h
struct rmw_context_impl_s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what is happening here.

Over in https://github.com/ros2/rmw/pull/313/files#diff-0460a36c52d1df8664f7ab0ee834d07ac10cfaf17fda75f7477421e4aadf30d8R34, we are doing typedef struct rmw_context_impl_s rmw_context_impl_t, which we are then using later on. So here in the RMW implementation, we need to define this as struct rmw_context_impl_s, but not make it struct rmw_context_impl_t (since that is done at the rmw layer, not the implementation layer).

I guess we do this in all of the RMW implementations, so this makes sense. It also means that, in theory, we could write a RMW layer purely in C (though I doubt we would ever do that).

This change is OK with me, but this is definitely going to have repercussions for RMW implementations that are not in the default build. We'll want to put a release note in place for this. I also think we should probably put a comment here explaining that this is the implementation for the stuff over in rmw/init.h, since understanding this is pretty tricky.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want to put a release note in place for this. I also think we should probably put a comment here explaining that this is the implementation for the stuff over in rmw/init.h, since understanding this is pretty tricky.

Agreed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See e2b22c7.

{
/// Pointer to `rmw_dds_common::Context`.
void * common;
Expand Down