1 #pragma once 2 3 namespace phosphor 4 { 5 namespace fan 6 { 7 namespace control 8 { 9 namespace 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] interface - Object's interface name 19 * @param[in] property - Object's property name 20 * 21 * @return Lambda function 22 * A lambda function to set/update the property value 23 */ 24 template <typename T> 25 auto setProperty(const char* path, const char* interface, const char* property) 26 { 27 return [=](auto& zone, T&& arg) 28 { 29 zone.setPropertyValue(path, interface, property, std::forward<T>(arg)); 30 }; 31 } 32 33 } // namespace handler 34 } // namespace control 35 } // namespace fan 36 } // namespace phosphor 37