control: Add Modifier utility
Create a Modifier utility class that provides a doOp() function that can
modify a value based on the JSON config passed to its constructor.
With the JSON:
{
"operator": "minus",
"value": 3
}
doOp() will subtract 3 from the passed in value.
The only currently supported expression is 'minus'.
This will be used by future actions to read a D-Bus property, subtract
some configurable value from it, and store it in the Manager's
parameter store.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I31d9800f83e52a927a2061a9a896da9c19d35809
diff --git a/control/Makefile.am b/control/Makefile.am
index aca9c5c..d78ec47 100644
--- a/control/Makefile.am
+++ b/control/Makefile.am
@@ -70,7 +70,8 @@
json/actions/net_target_increase.cpp \
json/actions/net_target_decrease.cpp \
json/actions/timer_based_actions.cpp \
- json/actions/mapped_floor.cpp
+ json/actions/mapped_floor.cpp \
+ json/utils/modifier.cpp
else
phosphor_fan_control_SOURCES += \
argument.cpp \