1 #pragma once 2 3 #include "interfaces/report.hpp" 4 #include "interfaces/report_factory.hpp" 5 #include "interfaces/report_manager.hpp" 6 7 #include <sdbusplus/asio/object_server.hpp> 8 9 #include <chrono> 10 #include <memory> 11 #include <vector> 12 13 class ReportManager : public interfaces::ReportManager 14 { 15 public: 16 ReportManager( 17 std::unique_ptr<interfaces::ReportFactory> reportFactory, 18 const std::shared_ptr<sdbusplus::asio::object_server>& objServer); 19 ~ReportManager() = default; 20 21 ReportManager(ReportManager&) = delete; 22 ReportManager(ReportManager&&) = delete; 23 ReportManager& operator=(ReportManager&) = delete; 24 ReportManager& operator=(ReportManager&&) = delete; 25 26 void removeReport(const interfaces::Report* report) override; 27 static bool verifyScanPeriod(const uint64_t scanPeriod); 28 29 private: 30 std::unique_ptr<interfaces::ReportFactory> reportFactory; 31 std::shared_ptr<sdbusplus::asio::object_server> objServer; 32 std::unique_ptr<sdbusplus::asio::dbus_interface> reportManagerIface; 33 std::vector<std::unique_ptr<interfaces::Report>> reports; 34 35 public: 36 static constexpr uint32_t maxReports{20}; 37 static constexpr std::chrono::milliseconds minInterval{1000}; 38 static constexpr const char* reportManagerIfaceName = 39 "xyz.openbmc_project.Telemetry.ReportManager"; 40 static constexpr const char* reportManagerPath = 41 "/xyz/openbmc_project/Telemetry/Reports"; 42 }; 43