blob: 27e4ee79ed12b2347a7767473e6f37a2cff7b48a [file] [log] [blame]
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +02001#include "report_factory.hpp"
2
3#include "report.hpp"
4
5ReportFactory::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
12std::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 Grobelnyc8e3a642020-10-23 12:29:16 +020018 std::vector<std::shared_ptr<interfaces::Metric>> metrics;
19
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020020 return std::make_unique<Report>(
21 ioc, objServer, name, reportingType, emitsReadingsSignal,
Krzysztof Grobelnyc8e3a642020-10-23 12:29:16 +020022 logToMetricReportsCollection, period, metricParams, reportManager,
23 std::move(metrics));
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +020024}