Bitcoin Core 32.1.0
P2P Digital Currency
Loading...
Searching...
No Matches
NodeClock Struct Reference

Version of the system clock that is mockable in the context of tests (via FakeNodeClock or SetMockTime), otherwise the system clock. More...

#include <time.h>

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

Public Types

using time_point = std::chrono::time_point<NodeClock>

Static Public Member Functions

static time_point now () noexcept
 Return current system time or mocked time, if set.
static std::time_t to_time_t (const time_point &)=delete
static time_point from_time_t (std::time_t)=delete

Static Public Attributes

static constexpr time_point epoch {}

Detailed Description

Version of the system clock that is mockable in the context of tests (via FakeNodeClock or SetMockTime), otherwise the system clock.

Definition at line 27 of file time.h.

Member Typedef Documentation

◆ time_point

using NodeClock::time_point = std::chrono::time_point<NodeClock>

Definition at line 28 of file time.h.

Member Function Documentation

◆ from_time_t()

time_point NodeClock::from_time_t ( std::time_t )
staticdelete
Here is the call graph for this function:
Here is the caller graph for this function:

◆ now()

NodeClock::time_point NodeClock::now ( )
staticnoexcept

Return current system time or mocked time, if set.

Definition at line 38 of file time.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ to_time_t()

std::time_t NodeClock::to_time_t ( const time_point & )
staticdelete
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ epoch

time_point NodeClock::epoch {}
staticconstexpr

Definition at line 33 of file time.h.


The documentation for this struct was generated from the following files: