Bitcoin Core 31.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>

Inheritance diagram for SteadyClockContext:
[legend]
Collaboration diagram for SteadyClockContext:
[legend]

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...
 
- Public Member Functions inherited from LimitOne< SteadyClockContext >
 LimitOne ()
 
 LimitOne (const LimitOne &)=delete
 
 ~LimitOne ()
 
LimitOneoperator= (const LimitOne &)=delete
 

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 28 of file time.h.

Constructor & Destructor Documentation

◆ SteadyClockContext() [1/2]

SteadyClockContext::SteadyClockContext ( )
inlineexplicit

Initialize with INITIAL_MOCK_TIME.

Definition at line 34 of file time.h.

◆ ~SteadyClockContext()

SteadyClockContext::~SteadyClockContext ( )
inline

Unset mocktime.

Definition at line 37 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 43 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 30 of file time.h.


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