Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame^] | 1 | #include "trigger_factory.hpp" |
| 2 | |
| 3 | #include "trigger.hpp" |
| 4 | |
| 5 | TriggerFactory::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 | |
| 12 | std::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 | } |