blob: 41257eb4542b3ee371f9b6187cbd10658e94c5e3 [file] [log] [blame]
Wludzik, Jozef76833cb2020-12-21 14:42:41 +01001#pragma once
2
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +01003#include "interfaces/report_manager.hpp"
Wludzik, Jozef76833cb2020-12-21 14:42:41 +01004#include "interfaces/trigger_factory.hpp"
5#include "interfaces/trigger_manager.hpp"
6
7#include <sdbusplus/asio/object_server.hpp>
8
9#include <memory>
10#include <vector>
11
12class TriggerManager : public interfaces::TriggerManager
13{
14 public:
15 TriggerManager(
16 std::unique_ptr<interfaces::TriggerFactory> triggerFactory,
17 const std::shared_ptr<sdbusplus::asio::object_server>& objServer);
18
19 TriggerManager(TriggerManager&) = delete;
20 TriggerManager(TriggerManager&&) = delete;
21 TriggerManager& operator=(TriggerManager&) = delete;
22 TriggerManager& operator=(TriggerManager&&) = delete;
23
24 void removeTrigger(const interfaces::Trigger* trigger) override;
25
26 private:
27 std::unique_ptr<interfaces::TriggerFactory> triggerFactory;
28 std::unique_ptr<sdbusplus::asio::dbus_interface> managerIface;
29 std::vector<std::unique_ptr<interfaces::Trigger>> triggers;
30
31 public:
32 static constexpr size_t maxTriggers{TELEMETRY_MAX_TRIGGERS};
33 static constexpr const char* triggerManagerIfaceName =
34 "xyz.openbmc_project.Telemetry.TriggerManager";
35 static constexpr const char* triggerManagerPath =
36 "/xyz/openbmc_project/Telemetry/Triggers";
37};