blob: 2427b76d90b2e026dd00ab450fbef8f7fccab5ee [file] [log] [blame]
#pragma once
#include "interfaces/report.hpp"
#include "interfaces/report_factory.hpp"
#include "interfaces/report_manager.hpp"
#include <sdbusplus/asio/object_server.hpp>
#include <chrono>
#include <memory>
#include <vector>
class ReportManager : public interfaces::ReportManager
{
public:
ReportManager(
std::unique_ptr<interfaces::ReportFactory> reportFactory,
const std::shared_ptr<sdbusplus::asio::object_server>& objServer);
~ReportManager() = default;
ReportManager(ReportManager&) = delete;
ReportManager(ReportManager&&) = delete;
ReportManager& operator=(ReportManager&) = delete;
ReportManager& operator=(ReportManager&&) = delete;
void removeReport(const interfaces::Report* report) override;
static bool verifyScanPeriod(const uint64_t scanPeriod);
private:
std::unique_ptr<interfaces::ReportFactory> reportFactory;
std::shared_ptr<sdbusplus::asio::object_server> objServer;
std::unique_ptr<sdbusplus::asio::dbus_interface> reportManagerIface;
std::vector<std::unique_ptr<interfaces::Report>> reports;
public:
static constexpr uint32_t maxReports{20};
static constexpr std::chrono::milliseconds minInterval{1000};
static constexpr const char* reportManagerIfaceName =
"xyz.openbmc_project.Telemetry.ReportManager";
static constexpr const char* reportManagerPath =
"/xyz/openbmc_project/Telemetry/Reports";
};