Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
SteadyClockContext Class Reference

Helper to initialize the global MockableSteadyClock, let a duration elapse, and reset it after use in a test. More...

#include <time.h>

Public Member Functions

 SteadyClockContext ()
 Initialize with INITIAL_MOCK_TIME.
 ~SteadyClockContext ()
 Unset mocktime.
 SteadyClockContext (const SteadyClockContext &)=delete
SteadyClockContextoperator= (const SteadyClockContext &)=delete
void operator+= (std::chrono::milliseconds d)
 Change mocktime by the given duration delta.

Private Attributes

MockableSteadyClock::mock_time_point::duration t {MockableSteadyClock::INITIAL_MOCK_TIME}

Detailed Description

Helper to initialize the global MockableSteadyClock, let a duration elapse, and reset it after use in a test.

Definition at line 14 of file time.h.

Constructor & Destructor Documentation

◆ SteadyClockContext() [1/2]

SteadyClockContext::SteadyClockContext ( )
inlineexplicit

Initialize with INITIAL_MOCK_TIME.

Definition at line 20 of file time.h.

Here is the caller graph for this function:

◆ ~SteadyClockContext()

SteadyClockContext::~SteadyClockContext ( )
inline

Unset mocktime.

Definition at line 23 of file time.h.

Here is the call graph for this function:

◆ SteadyClockContext() [2/2]

SteadyClockContext::SteadyClockContext ( const SteadyClockContext & )
delete
Here is the call graph for this function:

Member Function Documentation

◆ operator+=()

void SteadyClockContext::operator+= ( std::chrono::milliseconds d)
inline

Change mocktime by the given duration delta.

Definition at line 29 of file time.h.

Here is the call graph for this function:

◆ operator=()

SteadyClockContext & SteadyClockContext::operator= ( const SteadyClockContext & )
delete
Here is the call graph for this function:

Member Data Documentation

◆ t

MockableSteadyClock::mock_time_point::duration SteadyClockContext::t {MockableSteadyClock::INITIAL_MOCK_TIME}
private

Definition at line 16 of file time.h.


The documentation for this class was generated from the following file: