blob: 7f74d49182c6e1b7b44e53eb8f97c8aeaa1f76e7 [file] [log] [blame]
Wludzik, Jozefcb88cfd2020-09-28 16:38:57 +02001#pragma once
2
3#include <boost/asio/io_context.hpp>
4#include <sdbusplus/asio/object_server.hpp>
5
6#include <chrono>
7#include <memory>
8
9using Readings = std::tuple<
10 uint64_t,
11 std::vector<std::tuple<std::string, std::string, double, uint64_t>>>;
12using ReadingParameters =
13 std::vector<std::tuple<std::vector<sdbusplus::message::object_path>,
14 std::string, std::string, std::string>>;
15
16class ReportManager;
17
18class Report
19{
20 public:
21 Report(boost::asio::io_context& ioc,
22 const std::shared_ptr<sdbusplus::asio::object_server>& objServer,
23 const std::string& name, const std::string& reportingType,
24 const bool emitsReadingsSignal,
25 const bool logToMetricReportsCollection,
26 const std::chrono::milliseconds period,
27 const ReadingParameters& metricParams, ReportManager& reportManager);
28 ~Report() = default;
29
30 Report(Report&) = delete;
31 Report(Report&&) = delete;
32 Report& operator=(Report&) = delete;
33 Report& operator=(Report&&) = delete;
34
35 const std::string name;
36 const std::string path;
37
38 private:
39 std::chrono::milliseconds interval;
40 std::shared_ptr<sdbusplus::asio::object_server> objServer;
41 std::unique_ptr<sdbusplus::asio::dbus_interface> reportIface;
42 std::unique_ptr<sdbusplus::asio::dbus_interface> deleteIface;
43};