Wludzik, Jozef | cb88cfd | 2020-09-28 16:38:57 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <boost/asio/io_context.hpp> |
| 4 | #include <sdbusplus/asio/object_server.hpp> |
| 5 | |
| 6 | #include <chrono> |
| 7 | #include <memory> |
| 8 | |
| 9 | using Readings = std::tuple< |
| 10 | uint64_t, |
| 11 | std::vector<std::tuple<std::string, std::string, double, uint64_t>>>; |
| 12 | using ReadingParameters = |
| 13 | std::vector<std::tuple<std::vector<sdbusplus::message::object_path>, |
| 14 | std::string, std::string, std::string>>; |
| 15 | |
| 16 | class ReportManager; |
| 17 | |
| 18 | class Report |
| 19 | { |
| 20 | public: |
| 21 | Report(boost::asio::io_context& ioc, |
| 22 | const std::shared_ptr<sdbusplus::asio::object_server>& objServer, |
| 23 | const std::string& name, const std::string& reportingType, |
| 24 | const bool emitsReadingsSignal, |
| 25 | const bool logToMetricReportsCollection, |
| 26 | const std::chrono::milliseconds period, |
| 27 | const ReadingParameters& metricParams, ReportManager& reportManager); |
| 28 | ~Report() = default; |
| 29 | |
| 30 | Report(Report&) = delete; |
| 31 | Report(Report&&) = delete; |
| 32 | Report& operator=(Report&) = delete; |
| 33 | Report& operator=(Report&&) = delete; |
| 34 | |
| 35 | const std::string name; |
| 36 | const std::string path; |
| 37 | |
| 38 | private: |
| 39 | std::chrono::milliseconds interval; |
| 40 | std::shared_ptr<sdbusplus::asio::object_server> objServer; |
| 41 | std::unique_ptr<sdbusplus::asio::dbus_interface> reportIface; |
| 42 | std::unique_ptr<sdbusplus::asio::dbus_interface> deleteIface; |
| 43 | }; |