Bitcoin Core 30.99.0
P2P Digital Currency
Public Member Functions | Private Attributes | List of all members
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. More...
 
 ~SteadyClockContext ()
 Unset mocktime. More...
 
 SteadyClockContext (const SteadyClockContext &)=delete
 
SteadyClockContextoperator= (const SteadyClockContext &)=delete
 
void operator+= (std::chrono::milliseconds d)
 Change mocktime by the given duration delta. More...
 

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.

◆ ~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

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

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: