CatapultServer  v0.5.0.1 (Elephant)
AggregateSynchronizationFilter.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "SynchronizationFilters.h"
23 #include "filter_constants.h"
24 #include <vector>
25 
26 namespace catapult { namespace timesync { namespace filters {
27 
30  public:
32  explicit AggregateSynchronizationFilter(const std::vector<SynchronizationFilter>& filters);
33 
34  public:
36  size_t size() const;
37 
38  public:
40  void operator()(TimeSynchronizationSamples& samples, NodeAge nodeAge);
41 
42  private:
43  std::vector<SynchronizationFilter> m_filters;
44  };
45 }}}
catapult::utils::BaseValue
Immutable wrapper for basic types, to provide some type-safety.
Definition: BaseValue.h:100
catapult::timesync::filters::Alpha
constexpr double Alpha
Value that indicates the percentage of the samples is discarded.
Definition: filter_constants.h:40
catapult::timesync::filters::AggregateSynchronizationFilter::m_filters
std::vector< SynchronizationFilter > m_filters
Definition: AggregateSynchronizationFilter.h:43
catapult::timesync::filters::AggregateSynchronizationFilter
Aggregate synchronization filter.
Definition: AggregateSynchronizationFilter.h:29
catapult::timesync::TimeSynchronizationSamples
std::set< TimeSynchronizationSample > TimeSynchronizationSamples
A set of time synchronization samples.
Definition: TimeSynchronizationSample.h:83
catapult::utils::map_erase_if
void map_erase_if(TMap &map, TPredicate predicate)
Removes all entries from map that fulfill the given predicate.
Definition: ContainerHelpers.h:27
catapult::timesync::filters::AggregateSynchronizationFilter::AggregateSynchronizationFilter
AggregateSynchronizationFilter(const std::vector< SynchronizationFilter > &filters)
Creates an aggregate synchronization filter around filters.
Definition: AggregateSynchronizationFilter.cpp:27
catapult::timesync::filters::AggregateSynchronizationFilter::size
size_t size() const
Gets the number of filters.
Definition: AggregateSynchronizationFilter.cpp:31
filter_constants.h
AggregateSynchronizationFilter.h
catapult
Definition: AddressExtractionExtension.cpp:28
SynchronizationFilters.h
catapult::timesync::filters::AggregateSynchronizationFilter::operator()
void operator()(TimeSynchronizationSamples &samples, NodeAge nodeAge)
Filters samples according to nodeAge.
Definition: AggregateSynchronizationFilter.cpp:35
ContainerHelpers.h