-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add dds peek #1842
Add dds peek #1842
Conversation
Signed-off-by: Erik Boasson <[email protected]>
Every now and then the problem of wanting to peek at the contents of a reader history cache without marking samples as read pops up. It is a perfectly sensible operation to support and it is mystery to me why the DDS specification did not include it. Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
Signed-off-by: Erik Boasson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! No problem to have the unrelated commits in this PR. Only a detail in the comments for the read (and now also peek) functions in dds.h
(which is something not introduced by this PR, so I'm fine with improving these comments later).
The build failure on CI seems unrelated, however something we should really look into...
* read only when valid_data bit in sample info structure is set. | ||
* The buffer required for data values, could be allocated explicitly or can | ||
* use the memory from data reader to prevent copy. In the latter case, buffer and | ||
* sample_info should be returned back, once it is no longer using the data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem introduced in this PR, the paragraph has been used in dds.h
for a while for several read functions, but I think it's not completely clear under what conditions the caller should return the buffer (and not sample_info..). And shouldn't the buf
parameter be in,out
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I can't even make sense of that description myself! There'll be a separate PR for the documentation of those functions shortly.
I agree on the CI issue. I suspect it will turn out to be an issue with the test rather than the code-under-test, but it needs to be sorted out. |
Every now and then the problem of wanting to peek at the contents of a reader history cache without marking samples as read pops up. It is a perfectly sensible operation to support and it is mystery to me why the DDS specification did not include it.
Also in this PR:
(void)x
to suppress a warning in release builds in some test code for a variable only read in anassert
If desired I could do a separate PR for these, but I don't think there's a real need for that.