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

Time synchronization state. More...

Public Member Functions

 TimeSynchronizationState (uint64_t clockAdjustmentThreshold)
 
TimeOffset offset () const
 Gets the offset. More...
 
uint64_t absoluteOffset () const
 Gets the absolute value of the current offset. More...
 
TimeOffsetDirection offsetDirection () const
 Gets the offset direction. More...
 
NodeAge nodeAge () const
 Gets the node age. More...
 
Timestamp networkTime () const
 Gets the network time. More...
 
void update (TimeOffset offset)
 Updates the current offset using offset. More...
 

Private Attributes

uint64_t m_clockAdjustmentThreshold
 
std::atomic< int64_t > m_offset
 
std::atomic< int64_t > m_nodeAge
 

Detailed Description

Time synchronization state.

Constructor & Destructor Documentation

◆ TimeSynchronizationState()

catapult::timesync::TimeSynchronizationState::TimeSynchronizationState ( uint64_t  clockAdjustmentThreshold)
explicit

Creates a time synchronization state that only updates internal offset values when magnitude of change is greater than clockAdjustmentThreshold.

Member Function Documentation

◆ absoluteOffset()

uint64_t catapult::timesync::TimeSynchronizationState::absoluteOffset ( ) const

Gets the absolute value of the current offset.

◆ networkTime()

Timestamp catapult::timesync::TimeSynchronizationState::networkTime ( ) const

Gets the network time.

Here is the call graph for this function:

◆ nodeAge()

NodeAge catapult::timesync::TimeSynchronizationState::nodeAge ( ) const

Gets the node age.

Here is the caller graph for this function:

◆ offset()

TimeOffset catapult::timesync::TimeSynchronizationState::offset ( ) const

Gets the offset.

Here is the caller graph for this function:

◆ offsetDirection()

TimeOffsetDirection catapult::timesync::TimeSynchronizationState::offsetDirection ( ) const

Gets the offset direction.

◆ update()

void catapult::timesync::TimeSynchronizationState::update ( TimeOffset  offset)

Updates the current offset using offset.

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

Member Data Documentation

◆ m_clockAdjustmentThreshold

uint64_t catapult::timesync::TimeSynchronizationState::m_clockAdjustmentThreshold
private

◆ m_nodeAge

std::atomic<int64_t> catapult::timesync::TimeSynchronizationState::m_nodeAge
private

◆ m_offset

std::atomic<int64_t> catapult::timesync::TimeSynchronizationState::m_offset
private

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