| 
    rippled
    
   | 
 
Manages various times used by the server. More...
#include <TimeKeeper.h>


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 | |
| virtual | ~TimeKeeper ()=default | 
| time_point | now () const override | 
| Returns the current time, using the server's clock.   | |
| 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< std::chrono::seconds > | closeOffset_ {} | 
Manages various times used by the server.
Definition at line 31 of file TimeKeeper.h.
      
  | 
  inherited | 
Definition at line 57 of file abstract_clock.h.
      
  | 
  inherited | 
Definition at line 58 of file abstract_clock.h.
      
  | 
  inherited | 
Definition at line 59 of file abstract_clock.h.
      
  | 
  inherited | 
Definition at line 60 of file abstract_clock.h.
      
  | 
  inherited | 
Definition at line 61 of file abstract_clock.h.
      
  | 
  virtualdefault | 
      
  | 
  staticconstexprprivate | 
Definition at line 38 of file TimeKeeper.h.
      
  | 
  overridevirtual | 
Returns the current time, using the server's clock.
It's possible for servers to have a different value for network time, especially if they do not use some external mechanism for time synchronization (e.g. NTP or SNTP). This is fine.
This estimate is not directly visible to other servers over the protocol, but it is possible for them to make an educated guess if this server publishes proposals or validations.
Implements beast::abstract_clock< NetClock >.
Definition at line 64 of file TimeKeeper.h.
| time_point ripple::TimeKeeper::closeTime | ( | ) | const | 
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 76 of file TimeKeeper.h.
| std::chrono::seconds ripple::TimeKeeper::closeOffset | ( | ) | const | 
Definition at line 83 of file TimeKeeper.h.
| std::chrono::seconds ripple::TimeKeeper::adjustCloseTime | ( | std::chrono::seconds | by | ) | 
Adjust the close time, based on the network's view of time.
Definition at line 90 of file TimeKeeper.h.
      
  | 
  private | 
Definition at line 34 of file TimeKeeper.h.
      
  | 
  staticinherited | 
Definition at line 63 of file abstract_clock.h.