blob: 76aa0de9f3e5d46de35c0be82bd2aaa8b378c03a [file] [log] [blame]
Matthew Barth81748b12018-05-02 16:03:48 -05001#pragma once
2
3#include "types.hpp"
4
5namespace phosphor
6{
7namespace fan
8{
9namespace monitor
10{
11
12/**
13 * @brief Create a condition function object
14 *
15 * @param[in] condition - The condition being created
16 *
17 * @return - The created condition function object
18 */
19template <typename T>
20auto make_condition(T&& condition)
21{
22 return Condition(std::forward<T>(condition));
23}
24
25namespace condition
26{
27
28/**
29 * @brief A condition that checks all properties match the given values
30 * @details Checks each property entry against its given value where all
31 * property values must match their given value for the condition to pass
32 *
33 * @param[in] propStates - List of property identifiers and their value
34 *
35 * @return Condition lambda function
36 * A Condition function that checks all properties match
37 */
38Condition propertiesMatch(std::vector<PropertyState>&& propStates);
39
40} // namespace condition
41} // namespace monitor
42} // namespace fan
43} // namespace phosphor