control: Add 'less_than' modifier
This modifier allows one to return a value from a table based on if the
value passed to it is less than the table key value.
For example:
"modifier": {
"operator": "less_than",
"value": [
{
"arg_value": 30,
"parameter_value": 300
},
{
"arg_value": 40,
"parameter_value": 400
},
{
"arg_value": 50,
"parameter_value": 500
}
]
}
With the above config, it would do the following:
* value less than 30: return 300
* else if value less than 40: return 400
* else if value less than 50: return 500
* else: return a default value based on data type of parameter_value
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I8b47341f41723c0cdf1ee2786526550fc24551f9
diff --git a/control/json/utils/modifier.hpp b/control/json/utils/modifier.hpp
index 3f59246..6153279 100644
--- a/control/json/utils/modifier.hpp
+++ b/control/json/utils/modifier.hpp
@@ -42,6 +42,7 @@
*
* The valid operators are:
* - "minus"
+ * - "less_than"
*
* To add a new operator, derive a new class from BaseOperator and
* then create it accordingly in setOperator.
@@ -103,13 +104,6 @@
*/
void setOperator(const json& jsonObj);
- /**
- * @brief Subtracts _value from value
- *
- * @param[in] value - The value to subtract from
- */
- PropertyVariantType minus(const PropertyVariantType& value);
-
/** @brief The value used by the operator */
PropertyVariantType _value;