|
xrpld
|
Abstract interface to a clock. More...
#include <abstract_clock.h>

Public Types | |
| using | rep = Clock::rep |
| using | period = Clock::period |
| using | duration = Clock::duration |
| using | time_point = Clock::time_point |
| using | clock_type = Clock |
Public Member Functions | |
| virtual | ~AbstractClock ()=default |
| AbstractClock ()=default | |
| AbstractClock (AbstractClock const &)=default | |
| virtual time_point | now () const =0 |
| Returns the current time. | |
Static Public Attributes | |
| static bool const | is_steady = Clock::is_steady |
Abstract interface to a clock.
This makes now() a member function instead of a static member, so an instance of the class can be dependency injected, facilitating unit tests where time may be controlled.
An abstract_clock inherits all the nested types of the Clock template parameter.
Example:
| Clock | A type meeting these requirements: http://en.cppreference.com/w/cpp/concept/Clock |
Definition at line 34 of file abstract_clock.h.
| using beast::AbstractClock< Clock >::rep = Clock::rep |
Definition at line 37 of file abstract_clock.h.
| using beast::AbstractClock< Clock >::period = Clock::period |
Definition at line 38 of file abstract_clock.h.
| using beast::AbstractClock< Clock >::duration = Clock::duration |
Definition at line 39 of file abstract_clock.h.
| using beast::AbstractClock< Clock >::time_point = Clock::time_point |
Definition at line 40 of file abstract_clock.h.
| using beast::AbstractClock< Clock >::clock_type = Clock |
Definition at line 41 of file abstract_clock.h.
|
virtualdefault |
|
default |
|
default |
|
nodiscardpure virtual |
Returns the current time.
Implemented in beast::detail::AbstractClockWrapper< Facade, Clock >, beast::ManualClock< Clock >, beast::ManualClock< std::chrono::steady_clock >, xrpl::test::ManualTimeKeeper, and xrpl::TimeKeeper.
|
static |
Definition at line 43 of file abstract_clock.h.