#pragma once #include "interfaces/trigger_types.hpp" #include #include #include class TriggerParams { public: TriggerParams& name(std::string val) { nameProperty = std::move(val); return *this; } const std::string& name() const { return nameProperty; } bool isDiscrete() const { return discreteProperty; } bool logToJournal() const { return logToJournalProperty; } bool logToRedfish() const { return logToRedfishProperty; } bool updateReport() const { return updateReportProperty; } const std::vector>& sensors() const { return sensorsProperty; } const std::vector& reportNames() const { return reportNamesProperty; } const TriggerThresholdParams& thresholdParams() const { return thresholdsProperty; } private: std::string nameProperty = "Trigger1"; bool discreteProperty = false; bool logToJournalProperty = false; bool logToRedfishProperty = false; bool updateReportProperty = false; std::vector> sensorsProperty = { {sdbusplus::message::object_path( "/xyz/openbmc_project/sensors/temperature/BMC_Temp"), ""}}; std::vector reportNamesProperty = {"Report1"}; TriggerThresholdParams thresholdsProperty = std::vector{ {static_cast(numeric::Type::lowerCritical), std::chrono::milliseconds(10).count(), static_cast(numeric::Direction::decreasing), 0.0}, {static_cast(numeric::Type::upperCritical), std::chrono::milliseconds(10).count(), static_cast(numeric::Direction::increasing), 90.0}}; };