Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Wludzik, Jozef | d960e1f | 2021-01-08 09:25:59 +0100 | [diff] [blame^] | 3 | #include "interfaces/report_manager.hpp" |
Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 4 | #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 | |
| 12 | class 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 | }; |