rippled
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | Static Private Member Functions | Private Attributes | List of all members
ripple::test::ManualTimeKeeper Class Reference

#include <ManualTimeKeeper.h>

Inheritance diagram for ripple::test::ManualTimeKeeper:
Inheritance graph
[legend]
Collaboration diagram for ripple::test::ManualTimeKeeper:
Collaboration graph
[legend]

Public Types

using rep = typename Clock::rep
 
using period = typename Clock::period
 
using duration = typename Clock::duration
 
using time_point = typename Clock::time_point
 
using clock_type = NetClock
 

Public Member Functions

 ManualTimeKeeper ()=default
 
time_point now () const override
 Returns the current time.
 
void set (time_point now)
 
time_point closeTime () const
 Returns the predicted close time, in network time.
 
std::chrono::seconds closeOffset () const
 
std::chrono::seconds adjustCloseTime (std::chrono::seconds by)
 Adjust the close time, based on the network's view of time.
 

Static Public Attributes

static bool const is_steady
 

Static Private Member Functions

static constexpr time_point adjust (std::chrono::system_clock::time_point when)
 

Private Attributes

std::atomic< time_pointnow_ {}
 
std::atomic< std::chrono::secondscloseOffset_ {}
 

Detailed Description

Definition at line 11 of file ManualTimeKeeper.h.

Member Typedef Documentation

◆ rep

using beast::abstract_clock< NetClock >::rep = typename Clock::rep
inherited

Definition at line 38 of file abstract_clock.h.

◆ period

using beast::abstract_clock< NetClock >::period = typename Clock::period
inherited

Definition at line 39 of file abstract_clock.h.

◆ duration

using beast::abstract_clock< NetClock >::duration = typename Clock::duration
inherited

Definition at line 40 of file abstract_clock.h.

◆ time_point

using beast::abstract_clock< NetClock >::time_point = typename Clock::time_point
inherited

Definition at line 41 of file abstract_clock.h.

◆ clock_type

using beast::abstract_clock< NetClock >::clock_type = NetClock
inherited

Definition at line 42 of file abstract_clock.h.

Constructor & Destructor Documentation

◆ ManualTimeKeeper()

ripple::test::ManualTimeKeeper::ManualTimeKeeper ( )
default

Member Function Documentation

◆ now()

time_point ripple::test::ManualTimeKeeper::now ( ) const
overridevirtual

Returns the current time.

Implements beast::abstract_clock< NetClock >.

Definition at line 20 of file ManualTimeKeeper.h.

◆ set()

void ripple::test::ManualTimeKeeper::set ( time_point  now)

Definition at line 26 of file ManualTimeKeeper.h.

◆ adjust()

static constexpr time_point ripple::TimeKeeper::adjust ( std::chrono::system_clock::time_point  when)
staticconstexprprivateinherited

Definition at line 19 of file TimeKeeper.h.

◆ closeTime()

time_point ripple::TimeKeeper::closeTime ( ) const
inherited

Returns the predicted close time, in network time.

The predicted close time represents the notional "center" of the network. Each server assumes that its clock is correct and tries to pull the close time towards its measure of network time.

Definition at line 57 of file TimeKeeper.h.

◆ closeOffset()

std::chrono::seconds ripple::TimeKeeper::closeOffset ( ) const
inherited

Definition at line 64 of file TimeKeeper.h.

◆ adjustCloseTime()

std::chrono::seconds ripple::TimeKeeper::adjustCloseTime ( std::chrono::seconds  by)
inherited

Adjust the close time, based on the network's view of time.

Definition at line 71 of file TimeKeeper.h.

Member Data Documentation

◆ now_

std::atomic<time_point> ripple::test::ManualTimeKeeper::now_ {}
private

Definition at line 14 of file ManualTimeKeeper.h.

◆ closeOffset_

std::atomic<std::chrono::seconds> ripple::TimeKeeper::closeOffset_ {}
privateinherited

Definition at line 15 of file TimeKeeper.h.

◆ is_steady

bool const beast::abstract_clock< NetClock >::is_steady
staticinherited

Definition at line 44 of file abstract_clock.h.