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

Interface for a function that returns the serialized size of a message #363

Open
kfabian opened this issue Jan 15, 2024 · 2 comments
Open
Labels
more-information-needed Further information is required

Comments

@kfabian
Copy link

kfabian commented Jan 15, 2024

Feature request

Feature description

I noticed that none of the major rmw implementations implements rmw_get_serialized_message_size. I wonder if that is the case because it works on the rosidl_runtime_c__Sequence__bound struct and not an actual instance of a message. I could not really grasp how the rosidl_runtime_c__Sequence__bound should be used and to what structure * data should be pointing to.

Implementation considerations

Maybe it would be helpful to add a function interface that works on an actual instance of a message, that should be more straightforward to implement, e.g. for cyclonedds similar to this code.

@clalancette
Copy link
Contributor

Hm, the fact that none of them implement it means the API should probably be deprecated and removed. I think this was part of an early attempt to be able to send preallocated messages, but never got implemented. @mjcarroll can you comment here?

@clalancette clalancette added the more-information-needed Further information is required label Jan 16, 2024
@mjcarroll
Copy link
Member

I think that is the origin of it. I think that the loaned message APIs came after and superceded this concept. I think we can safely deprecate and remove the existing APIS.

Second, I think that the idea of working on a message instance may work as well. The Sequence__bound structure was intended to provide bounds for unbounded sequence fields so that allocation size could be correctly computed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

3 participants