7 #ifndef MPD_BASE_BANDWIDTH_ESTIMATOR_H_ 8 #define MPD_BASE_BANDWIDTH_ESTIMATOR_H_ 26 void AddBlock(uint64_t size,
double duration);
47 explicit SlidingQueue(
size_t window_size);
50 void Add(
double value);
53 double sum()
const {
return sum_; }
55 double size()
const {
return size_; }
57 double min()
const {
return min_.front(); }
60 SlidingQueue(
const SlidingQueue&) =
delete;
61 SlidingQueue& operator=(
const SlidingQueue&) =
delete;
63 const size_t window_size_;
68 std::deque<double> window_;
78 std::deque<double> min_;
80 SlidingQueue sliding_queue_;
85 #endif // MPD_BASE_BANDWIDTH_ESTIMATOR_H_ static constexpr size_t kUseAllBlocks
All the methods that are virtual are virtual for mocking.
void AddBlock(uint64_t size, double duration)
uint64_t Estimate() const