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

Add dds peek #1842

Merged
merged 4 commits into from
Sep 29, 2023
Merged

Add dds peek #1842

merged 4 commits into from
Sep 29, 2023

Conversation

eboasson
Copy link
Contributor

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:

  • a (void)x to suppress a warning in release builds in some test code for a variable only read in an assert
  • an update to clang 13 in the CI configuration because clang 12 is no longer included in the Azure Pipelines images

If desired I could do a separate PR for these, but I don't think there's a real need for that.

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]>
Copy link
Contributor

@dpotman dpotman left a 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.
Copy link
Contributor

@dpotman dpotman Sep 28, 2023

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?

Copy link
Contributor Author

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.

@eboasson
Copy link
Contributor Author

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.

@eboasson eboasson merged commit 7d1be99 into eclipse-cyclonedds:master Sep 29, 2023
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants