blob: ca653a1d0f4a56f336da1d8ba1e300583bbb0d87 [file] [log] [blame]
Krzysztof Grobelny80697712021-03-04 09:49:27 +00001#pragma once
2
Krzysztof Grobelny51f0fd52021-12-28 16:32:08 +01003#include "types/duration_types.hpp"
Krzysztof Grobelny80697712021-03-04 09:49:27 +00004#include "types/operation_type.hpp"
5
6#include <cstdint>
7#include <memory>
8#include <utility>
9#include <vector>
10
11namespace details
12{
13
Krzysztof Grobelny51f0fd52021-12-28 16:32:08 +010014using ReadingItem = std::pair<Milliseconds, double>;
Krzysztof Grobelny80697712021-03-04 09:49:27 +000015
16class CollectionFunction
17{
18 public:
19 virtual ~CollectionFunction() = default;
20
Krzysztof Grobelny51f0fd52021-12-28 16:32:08 +010021 virtual double calculate(const std::vector<ReadingItem>& readings,
22 Milliseconds timestamp) const = 0;
23 virtual double
Krzysztof Grobelny80697712021-03-04 09:49:27 +000024 calculateForStartupInterval(std::vector<ReadingItem>& readings,
Krzysztof Grobelny51f0fd52021-12-28 16:32:08 +010025 Milliseconds timestamp) const = 0;
Krzysztof Grobelny80697712021-03-04 09:49:27 +000026};
27
28std::shared_ptr<CollectionFunction> makeCollectionFunction(OperationType);
29
30} // namespace details