Version of SteadyClock that is mockable in the context of tests (via SteadyClockContext, or Self::SetMockTime), otherwise the system steady clock.
More...
#include <time.h>
Version of SteadyClock that is mockable in the context of tests (via SteadyClockContext, or Self::SetMockTime), otherwise the system steady clock.
Definition at line 46 of file time.h.
◆ mock_time_point
◆ time_point
◆ ClearMockTime()
| void MockableSteadyClock::ClearMockTime |
( |
| ) |
|
|
static |
Clear mock time, go back to system steady clock.
Definition at line 82 of file time.cpp.
◆ from_time_t()
| static time_point MockableSteadyClock::from_time_t |
( |
std::time_t |
| ) |
|
|
staticdelete |
◆ now()
Return current system time or mocked time, if set.
Definition at line 63 of file time.cpp.
◆ SetMockTime()
| void MockableSteadyClock::SetMockTime |
( |
mock_time_point::duration |
mock_time_in | ) |
|
|
static |
Set mock time for testing.
When mocking the steady clock, start at INITIAL_MOCK_TIME and add durations to elapse time as necessary for testing. To stop mocking, call ClearMockTime().
Definition at line 76 of file time.cpp.
◆ to_time_t()
| static std::time_t MockableSteadyClock::to_time_t |
( |
const time_point & |
| ) |
|
|
staticdelete |
◆ INITIAL_MOCK_TIME
| constexpr mock_time_point::duration MockableSteadyClock::INITIAL_MOCK_TIME {1} |
|
staticconstexpr |
The documentation for this struct was generated from the following files: