rippled
|
Manual clock implementation. More...
Public Types | |
using | rep = typename Clock::rep |
using | period = typename Clock::period |
using | duration = typename Clock::duration |
using | time_point = typename Clock::time_point |
using | clock_type = Clock |
Public Member Functions | |
manual_clock (time_point const &now=time_point(duration(0))) | |
time_point | now () const override |
Returns the current time. More... | |
void | set (time_point const &when) |
Set the current time of the manual clock. More... | |
template<class Integer > | |
void | set (Integer seconds_from_epoch) |
Convenience for setting the time in seconds from epoch. More... | |
template<class Rep , class Period > | |
void | advance (std::chrono::duration< Rep, Period > const &elapsed) |
Advance the clock by a duration. More... | |
manual_clock & | operator++ () |
Convenience for advancing the clock by one second. More... | |
Static Public Attributes | |
static const bool | is_steady = Clock::is_steady |
Private Attributes | |
time_point | now_ |
Manual clock implementation.
This concrete class implements the abstract_clock interface and allows the time to be advanced manually, mainly for the purpose of providing a clock in unit tests.
Clock | A type meeting these requirements: http://en.cppreference.com/w/cpp/concept/Clock |
Definition at line 38 of file manual_clock.h.
|
inherited |
Definition at line 60 of file abstract_clock.h.
|
inherited |
Definition at line 61 of file abstract_clock.h.
|
inherited |
Definition at line 62 of file abstract_clock.h.
|
inherited |
Definition at line 63 of file abstract_clock.h.
|
inherited |
Definition at line 64 of file abstract_clock.h.
|
explicit |
Definition at line 49 of file manual_clock.h.
|
overridevirtual |
Returns the current time.
Implements beast::abstract_clock< Clock >.
Definition at line 55 of file manual_clock.h.
void beast::manual_clock< Clock >::set | ( | time_point const & | when | ) |
Set the current time of the manual clock.
Definition at line 62 of file manual_clock.h.
void beast::manual_clock< Clock >::set | ( | Integer | seconds_from_epoch | ) |
Convenience for setting the time in seconds from epoch.
Definition at line 71 of file manual_clock.h.
void beast::manual_clock< Clock >::advance | ( | std::chrono::duration< Rep, Period > const & | elapsed | ) |
Advance the clock by a duration.
Definition at line 79 of file manual_clock.h.
manual_clock& beast::manual_clock< Clock >::operator++ | ( | ) |
Convenience for advancing the clock by one second.
Definition at line 87 of file manual_clock.h.
|
private |
Definition at line 46 of file manual_clock.h.
|
staticinherited |
Definition at line 66 of file abstract_clock.h.