CatapultServer  v0.5.0.1 (Elephant)
catapult::timesync::TimeSynchronizationSample Class Reference

Represents a sample in the time synchronization process. More...

Collaboration diagram for catapult::timesync::TimeSynchronizationSample:

Public Member Functions

 TimeSynchronizationSample ()
 Creates a default time synchronization sample. More...
 
 TimeSynchronizationSample (const ionet::Node &node, const CommunicationTimestamps &localTimestamps, const CommunicationTimestamps &remoteTimestamps)
 
const ionet::Nodenode () const
 Gets the node. More...
 
const CommunicationTimestampslocalTimestamps () const
 Gets the local timestamps. More...
 
const CommunicationTimestampsremoteTimestamps () const
 Gets the remote timestamps. More...
 
utils::TimeSpan duration () const
 Gets the duration of the complete cycle. More...
 
int64_t localDuration () const
 Gets the local duration. More...
 
int64_t remoteDuration () const
 Gets the remote duration. More...
 
int64_t timeOffsetToRemote () const
 Gets the offset of the local node's network time relative to the remote node's network time. More...
 
bool operator< (const TimeSynchronizationSample &rhs) const
 Returns true if this time synchronization sample is less than rhs. More...
 
bool operator== (const TimeSynchronizationSample &rhs) const
 Returns true if this time synchronization sample is equal to rhs. More...
 
bool operator!= (const TimeSynchronizationSample &rhs) const
 Returns true if this time synchronization sample is not equal to rhs. More...
 

Private Attributes

ionet::Node m_node
 
CommunicationTimestamps m_localTimestamps
 
CommunicationTimestamps m_remoteTimestamps
 

Detailed Description

Represents a sample in the time synchronization process.

Constructor & Destructor Documentation

◆ TimeSynchronizationSample() [1/2]

catapult::timesync::TimeSynchronizationSample::TimeSynchronizationSample ( )

Creates a default time synchronization sample.

◆ TimeSynchronizationSample() [2/2]

catapult::timesync::TimeSynchronizationSample::TimeSynchronizationSample ( const ionet::Node node,
const CommunicationTimestamps localTimestamps,
const CommunicationTimestamps remoteTimestamps 
)
explicit

Creates a time synchronization sample around node, localTimestamps and remoteTimestamps. localTimestamps (remoteTimestamps) are the timestamps at which the local (remote) node sent and received a request and a response.

Member Function Documentation

◆ duration()

utils::TimeSpan catapult::timesync::TimeSynchronizationSample::duration ( ) const

Gets the duration of the complete cycle.

Here is the call graph for this function:

◆ localDuration()

int64_t catapult::timesync::TimeSynchronizationSample::localDuration ( ) const

Gets the local duration.

Here is the caller graph for this function:

◆ localTimestamps()

const CommunicationTimestamps & catapult::timesync::TimeSynchronizationSample::localTimestamps ( ) const

Gets the local timestamps.

◆ node()

const ionet::Node & catapult::timesync::TimeSynchronizationSample::node ( ) const

Gets the node.

◆ operator!=()

bool catapult::timesync::TimeSynchronizationSample::operator!= ( const TimeSynchronizationSample rhs) const

Returns true if this time synchronization sample is not equal to rhs.

◆ operator<()

bool catapult::timesync::TimeSynchronizationSample::operator< ( const TimeSynchronizationSample rhs) const

Returns true if this time synchronization sample is less than rhs.

Here is the call graph for this function:

◆ operator==()

bool catapult::timesync::TimeSynchronizationSample::operator== ( const TimeSynchronizationSample rhs) const

Returns true if this time synchronization sample is equal to rhs.

◆ remoteDuration()

int64_t catapult::timesync::TimeSynchronizationSample::remoteDuration ( ) const

Gets the remote duration.

Here is the caller graph for this function:

◆ remoteTimestamps()

const CommunicationTimestamps & catapult::timesync::TimeSynchronizationSample::remoteTimestamps ( ) const

Gets the remote timestamps.

◆ timeOffsetToRemote()

int64_t catapult::timesync::TimeSynchronizationSample::timeOffsetToRemote ( ) const

Gets the offset of the local node's network time relative to the remote node's network time.

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

Member Data Documentation

◆ m_localTimestamps

CommunicationTimestamps catapult::timesync::TimeSynchronizationSample::m_localTimestamps
private

◆ m_node

ionet::Node catapult::timesync::TimeSynchronizationSample::m_node
private

◆ m_remoteTimestamps

CommunicationTimestamps catapult::timesync::TimeSynchronizationSample::m_remoteTimestamps
private

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