1 #pragma once 2 3 #include "interfaces/report_factory.hpp" 4 #include "interfaces/sensor.hpp" 5 #include "sensor_cache.hpp" 6 #include "types/sensor_types.hpp" 7 8 #include <boost/asio/io_context.hpp> 9 #include <sdbusplus/asio/object_server.hpp> 10 11 class ReportFactory : public interfaces::ReportFactory 12 { 13 public: 14 ReportFactory( 15 std::shared_ptr<sdbusplus::asio::connection> bus, 16 const std::shared_ptr<sdbusplus::asio::object_server>& objServer, 17 SensorCache& sensorCache); 18 19 std::vector<LabeledMetricParameters> convertMetricParams( 20 boost::asio::yield_context& yield, 21 const ReadingParameters& metricParams) const override; 22 23 std::unique_ptr<interfaces::Report> 24 make(const std::string& reportId, const std::string& name, 25 const ReportingType reportingType, 26 const std::vector<ReportAction>& reportActions, 27 Milliseconds period, uint64_t appendLimitIn, 28 const ReportUpdates reportUpdatesIn, 29 interfaces::ReportManager& reportManager, 30 interfaces::JsonStorage& reportStorage, 31 std::vector<LabeledMetricParameters> labeledMetricParams, 32 bool enabled) const override; 33 34 private: 35 Sensors getSensors(const std::vector<LabeledSensorInfo>& sensorPaths) const; 36 37 std::shared_ptr<sdbusplus::asio::connection> bus; 38 std::shared_ptr<sdbusplus::asio::object_server> objServer; 39 SensorCache& sensorCache; 40 }; 41