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

[#264] cxx bindings for attributes #549

Merged

Conversation

elfenpiff
Copy link
Contributor

@elfenpiff elfenpiff commented Dec 16, 2024

Adds the c/c++ binding for attributes and integrates them into the service builder.

Notes for Reviewer

Pre-Review Checklist for the PR Author

  • Add sensible notes for the reviewer
  • PR title is short, expressive and meaningful
  • Consider switching the PR to a draft (Convert to draft)
    • as draft PR, the CI will be skipped for pushes
  • Relevant issues are linked in the References section
  • Every source code file has a copyright header with SPDX-License-Identifier: Apache-2.0 OR MIT
  • Branch follows the naming format (iox2-123-introduce-posix-ipc-example)
  • Commits messages are according to this guideline
  • Tests follow the best practice for testing
  • Changelog updated in the unreleased section including API breaking changes
  • Assign PR to reviewer
  • All checks have passed (except task-list-completed)

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

Relates to #264

@elfenpiff elfenpiff marked this pull request as ready for review December 16, 2024 12:22
@elfenpiff elfenpiff requested a review from elBoberido December 16, 2024 12:23
@elfenpiff elfenpiff self-assigned this Dec 16, 2024
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

Attention: Patch coverage is 22.22222% with 14 lines in your changes missing coverage. Please review.

Project coverage is 79.07%. Comparing base (a628ba5) to head (ce40c02).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
iceoryx2/src/service/attribute.rs 22.22% 14 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #549      +/-   ##
==========================================
- Coverage   79.11%   79.07%   -0.04%     
==========================================
  Files         203      203              
  Lines       25132    25146      +14     
==========================================
+ Hits        19882    19885       +3     
- Misses       5250     5261      +11     
Files with missing lines Coverage Δ
iceoryx2/src/service/attribute.rs 84.94% <22.22%> (-15.06%) ⬇️

... and 3 files with indirect coverage changes

@elfenpiff elfenpiff force-pushed the iox2-264-cxx-bindings-for-attributes branch from 568053f to ce1a959 Compare December 16, 2024 13:45

/// Returns a [`AttributeView`] at a specific index. The number of indices is returned via
/// [`AttributeSetView::len()`].
auto at(uint64_t index) const -> AttributeView;
Copy link
Member

Choose a reason for hiding this comment

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

Food for thought. For certification we might need to return an Optional<AttributeView> to not have to terminate for out of bounds access.

But we need to review the whole API for this scenarios, so I think it's fine to stay as is for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or we work with begin() and end() and iterators or for_each and for.

Copy link
Member

Choose a reason for hiding this comment

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

Well, that's a different use case. If someone really wants to access element at index N, then it only works by checking the size before using at ... but that's a different philosophical question

iceoryx2-ffi/cxx/src/attribute.cpp Outdated Show resolved Hide resolved
iceoryx2-ffi/cxx/include/iox2/attribute_verifier.hpp Outdated Show resolved Hide resolved
iceoryx2-ffi/cxx/src/attribute_verifier.cpp Outdated Show resolved Hide resolved
iceoryx2-ffi/ffi/src/api/attribute.rs Outdated Show resolved Hide resolved
@elfenpiff elfenpiff force-pushed the iox2-264-cxx-bindings-for-attributes branch from c80fa01 to 5fa47fd Compare December 18, 2024 12:05
@elfenpiff elfenpiff force-pushed the iox2-264-cxx-bindings-for-attributes branch 3 times, most recently from f79fcee to 16398a8 Compare December 18, 2024 19:27
@elfenpiff elfenpiff requested a review from elBoberido December 18, 2024 19:30
@elfenpiff elfenpiff force-pushed the iox2-264-cxx-bindings-for-attributes branch from 16398a8 to 9ede743 Compare December 18, 2024 20:20
@elfenpiff elfenpiff force-pushed the iox2-264-cxx-bindings-for-attributes branch from 9ede743 to ce40c02 Compare December 18, 2024 20:38
@elfenpiff elfenpiff merged commit 4d60b02 into eclipse-iceoryx:main Dec 18, 2024
46 of 47 checks passed
@elfenpiff elfenpiff deleted the iox2-264-cxx-bindings-for-attributes branch December 18, 2024 22:02
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