Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
More...
#include <time.h>
Helper to initialize the global NodeClock, let a duration elapse, and reset it after use in a test.
Definition at line 39 of file time.h.
◆ NodeClockContext() [1/4]
| NodeClockContext::NodeClockContext |
( |
NodeSeconds |
init_time | ) |
|
|
inlineexplicit |
Initialize with the given time.
Definition at line 45 of file time.h.
◆ NodeClockContext() [2/4]
| NodeClockContext::NodeClockContext |
( |
std::chrono::seconds |
init_time | ) |
|
|
inlineexplicit |
◆ NodeClockContext() [3/4]
| NodeClockContext::NodeClockContext |
( |
| ) |
|
|
inlineexplicit |
Initialize with current time, using the next tick to avoid going back by rounding to seconds.
Definition at line 48 of file time.h.
◆ ~NodeClockContext()
| NodeClockContext::~NodeClockContext |
( |
| ) |
|
|
inline |
Unset mocktime.
Definition at line 51 of file time.h.
◆ NodeClockContext() [4/4]
◆ operator+=()
| void NodeClockContext::operator+= |
( |
std::chrono::seconds |
d | ) |
|
|
inline |
Change mocktime by the given duration delta.
Definition at line 61 of file time.h.
◆ operator-=()
| void NodeClockContext::operator-= |
( |
std::chrono::seconds |
d | ) |
|
|
inline |
◆ operator=()
◆ set() [1/2]
Set mocktime.
Definition at line 57 of file time.h.
◆ set() [2/2]
| void NodeClockContext::set |
( |
std::chrono::seconds |
t | ) |
|
|
inline |
◆ m_t
| NodeSeconds NodeClockContext::m_t {std::chrono::seconds::max()} |
|
private |
The documentation for this class was generated from the following file: