rippled
|
Abstract interface to a clock. 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 | |
virtual | ~abstract_clock ()=default |
abstract_clock ()=default | |
abstract_clock (abstract_clock const &)=default | |
virtual time_point | now () const =0 |
Returns the current time. More... | |
Static Public Attributes | |
static const bool | 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 57 of file abstract_clock.h.
using beast::abstract_clock< Clock >::rep = typename Clock::rep |
Definition at line 60 of file abstract_clock.h.
using beast::abstract_clock< Clock >::period = typename Clock::period |
Definition at line 61 of file abstract_clock.h.
using beast::abstract_clock< Clock >::duration = typename Clock::duration |
Definition at line 62 of file abstract_clock.h.
using beast::abstract_clock< Clock >::time_point = typename Clock::time_point |
Definition at line 63 of file abstract_clock.h.
using beast::abstract_clock< Clock >::clock_type = Clock |
Definition at line 64 of file abstract_clock.h.
|
virtualdefault |
|
default |
|
default |
|
pure virtual |
Returns the current time.
Implemented in beast::manual_clock< Clock >, and beast::manual_clock< std::chrono::steady_clock >.
|
static |
Definition at line 66 of file abstract_clock.h.