Add Report interface to dbus
Added AddReport method to ReportManager to allow dbus user
to create new Report. Added Report object with Report and Delete
interfaces.
Tested:
- Verified that telemetry service works in romulus
- Added and removed report from ReportManager collection
Change-Id: Ib20cfda1f0e27ef20b60e66d52c3d11f31f61a96
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
diff --git a/src/report_manager.hpp b/src/report_manager.hpp
index c01c34a..177a03c 100644
--- a/src/report_manager.hpp
+++ b/src/report_manager.hpp
@@ -1,5 +1,7 @@
#pragma once
+#include "report.hpp"
+
#include <sdbusplus/asio/object_server.hpp>
#include <chrono>
@@ -10,16 +12,24 @@
{
public:
ReportManager(
+ const std::shared_ptr<sdbusplus::asio::connection>& bus,
const std::shared_ptr<sdbusplus::asio::object_server>& objServer);
- ~ReportManager();
+ ~ReportManager() = default;
- ReportManager(const ReportManager&) = delete;
- ReportManager& operator=(const ReportManager&) = delete;
+ ReportManager(ReportManager&) = delete;
+ ReportManager(ReportManager&&) = delete;
+ ReportManager& operator=(ReportManager&) = delete;
+ ReportManager& operator=(ReportManager&&) = delete;
+
+ static bool verifyScanPeriod(const uint64_t scanPeriod);
+ void removeReport(const Report* report);
private:
std::shared_ptr<sdbusplus::asio::object_server> objServer;
- std::shared_ptr<sdbusplus::asio::dbus_interface> reportManagerIntf;
+ std::unique_ptr<sdbusplus::asio::dbus_interface> reportManagerIface;
+ std::vector<std::unique_ptr<Report>> reports;
+ public:
static constexpr uint32_t maxReports{20};
static constexpr std::chrono::milliseconds minInterval{1000};
};