#include <userver/engine/deadline.hpp>
Internal representation of a deadline time point.
Definition at line 14 of file deadline.hpp.
|
| using | Clock = std::chrono::steady_clock |
| |
| using | TimePoint = Clock::time_point |
| |
| using | Duration = TimePoint::duration |
| |
|
|
constexpr | Deadline ()=default |
| | Creates an unreachable deadline.
|
| |
| constexpr bool | IsReachable () const noexcept |
| | Returns whether the deadline can be reached.
|
| |
|
bool | IsReached () const noexcept |
| | Returns whether the deadline is reached.
|
| |
| bool | IsSurelyReachedApprox () const noexcept |
| |
|
Duration | TimeLeft () const noexcept |
| | Returns the duration of time left before the reachable deadline.
|
| |
| Duration | TimeLeftApprox () const noexcept |
| |
| constexpr TimePoint | GetTimePoint () const noexcept |
| |
| constexpr bool | operator== (const Deadline &r) const noexcept |
| |
| constexpr bool | operator< (const Deadline &r) const noexcept |
| |
|
| template<typename Rep, typename Period> |
| static Deadline | FromDuration (const std::chrono::duration< Rep, Period > &duration) noexcept |
| | Converts duration to a Deadline.
|
| |
| static Deadline | FromDuration (const Duration &duration) noexcept |
| |
| template<typename Clock, typename Duration> |
| static Deadline | FromTimePoint (const std::chrono::time_point< Clock, Duration > &time_point) noexcept |
| | Converts time point to a Deadline.
|
| |
| static constexpr Deadline | Passed () noexcept |
| | A Deadline that is guaranteed to be IsReached.
|
| |
| template<typename Rep, typename Period> |
| static Duration | ToDurationSaturating (const std::chrono::duration< Rep, Period > &from) noexcept |
| | Converts 'std::chrono::duration<>' to 'Deadline::Duration'.
|
| |
◆ Clock
| using engine::Deadline::Clock = std::chrono::steady_clock |
◆ Duration
| using engine::Deadline::Duration = TimePoint::duration |
◆ TimePoint
| using engine::Deadline::TimePoint = Clock::time_point |
◆ FromDuration() [1/2]
| static Deadline engine::Deadline::FromDuration |
( |
const Duration & | duration | ) |
|
|
inlinestaticnoexcept |
◆ FromDuration() [2/2]
template<typename Rep, typename Period>
| static Deadline engine::Deadline::FromDuration |
( |
const std::chrono::duration< Rep, Period > & | duration | ) |
|
|
inlinestaticnoexcept |
◆ FromTimePoint()
template<typename Clock, typename Duration>
| static Deadline engine::Deadline::FromTimePoint |
( |
const std::chrono::time_point< Clock, Duration > & | time_point | ) |
|
|
inlinestaticnoexcept |
Converts time point to a Deadline.
Non-steady clocks may produce inaccurate Deadlines. Prefer using Deadline::FromDuration or std::chrono::steady_clock::time_point if possible.
Definition at line 65 of file deadline.hpp.
◆ GetTimePoint()
| TimePoint engine::Deadline::GetTimePoint |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns the native time point value. Returns TimePoint::max() for unreachable deadline and TimePoint::min() for Deadline::Passed()
Definition at line 44 of file deadline.hpp.
◆ IsReachable()
| bool engine::Deadline::IsReachable |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Returns whether the deadline can be reached.
Definition at line 24 of file deadline.hpp.
◆ IsSurelyReachedApprox()
| bool engine::Deadline::IsSurelyReachedApprox |
( |
| ) |
const |
|
noexcept |
Returns whether the deadline is reached. Will report false-negatives, will never report false-positives.
◆ operator<()
| bool engine::Deadline::operator< |
( |
const Deadline & | r | ) |
const |
|
inlineconstexprnoexcept |
◆ operator==()
| bool engine::Deadline::operator== |
( |
const Deadline & | r | ) |
const |
|
inlineconstexprnoexcept |
◆ Passed()
| static constexpr Deadline engine::Deadline::Passed |
( |
| ) |
|
|
inlinestaticconstexprnoexcept |
◆ TimeLeftApprox()
| Duration engine::Deadline::TimeLeftApprox |
( |
| ) |
const |
|
noexcept |
◆ ToDurationSaturating()
template<typename Rep, typename Period>
| static Duration engine::Deadline::ToDurationSaturating |
( |
const std::chrono::duration< Rep, Period > & | from | ) |
|
|
inlinestaticnoexcept |
Converts 'std::chrono::duration<>' to 'Deadline::Duration'.
Definition at line 87 of file deadline.hpp.
The documentation for this class was generated from the following file: