libfranka 0.15.0
FCI C++ API
|
Represents a duration with millisecond resolution. More...
#include <duration.h>
Public Member Functions | |
Duration () noexcept | |
Creates a new Duration instance with zero milliseconds. | |
Duration (uint64_t milliseconds) noexcept | |
Creates a new Duration instance from the given number of milliseconds. | |
Duration (std::chrono::duration< uint64_t, std::milli > duration) noexcept | |
Creates a new Duration instance from an std::chrono::duration. | |
Duration (const Duration &)=default | |
Creates a copy of a Duration instance. | |
Duration & | operator= (const Duration &)=default |
Assigns the contents of one Duration to another. | |
operator std::chrono::duration< uint64_t, std::milli > () const noexcept | |
Returns the stored duration as an std::chrono::duration. | |
double | toSec () const noexcept |
Returns the stored duration in \([s]\). | |
uint64_t | toMSec () const noexcept |
Returns the stored duration in \([ms]\). | |
Arithmetic operators | |
Duration | operator+ (const Duration &rhs) const noexcept |
Performs addition. | |
Duration & | operator+= (const Duration &rhs) noexcept |
Performs addition. | |
Duration | operator- (const Duration &rhs) const noexcept |
Performs subtraction. | |
Duration & | operator-= (const Duration &rhs) noexcept |
Performs subtraction. | |
Duration | operator* (uint64_t rhs) const noexcept |
Performs multiplication. | |
Duration & | operator*= (uint64_t rhs) noexcept |
Performs multiplication. | |
uint64_t | operator/ (const Duration &rhs) const noexcept |
Performs division. | |
Duration | operator/ (uint64_t rhs) const noexcept |
Performs division. | |
Duration & | operator/= (uint64_t rhs) noexcept |
Performs division. | |
Duration | operator% (const Duration &rhs) const noexcept |
Performs the modulo operation. | |
Duration | operator% (uint64_t rhs) const noexcept |
Performs the modulo operation. | |
Duration & | operator%= (const Duration &rhs) noexcept |
Performs the modulo operation. | |
Duration & | operator%= (uint64_t rhs) noexcept |
Performs the modulo operation. | |
Comparison operators | |
bool | operator== (const Duration &rhs) const noexcept |
Compares two durations for equality. | |
bool | operator!= (const Duration &rhs) const noexcept |
Compares two durations for inequality. | |
bool | operator< (const Duration &rhs) const noexcept |
Compares two durations. | |
bool | operator<= (const Duration &rhs) const noexcept |
Compares two durations. | |
bool | operator> (const Duration &rhs) const noexcept |
Compares two durations. | |
bool | operator>= (const Duration &rhs) const noexcept |
Compares two durations. | |
Represents a duration with millisecond resolution.
|
explicitnoexcept |
Creates a new Duration instance from the given number of milliseconds.
[in] | milliseconds | Number of milliseconds. |
|
noexcept |
|
noexcept |
Returns the stored duration as an std::chrono::duration.
|
noexcept |
Compares two durations for inequality.
[in] | rhs | Right-hand side of the comparison. |
Performs the modulo operation.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs the modulo operation.
[in] | rhs | Right-hand side of the operation. |
Performs the modulo operation.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs the modulo operation.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs multiplication.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs multiplication.
[in] | rhs | Right-hand side of the operation. |
Performs addition.
[in] | rhs | Right-hand side of the operation. |
Performs addition.
[in] | rhs | Right-hand side of the operation. |
Performs subtraction.
[in] | rhs | Right-hand side of the operation. |
Performs subtraction.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs division.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs division.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Performs division.
[in] | rhs | Right-hand side of the operation. |
|
noexcept |
Compares two durations.
[in] | rhs | Right-hand side of the comparison. |
|
noexcept |
Compares two durations.
[in] | rhs | Right-hand side of the comparison. |
Assigns the contents of one Duration to another.
|
noexcept |
Compares two durations for equality.
[in] | rhs | Right-hand side of the comparison. |
|
noexcept |
Compares two durations.
[in] | rhs | Right-hand side of the comparison. |
|
noexcept |
Compares two durations.
[in] | rhs | Right-hand side of the comparison. |
|
noexcept |
Returns the stored duration in \([ms]\).
|
noexcept |
Returns the stored duration in \([s]\).