blob: 0a45decb0ef499ea71f601269817f6216572c7c9 [file] [log] [blame]
Wludzik, Jozef76833cb2020-12-21 14:42:41 +01001#include "trigger_factory.hpp"
2
3#include "trigger.hpp"
4
5TriggerFactory::TriggerFactory(
6 std::shared_ptr<sdbusplus::asio::connection> bus,
7 std::shared_ptr<sdbusplus::asio::object_server> objServer) :
8 bus(std::move(bus)),
9 objServer(std::move(objServer))
10{}
11
12std::unique_ptr<interfaces::Trigger> TriggerFactory::make(
13 const std::string& name, bool isDiscrete, bool logToJournal,
14 bool logToRedfish, bool updateReport,
15 const std::vector<std::pair<sdbusplus::message::object_path, std::string>>&
16 sensors,
17 const std::vector<std::string>& reportNames,
18 const TriggerThresholdParams& thresholdParams,
19 interfaces::TriggerManager& reportManager) const
20{
21 return std::make_unique<Trigger>(bus->get_io_context(), objServer, name,
22 isDiscrete, logToJournal, logToRedfish,
23 updateReport, sensors, reportNames,
24 thresholdParams, reportManager);
25}