blob: 0503c534753ff89701931b7f7884bbbb964d1ebf [file] [log] [blame]
Matthew Barth38a93a82017-05-11 14:12:27 -05001#pragma once
2
3namespace phosphor
4{
5namespace fan
6{
7namespace control
8{
9namespace handler
10{
11
12/**
13 * @brief A handler function to set/update a property
14 * @details Sets or updates a property's value determined by a combination of
15 * an object's path and property names
16 *
17 * @param[in] path - Object's path name
18 * @param[in] property - Object's property name
19 *
20 * @return Lambda function
21 * A lambda function to set/update the property value
22 */
23template <typename T>
24auto setProperty(const char* path, const char* property)
25{
26 return [=](auto& zone, T&& arg)
27 {
28 zone.setPropertyValue(path, property, std::forward<T>(arg));
29 };
30}
31
32} // namespace handler
33} // namespace control
34} // namespace fan
35} // namespace phosphor