blob: 4cc138e48e0dd77ae0998fe0795a661aed5a16b9 [file] [log] [blame]
Krzysztof Grobelny64b75a52020-09-18 10:17:16 +02001#pragma once
2
Wludzik, Jozefe2362792020-10-27 17:23:55 +01003#include "persistent_json_storage.hpp"
Wludzik, Jozef2f9f9b82020-10-13 09:07:45 +02004#include "report_factory.hpp"
Krzysztof Grobelny64b75a52020-09-18 10:17:16 +02005#include "report_manager.hpp"
Krzysztof Grobelny6ccfcbf2020-11-04 09:31:36 +01006#include "sensor_cache.hpp"
Krzysztof Grobelny64b75a52020-09-18 10:17:16 +02007
8#include <sdbusplus/asio/connection.hpp>
9#include <sdbusplus/asio/object_server.hpp>
10
11#include <memory>
12
13class Telemetry
14{
15 public:
16 Telemetry(std::shared_ptr<sdbusplus::asio::connection> bus) :
17 objServer(std::make_shared<sdbusplus::asio::object_server>(bus)),
Wludzik, Jozefe2362792020-10-27 17:23:55 +010018 reportManager(std::make_unique<ReportFactory>(bus, objServer),
19 std::make_unique<PersistentJsonStorage>(
20 interfaces::JsonStorage::DirectoryPath(
21 "/var/lib/telemetry/Reports")),
22 objServer)
Krzysztof Grobelny64b75a52020-09-18 10:17:16 +020023 {}
24
25 private:
26 std::shared_ptr<sdbusplus::asio::object_server> objServer;
27 ReportManager reportManager;
28};