ZG  "1.00
 All Classes Namespaces Files Functions Variables Enumerator Friends Macros Pages
Public Member Functions | List of all members
INetworkTimeProvider Class Referenceabstract

This is an abstract interface for an object that can provide us with network-clock-time values. More...

#include <INetworkTimeProvider.h>

Inheritance diagram for INetworkTimeProvider:
Inheritance graph
[legend]

Public Member Functions

virtual uint64 GetNetworkTime64 () const =0
 Returns the current time according to the network-time-clock, in microseconds. More...
 
virtual uint64 GetRunTime64ForNetworkTime64 (uint64 networkTime64TimeStamp) const =0
 Given a network-time-clock-value (i.e. More...
 
virtual uint64 GetNetworkTime64ForRunTime64 (uint64 runTime64TimeStamp) const =0
 Given a local-time-clock-value (i.e. More...
 
virtual int64 GetToNetworkTimeOffset () const =0
 Returns the number of microseconds that should be added to a GetRunTime64() value to turn it into a GetNetworkTime64() value, or subtracted to do the inverse operation. More...
 

Detailed Description

This is an abstract interface for an object that can provide us with network-clock-time values.

Definition at line 10 of file INetworkTimeProvider.h.

Member Function Documentation

virtual uint64 GetNetworkTime64 ( ) const
pure virtual

Returns the current time according to the network-time-clock, in microseconds.

The intent of this clock is to be the same on all peers in the system. However, this means that it may occasionally change (break monotonicity) in order to synchronize with the other peers in the system. Note that this function will return 0 if we aren't currently fully attached to the system, since before then we don't know the network time.

Implemented in IDatabaseObject, and ZGPeerSession.

virtual uint64 GetNetworkTime64ForRunTime64 ( uint64  runTime64TimeStamp) const
pure virtual

Given a local-time-clock-value (i.e.

one using the same time-base as returned by GetRunTime64()), returns the approximately equivalent network-time-value (i.e. one using the same time-base as returned by GetNetworkTime64())

Parameters
runTime64TimeStampa local-clock time, in microseconds

Implemented in IDatabaseObject, and ZGPeerSession.

virtual uint64 GetRunTime64ForNetworkTime64 ( uint64  networkTime64TimeStamp) const
pure virtual

Given a network-time-clock-value (i.e.

one using the same time-base as returned by GetNetworkTime64()), returns the approximately-equivalent local-time-clock-value (i.e. one using the same time-base as returned by GetRunTime64())

Parameters
networkTime64TimeStampa network-clock time, in microseconds

Implemented in IDatabaseObject, and ZGPeerSession.

virtual int64 GetToNetworkTimeOffset ( ) const
pure virtual

Returns the number of microseconds that should be added to a GetRunTime64() value to turn it into a GetNetworkTime64() value, or subtracted to do the inverse operation.

Note that this value will vary from one moment to the next!

Implemented in IDatabaseObject, and ZGPeerSession.


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