-
Notifications
You must be signed in to change notification settings - Fork 101
[Stacked PR] [Based on #1206] [#301] Move 'Duration' files to 'iox2/bb' #1207
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
base: iox2-301-move-into-files-to-iox2-bb
Are you sure you want to change the base?
[Stacked PR] [Based on #1206] [#301] Move 'Duration' files to 'iox2/bb' #1207
Conversation
54141ea to
4a82879
Compare
… for stream operator
c1026ce to
1a0c427
Compare
1a0c427 to
09d7c2f
Compare
| namespace iox2 { | ||
| namespace bb { | ||
| class Duration; |
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.
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; |
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.
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.
Notes for Reviewer
This PR moves
iox2/legacy/duration.hppand its dependencies toiox2/bb/duration.hpp. Furthermore, the namespace is adjusted toiox2::bband the clang-tidy warnings are fixed.Pre-Review Checklist for the PR Author
Convert to draft)SPDX-License-Identifier: Apache-2.0 OR MITiox2-123-introduce-posix-ipc-example)[#123] Add posix ipc example)task-list-completed)Checklist for the PR Reviewer
Post-review Checklist for the PR Author
References
Closes #