summaryrefslogtreecommitdiffstats
path: root/monitor/conditions.hpp
blob: 76aa0de9f3e5d46de35c0be82bd2aaa8b378c03a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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