Krzysztof Grobelny | 8069771 | 2021-03-04 09:49:27 +0000 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "types/operation_type.hpp" |
| 4 | |
| 5 | #include <cstdint> |
| 6 | #include <memory> |
| 7 | #include <utility> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace details |
| 11 | { |
| 12 | |
| 13 | using ReadingItem = std::pair<uint64_t, double>; |
| 14 | |
| 15 | class CollectionFunction |
| 16 | { |
| 17 | public: |
| 18 | virtual ~CollectionFunction() = default; |
| 19 | |
| 20 | virtual ReadingItem calculate(const std::vector<ReadingItem>& readings, |
| 21 | uint64_t timestamp) const = 0; |
| 22 | virtual ReadingItem |
| 23 | calculateForStartupInterval(std::vector<ReadingItem>& readings, |
| 24 | uint64_t timestamp) const = 0; |
| 25 | }; |
| 26 | |
| 27 | std::shared_ptr<CollectionFunction> makeCollectionFunction(OperationType); |
| 28 | |
| 29 | } // namespace details |