Krzysztof Grobelny | 64b75a5 | 2020-09-18 10:17:16 +0200 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Wludzik, Jozef | e236279 | 2020-10-27 17:23:55 +0100 | [diff] [blame^] | 3 | #include "persistent_json_storage.hpp" |
Wludzik, Jozef | 2f9f9b8 | 2020-10-13 09:07:45 +0200 | [diff] [blame] | 4 | #include "report_factory.hpp" |
Krzysztof Grobelny | 64b75a5 | 2020-09-18 10:17:16 +0200 | [diff] [blame] | 5 | #include "report_manager.hpp" |
| 6 | |
| 7 | #include <sdbusplus/asio/connection.hpp> |
| 8 | #include <sdbusplus/asio/object_server.hpp> |
| 9 | |
| 10 | #include <memory> |
| 11 | |
| 12 | class Telemetry |
| 13 | { |
| 14 | public: |
| 15 | Telemetry(std::shared_ptr<sdbusplus::asio::connection> bus) : |
| 16 | objServer(std::make_shared<sdbusplus::asio::object_server>(bus)), |
Wludzik, Jozef | e236279 | 2020-10-27 17:23:55 +0100 | [diff] [blame^] | 17 | reportManager(std::make_unique<ReportFactory>(bus, objServer), |
| 18 | std::make_unique<PersistentJsonStorage>( |
| 19 | interfaces::JsonStorage::DirectoryPath( |
| 20 | "/var/lib/telemetry/Reports")), |
| 21 | objServer) |
Krzysztof Grobelny | 64b75a5 | 2020-09-18 10:17:16 +0200 | [diff] [blame] | 22 | {} |
| 23 | |
| 24 | private: |
| 25 | std::shared_ptr<sdbusplus::asio::object_server> objServer; |
| 26 | ReportManager reportManager; |
| 27 | }; |