summaryrefslogtreecommitdiffstats
path: root/monitor/conditions.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/conditions.hpp')
-rw-r--r--monitor/conditions.hpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/monitor/conditions.hpp b/monitor/conditions.hpp
new file mode 100644
index 0000000..76aa0de
--- /dev/null
+++ b/monitor/conditions.hpp
@@ -0,0 +1,43 @@
+#pragma once
+
+#include "types.hpp"
+
+namespace phosphor
+{
+namespace fan
+{
+namespace monitor
+{
+
+/**
+ * @brief Create a condition function object
+ *
+ * @param[in] condition - The condition being created
+ *
+ * @return - The created condition function object
+ */
+template <typename T>
+auto make_condition(T&& condition)
+{
+ return Condition(std::forward<T>(condition));
+}
+
+namespace condition
+{
+
+/**
+ * @brief A condition that checks all properties match the given values
+ * @details Checks each property entry against its given value where all
+ * property values must match their given value for the condition to pass
+ *
+ * @param[in] propStates - List of property identifiers and their value
+ *
+ * @return Condition lambda function
+ * A Condition function that checks all properties match
+ */
+Condition propertiesMatch(std::vector<PropertyState>&& propStates);
+
+} // namespace condition
+} // namespace monitor
+} // namespace fan
+} // namespace phosphor
OpenPOWER on IntegriCloud