Add PerformanceLoss threshold checking

This xyz.openbmc_project.Sensor.Threshold.PerformanceLoss interface will
be checked along with the other threshold interfaces.  It can be used to
indicate the system will suffer a performance loss when the sensor goes
above/below the high/low threshold values.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I855aaf6ea550e672bf52af5631533049269934d1
diff --git a/thresholds.hpp b/thresholds.hpp
index e53e496..b01d86d 100644
--- a/thresholds.hpp
+++ b/thresholds.hpp
@@ -2,6 +2,7 @@
 
 #include <xyz/openbmc_project/Sensor/Threshold/Critical/server.hpp>
 #include <xyz/openbmc_project/Sensor/Threshold/HardShutdown/server.hpp>
+#include <xyz/openbmc_project/Sensor/Threshold/PerformanceLoss/server.hpp>
 #include <xyz/openbmc_project/Sensor/Threshold/SoftShutdown/server.hpp>
 #include <xyz/openbmc_project/Sensor/Threshold/Warning/server.hpp>
 
@@ -17,6 +18,7 @@
 using WarningObject = ServerObject<threshold_ns::Warning>;
 using SoftShutdownObject = ServerObject<threshold_ns::SoftShutdown>;
 using HardShutdownObject = ServerObject<threshold_ns::HardShutdown>;
+using PerformanceLossObject = ServerObject<threshold_ns::PerformanceLoss>;
 
 template <typename T>
 struct Threshold;
@@ -133,4 +135,32 @@
     }
 };
 
+template <>
+struct Threshold<PerformanceLossObject> : public PerformanceLossObject
+{
+    static constexpr auto name = "PerformanceLoss";
+    using PerformanceLossObject::PerformanceLossObject;
+
+    auto high()
+    {
+        return performanceLossHigh();
+    }
+    auto low()
+    {
+        return performanceLossLow();
+    }
+
+    template <typename... Args>
+    auto alarmHigh(Args... args)
+    {
+        return performanceLossAlarmHigh(std::forward<Args>(args)...);
+    }
+
+    template <typename... Args>
+    auto alarmLow(Args... args)
+    {
+        return performanceLossAlarmLow(std::forward<Args>(args)...);
+    }
+};
+
 } // namespace phosphor::virtualSensor