|
iceoryx2
C++ Language Bindings
|
#include <duration.hpp>
Public Member Functions | |
| constexpr auto | operator+ (const Duration &rhs) const noexcept -> Duration |
| Creates Duration object by addition. On overflow duration saturates to Duration::max(). | |
| constexpr auto | operator+= (const Duration &rhs) noexcept -> Duration & |
| Adds a Duration to itself. On overflow duration saturates to Duration::max(). | |
| constexpr auto | operator- (const Duration &rhs) const noexcept -> Duration |
| Creates Duration object by subtraction. On underflow duration saturates to Duration::zero(). | |
| constexpr auto | operator-= (const Duration &rhs) noexcept -> Duration & |
| Subtracts a Duration from itself. On underflow duration saturates to Duration::zero(). | |
| template<typename T > | |
| constexpr auto | operator* (const T &rhs) const noexcept -> Duration |
| Creates Duration object by multiplication. | |
| template<typename T > | |
| constexpr auto | operator*= (const T &rhs) noexcept -> Duration & |
| Multiplies a Duration with an arithmetic type and assigns the result to itself. | |
| constexpr auto | as_nanos () const noexcept -> uint64_t |
| returns the duration in nanoseconds | |
| constexpr auto | as_micros () const noexcept -> uint64_t |
| returns the duration in microseconds | |
| constexpr auto | as_millis () const noexcept -> uint64_t |
| returns the duration in milliseconds | |
| constexpr auto | as_secs () const noexcept -> uint64_t |
| returns the duration in seconds | |
| constexpr auto | as_mins () const noexcept -> uint64_t |
| returns the duration in minutes | |
| constexpr auto | as_hours () const noexcept -> uint64_t |
| returns the duration in hours | |
| constexpr auto | as_days () const noexcept -> uint64_t |
| returns the duration in days | |
| constexpr auto | subsec_nanos () const noexcept -> uint32_t |
| returns the subsecond part of the duration in nanoseconds | |
| constexpr auto | subsec_micros () const noexcept -> uint32_t |
| returns the subsecond part of the duration in microseconds | |
| constexpr auto | subsec_millis () const noexcept -> uint32_t |
| returns the subsecond part of the duration in milliseconds | |
| constexpr | Duration (SecondsT seconds, NanosecondsT nanoseconds) noexcept |
| Constructs a Duration from seconds and nanoseconds. | |
Static Public Member Functions | |
| template<typename T > | |
| static constexpr auto | from_nanos (T value) noexcept -> Duration |
| Constructs a new Duration object from nanoseconds. | |
| template<typename T > | |
| static constexpr auto | from_micros (T value) noexcept -> Duration |
| Constructs a new Duration object from microseconds. | |
| template<typename T > | |
| static constexpr auto | from_millis (T value) noexcept -> Duration |
| Constructs a new Duration object from milliseconds. | |
| template<typename T > | |
| static constexpr auto | from_secs (T value) noexcept -> Duration |
| Constructs a new Duration object from seconds. | |
| template<typename T > | |
| static constexpr auto | from_mins (T value) noexcept -> Duration |
| Constructs a new Duration object from minutes. | |
| template<typename T > | |
| static constexpr auto | from_hours (T value) noexcept -> Duration |
| Constructs a new Duration object from hours. | |
| template<typename T > | |
| static constexpr auto | from_days (T value) noexcept -> Duration |
| Constructs a new Duration object from days. | |
| static constexpr auto | max () noexcept -> Duration |
| Constructs a new Duration object of maximum allowed length. Useful for functions which should have an "infinite" timeout. | |
| static constexpr auto | zero () noexcept -> Duration |
| Constructs a new Duration object with a duration of zero. | |
| static constexpr auto | create_duration (SecondsT seconds, NanosecondsT nanoseconds) noexcept -> Duration |
Static Public Attributes | |
| static constexpr uint32_t | SECS_PER_MINUTE { 60U } |
| static constexpr uint32_t | SECS_PER_HOUR { 3600U } |
| static constexpr uint32_t | HOURS_PER_DAY { 24U } |
| static constexpr uint32_t | MILLISECS_PER_SEC { 1000U } |
| static constexpr uint32_t | MICROSECS_PER_SEC { MILLISECS_PER_SEC * 1000U } |
| static constexpr uint32_t | NANOSECS_PER_MICROSEC { 1000U } |
| static constexpr uint32_t | NANOSECS_PER_MILLISEC { NANOSECS_PER_MICROSEC * 1000U } |
| static constexpr uint32_t | NANOSECS_PER_SEC { NANOSECS_PER_MILLISEC * 1000U } |
Protected Types | |
| using | SecondsT = uint64_t |
| using | NanosecondsT = uint32_t |
Friends | |
| constexpr auto | operator== (const Duration &lhs, const Duration &rhs) noexcept -> bool |
| Equal to operator. | |
| constexpr auto | operator!= (const Duration &lhs, const Duration &rhs) noexcept -> bool |
| Not equal to operator. | |
| constexpr auto | operator< (const Duration &lhs, const Duration &rhs) noexcept -> bool |
| Less than operator. | |
| constexpr auto | operator<= (const Duration &lhs, const Duration &rhs) noexcept -> bool |
| Less than or equal to operator. | |
| constexpr auto | operator> (const Duration &lhs, const Duration &rhs) noexcept -> bool |
| Greater than operator. | |
| constexpr auto | operator>= (const Duration &lhs, const Duration &rhs) noexcept -> bool |
| Greater than or equal to operator. | |
| constexpr auto | duration_literals::operator""_ns (unsigned long long int value) noexcept -> Duration |
| constexpr auto | duration_literals::operator""_us (unsigned long long int value) noexcept -> Duration |
| constexpr auto | duration_literals::operator""_ms (unsigned long long int value) noexcept -> Duration |
| constexpr auto | duration_literals::operator""_s (unsigned long long int value) noexcept -> Duration |
| constexpr auto | duration_literals::operator""_m (unsigned long long int value) noexcept -> Duration |
| constexpr auto | duration_literals::operator""_h (unsigned long long int value) noexcept -> Duration |
| constexpr auto | duration_literals::operator""_d (unsigned long long int value) noexcept -> Duration |
| template<typename T > | |
| constexpr auto | operator* (const T &lhs, const Duration &rhs) noexcept -> Duration |
| creates Duration object by multiplying object T with a duration. On overflow duration will saturate to Duration::max() | |
Definition at line 69 of file duration.hpp.
|
protected |
Definition at line 72 of file duration.hpp.
|
protected |
Definition at line 71 of file duration.hpp.
|
constexprnoexcept |
Constructs a Duration from seconds and nanoseconds.
| [in] | seconds | portion of the duration |
| [in] | nanoseconds | portion of the duration |
Definition at line 393 of file duration.hpp.
|
constexprnoexcept |
returns the duration in days
Definition at line 556 of file duration.hpp.
References HOURS_PER_DAY, and SECS_PER_HOUR.
|
constexprnoexcept |
returns the duration in hours
Definition at line 552 of file duration.hpp.
References SECS_PER_HOUR.
|
constexprnoexcept |
returns the duration in microseconds
Definition at line 512 of file duration.hpp.
References create_duration(), MICROSECS_PER_SEC, and NANOSECS_PER_MICROSEC.
|
constexprnoexcept |
returns the duration in milliseconds
Definition at line 528 of file duration.hpp.
References create_duration(), MILLISECS_PER_SEC, and NANOSECS_PER_MILLISEC.
|
constexprnoexcept |
returns the duration in minutes
Definition at line 548 of file duration.hpp.
References SECS_PER_MINUTE.
|
constexprnoexcept |
returns the duration in nanoseconds
Definition at line 497 of file duration.hpp.
References create_duration(), and NANOSECS_PER_SEC.
|
constexprnoexcept |
returns the duration in seconds
Definition at line 544 of file duration.hpp.
|
staticconstexprnoexcept |
Definition at line 409 of file duration.hpp.
Referenced by as_micros(), as_millis(), as_nanos(), and iox2::BackpressureInfo::elapsed_time().
|
staticconstexprnoexcept |
Constructs a new Duration object from days.
| T | is an integer type for the value |
| [in] | value | as days |
Definition at line 487 of file duration.hpp.
References HOURS_PER_DAY, max(), and SECS_PER_HOUR.
Referenced by iox2::bb::duration_literals::operator""_d().
|
staticconstexprnoexcept |
Constructs a new Duration object from hours.
| T | is an integer type for the value |
| [in] | value | as hours |
Definition at line 478 of file duration.hpp.
References max(), and SECS_PER_HOUR.
Referenced by iox2::bb::duration_literals::operator""_h().
|
staticconstexprnoexcept |
Constructs a new Duration object from microseconds.
| T | is an integer type for the value |
| [in] | value | as microseconds |
Definition at line 442 of file duration.hpp.
References MICROSECS_PER_SEC, and NANOSECS_PER_MICROSEC.
Referenced by iox2::bb::From< std::chrono::microseconds, Duration >::from(), and iox2::bb::duration_literals::operator""_us().
|
staticconstexprnoexcept |
Constructs a new Duration object from milliseconds.
| T | is an integer type for the value |
| [in] | value | as milliseconds |
Definition at line 450 of file duration.hpp.
References MILLISECS_PER_SEC, and NANOSECS_PER_MILLISEC.
Referenced by iox2::bb::From< std::chrono::milliseconds, Duration >::from(), and iox2::bb::duration_literals::operator""_ms().
|
staticconstexprnoexcept |
Constructs a new Duration object from minutes.
| T | is an integer type for the value |
| [in] | value | as minutes |
Definition at line 469 of file duration.hpp.
References max(), and SECS_PER_MINUTE.
Referenced by iox2::bb::duration_literals::operator""_m().
|
staticconstexprnoexcept |
Constructs a new Duration object from nanoseconds.
| T | is an integer type for the value |
| [in] | value | as nanoseconds |
Definition at line 435 of file duration.hpp.
References NANOSECS_PER_SEC.
Referenced by iox2::Listener< ServiceType >::deadline(), iox2::bb::From< std::chrono::nanoseconds, Duration >::from(), and iox2::bb::duration_literals::operator""_ns().
|
staticconstexprnoexcept |
Constructs a new Duration object from seconds.
| T | is an integer type for the value |
| [in] | value | as seconds |
Definition at line 458 of file duration.hpp.
References max().
Referenced by iox2::Listener< ServiceType >::deadline(), iox2::bb::From< std::chrono::seconds, Duration >::from(), and iox2::bb::duration_literals::operator""_s().
|
staticconstexprnoexcept |
Constructs a new Duration object of maximum allowed length. Useful for functions which should have an "infinite" timeout.
Definition at line 413 of file duration.hpp.
References NANOSECS_PER_SEC.
Referenced by from_days(), from_hours(), from_mins(), from_secs(), and operator+().
|
constexprnoexcept |
Creates Duration object by multiplication.
| T | is an arithmetic type for the multiplicator |
| [in] | rhs | is the multiplicator |
Definition at line 753 of file duration.hpp.
|
constexprnoexcept |
Multiplies a Duration with an arithmetic type and assigns the result to itself.
| T | is an arithmetic type for the multiplicator |
| [in] | rhs | is the multiplicator |
Definition at line 760 of file duration.hpp.
|
constexprnoexcept |
Creates Duration object by addition. On overflow duration saturates to Duration::max().
| [in] | rhs | is the second summand |
Definition at line 573 of file duration.hpp.
References max().
|
constexprnoexcept |
Adds a Duration to itself. On overflow duration saturates to Duration::max().
| [in] | rhs | is the second summand |
Definition at line 589 of file duration.hpp.
|
constexprnoexcept |
Creates Duration object by subtraction. On underflow duration saturates to Duration::zero().
| [in] | rhs | is the subtrahend |
Definition at line 595 of file duration.hpp.
References zero().
|
constexprnoexcept |
Subtracts a Duration from itself. On underflow duration saturates to Duration::zero().
| [in] | rhs | is the subtrahend |
Definition at line 613 of file duration.hpp.
|
constexprnoexcept |
returns the subsecond part of the duration in microseconds
Definition at line 564 of file duration.hpp.
References NANOSECS_PER_MICROSEC.
|
constexprnoexcept |
returns the subsecond part of the duration in milliseconds
Definition at line 568 of file duration.hpp.
References NANOSECS_PER_MILLISEC.
|
constexprnoexcept |
returns the subsecond part of the duration in nanoseconds
Definition at line 560 of file duration.hpp.
|
staticconstexprnoexcept |
Constructs a new Duration object with a duration of zero.
Definition at line 417 of file duration.hpp.
Referenced by operator-().
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
Not equal to operator.
| [in] | lhs | is the left hand side of the comparison |
| [in] | rhs | is the right hand side of the comparison |
Definition at line 349 of file duration.hpp.
|
friend |
creates Duration object by multiplying object T with a duration. On overflow duration will saturate to Duration::max()
| T | is an arithmetic type for the multiplicator |
| [in] | lhs | is the multiplicator |
| [in] | rhs | is the multiplicant |
Definition at line 320 of file duration.hpp.
Less than operator.
| [in] | lhs | is the left hand side of the comparison |
| [in] | rhs | is the right hand side of the comparison |
Definition at line 358 of file duration.hpp.
Less than or equal to operator.
| [in] | lhs | is the left hand side of the comparison |
| [in] | rhs | is the right hand side of the comparison |
Definition at line 378 of file duration.hpp.
Equal to operator.
| [in] | lhs | is the left hand side of the comparison |
| [in] | rhs | is the right hand side of the comparison |
Definition at line 340 of file duration.hpp.
Greater than operator.
| [in] | lhs | is the left hand side of the comparison |
| [in] | rhs | is the right hand side of the comparison |
Definition at line 368 of file duration.hpp.
Greater than or equal to operator.
| [in] | lhs | is the left hand side of the comparison |
| [in] | rhs | is the right hand side of the comparison |
Definition at line 387 of file duration.hpp.
|
staticconstexpr |
Definition at line 274 of file duration.hpp.
Referenced by as_days(), and from_days().
|
staticconstexpr |
Definition at line 277 of file duration.hpp.
Referenced by as_micros(), and from_micros().
|
staticconstexpr |
Definition at line 276 of file duration.hpp.
Referenced by as_millis(), and from_millis().
|
staticconstexpr |
Definition at line 279 of file duration.hpp.
Referenced by as_micros(), from_micros(), and subsec_micros().
|
staticconstexpr |
Definition at line 280 of file duration.hpp.
Referenced by as_millis(), from_millis(), and subsec_millis().
|
staticconstexpr |
Definition at line 281 of file duration.hpp.
Referenced by as_nanos(), from_nanos(), and max().
|
staticconstexpr |
Definition at line 273 of file duration.hpp.
Referenced by as_days(), as_hours(), from_days(), and from_hours().
|
staticconstexpr |
Definition at line 272 of file duration.hpp.
Referenced by as_mins(), and from_mins().