Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 1 | #include "report_factory.hpp" |
| 2 | |
| 3 | #include "report.hpp" |
| 4 | |
| 5 | ReportFactory::ReportFactory( |
| 6 | boost::asio::io_context& ioc, |
| 7 | const std::shared_ptr<sdbusplus::asio::object_server>& objServer) : |
| 8 | ioc(ioc), |
| 9 | objServer(objServer) |
| 10 | {} |
| 11 | |
| 12 | std::unique_ptr<interfaces::Report> ReportFactory::make( |
| 13 | const std::string& name, const std::string& reportingType, |
| 14 | bool emitsReadingsSignal, bool logToMetricReportsCollection, |
| 15 | std::chrono::milliseconds period, const ReadingParameters& metricParams, |
| 16 | interfaces::ReportManager& reportManager) const |
| 17 | { |
Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame^] | 18 | std::vector<std::shared_ptr<interfaces::Metric>> metrics; |
| 19 | |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 20 | return std::make_unique<Report>( |
| 21 | ioc, objServer, name, reportingType, emitsReadingsSignal, |
Krzysztof Grobelny | c8e3a64 | 2020-10-23 12:29:16 +0200 | [diff] [blame^] | 22 | logToMetricReportsCollection, period, metricParams, reportManager, |
| 23 | std::move(metrics)); |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 24 | } |