blob: b84ce73a2f37ab1a5d7f4933e0ecc97088489f9a [file] [log] [blame]
Wludzik, Jozef76833cb2020-12-21 14:42:41 +01001#pragma once
2
Cezary Zwolaka4e67612021-02-18 13:16:16 +01003#include "interfaces/json_storage.hpp"
Wludzik, Jozef76833cb2020-12-21 14:42:41 +01004#include "interfaces/trigger.hpp"
5#include "interfaces/trigger_manager.hpp"
6#include "interfaces/trigger_types.hpp"
7
Wludzik, Jozef1477fe62021-01-02 11:56:10 +01008#include <boost/asio/spawn.hpp>
Wludzik, Jozefd960e1f2021-01-08 09:25:59 +01009#include <sdbusplus/message/types.hpp>
Wludzik, Jozef1477fe62021-01-02 11:56:10 +010010
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010011#include <memory>
12#include <utility>
13
14namespace interfaces
15{
16
17class TriggerFactory
18{
19 public:
20 virtual ~TriggerFactory() = default;
21
22 virtual std::unique_ptr<interfaces::Trigger> make(
Cezary Zwolak4416fce2021-03-17 03:21:06 +010023 const std::string& name, bool isDiscrete, bool logToJournal,
24 bool logToRedfish, bool updateReport,
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010025 const std::vector<std::string>& reportNames,
Cezary Zwolaka4e67612021-02-18 13:16:16 +010026 interfaces::TriggerManager& triggerManager,
Cezary Zwolak4416fce2021-03-17 03:21:06 +010027 interfaces::JsonStorage& triggerStorage,
28 const LabeledTriggerThresholdParams& labeledThresholdParams,
29 const std::vector<LabeledSensorInfo>& labeledSensorsInfo) const = 0;
30
31 virtual std::vector<LabeledSensorInfo>
32 getLabeledSensorsInfo(boost::asio::yield_context& yield,
33 const SensorsInfo& sensorsInfo) const = 0;
Wludzik, Jozef76833cb2020-12-21 14:42:41 +010034};
35
36} // namespace interfaces