Skip to content

Conversation

@elBoberido
Copy link
Member

Notes for Reviewer

This PR moves iox2/legacy/duration.hpp and its dependencies to iox2/bb/duration.hpp. Furthermore, the namespace is adjusted to iox2::bb and the clang-tidy warnings are fixed.

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

Closes #

@elBoberido elBoberido marked this pull request as draft December 1, 2025 02:07
@elBoberido elBoberido force-pushed the iox2-301-move-into-files-to-iox2-bb branch from 54141ea to 4a82879 Compare December 1, 2025 18:00
@elBoberido elBoberido force-pushed the iox2-301-move-duration-files-to-iox2-bb branch from c1026ce to 1a0c427 Compare December 1, 2025 18:24
@elBoberido elBoberido force-pushed the iox2-301-move-duration-files-to-iox2-bb branch from 1a0c427 to 09d7c2f Compare December 1, 2025 18:37
Comment on lines +24 to +26
namespace iox2 {
namespace bb {
class Duration;
Copy link
Member Author

Choose a reason for hiding this comment

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

If it is okay, I would omit the additional unit namespace. It was always an outlier in iceoryx_hoofs and it was the only class in that namespace. No hard feelings about this and I will add it if desired.

/// @brief returns the duration in nanoseconds
/// @note If the duration in nanoseconds is larger than an uint64_t can represent, it will be clamped to the
/// uint64_t max value.
constexpr auto to_nanoseconds() const noexcept -> uint64_t;
Copy link
Member Author

Choose a reason for hiding this comment

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

The class was modeled after the Rust Duration but the naming of the methods is a bit off. I'd like to rename the to_ methods to as_. We have something similar with the SemanticString::as_string method.

Furthermore, I would like to shorten the name a little bit and use nanos, micros, etc. instead of nanoseconds, microseconds, etc. Also no hard feelings about this but if this change is not desired, I would rename the newly introduced subsec_nanos, etc. to subsecond_nanoseconds, etc. in order to have the same naming style.

The main reason for this is to get more code into one line without hitting the 120 character limit.

@elBoberido elBoberido marked this pull request as ready for review December 1, 2025 19:17
@elBoberido elBoberido requested a review from elfenpiff December 1, 2025 19:17
@elBoberido elBoberido marked this pull request as draft December 1, 2025 19:17
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.

3 participants