20 #ifndef BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED
21 #define BEAST_CHRONO_MANUAL_CLOCK_H_INCLUDED
23 #include <ripple/beast/clock/abstract_clock.h>
37 template <
class Clock>
64 assert(!Clock::is_steady || when >=
now_);
69 template <
class Integer>
71 set(Integer seconds_from_epoch)
77 template <
class Rep,
class Period>
81 assert(!Clock::is_steady || (
now_ + elapsed) >=
now_);
void advance(std::chrono::duration< Rep, Period > const &elapsed)
Advance the clock by a duration.
void set(Integer seconds_from_epoch)
Convenience for setting the time in seconds from epoch.
void set(time_point const &when)
Set the current time of the manual clock.
manual_clock & operator++()
Convenience for advancing the clock by one second.
Abstract interface to a clock.
time_point now() const override
Returns the current time.
manual_clock(time_point const &now=time_point(duration(0)))
Manual clock implementation.
typename Clock::time_point time_point
typename Clock::duration duration