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

A time synchronizer that synchronizes local time with the network. More...

Collaboration diagram for catapult::timesync::TimeSynchronizer:

Public Member Functions

 TimeSynchronizer (const filters::AggregateSynchronizationFilter &filter, Importance totalChainImportance, int64_t warningThresholdMillis=Warning_Threshold_Millis)
 Creates a time synchronizer around filter, totalChainImportance and warningThresholdMillis. More...
 
TimeOffset calculateTimeOffset (const cache::AccountStateCacheView &accountStateCacheView, Height height, TimeSynchronizationSamples &&samples, NodeAge nodeAge)
 Calculates a time offset from samples using accountStateCacheView, height and nodeAge. More...
 

Private Member Functions

Importance::ValueType sumImportances (const cache::ImportanceView &importanceView, Height height, const TimeSynchronizationSamples &samples)
 
double sumScaledOffsets (const cache::ImportanceView &importanceView, Height height, const TimeSynchronizationSamples &samples, double scaling)
 

Private Attributes

filters::AggregateSynchronizationFilter m_filter
 
Importance m_totalChainImportance
 
int64_t m_warningThresholdMillis
 

Detailed Description

A time synchronizer that synchronizes local time with the network.

Constructor & Destructor Documentation

◆ TimeSynchronizer()

catapult::timesync::TimeSynchronizer::TimeSynchronizer ( const filters::AggregateSynchronizationFilter filter,
Importance  totalChainImportance,
int64_t  warningThresholdMillis = Warning_Threshold_Millis 
)
explicit

Creates a time synchronizer around filter, totalChainImportance and warningThresholdMillis.

Member Function Documentation

◆ calculateTimeOffset()

TimeOffset catapult::timesync::TimeSynchronizer::calculateTimeOffset ( const cache::AccountStateCacheView accountStateCacheView,
Height  height,
TimeSynchronizationSamples &&  samples,
NodeAge  nodeAge 
)

Calculates a time offset from samples using accountStateCacheView, height and nodeAge.

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

◆ sumImportances()

Importance::ValueType catapult::timesync::TimeSynchronizer::sumImportances ( const cache::ImportanceView importanceView,
Height  height,
const TimeSynchronizationSamples samples 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sumScaledOffsets()

double catapult::timesync::TimeSynchronizer::sumScaledOffsets ( const cache::ImportanceView importanceView,
Height  height,
const TimeSynchronizationSamples samples,
double  scaling 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_filter

filters::AggregateSynchronizationFilter catapult::timesync::TimeSynchronizer::m_filter
private

◆ m_totalChainImportance

Importance catapult::timesync::TimeSynchronizer::m_totalChainImportance
private

◆ m_warningThresholdMillis

int64_t catapult::timesync::TimeSynchronizer::m_warningThresholdMillis
private

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