1 #pragma once 2 3 #include "persistent_json_storage.hpp" 4 #include "report_factory.hpp" 5 #include "report_manager.hpp" 6 #include "sensor_cache.hpp" 7 8 #include <sdbusplus/asio/connection.hpp> 9 #include <sdbusplus/asio/object_server.hpp> 10 11 #include <memory> 12 13 class Telemetry 14 { 15 public: 16 Telemetry(std::shared_ptr<sdbusplus::asio::connection> bus) : 17 objServer(std::make_shared<sdbusplus::asio::object_server>(bus)), 18 reportManager(std::make_unique<ReportFactory>(bus, objServer), 19 std::make_unique<PersistentJsonStorage>( 20 interfaces::JsonStorage::DirectoryPath( 21 "/var/lib/telemetry/Reports")), 22 objServer) 23 {} 24 25 private: 26 std::shared_ptr<sdbusplus::asio::object_server> objServer; 27 ReportManager reportManager; 28 }; 29