#ifndef MDD_MODULEMATH_H #define MDD_MODULEMATH_H #include "ModuleBase.h" namespace mdd { enum MathOperation { ADD = 1, SUBTRACT = 2, MULTIPLY = 3, DIVIDE = 4, POWER = 5, LOGARITHM = 6, MINIMUM = 7, MAXIMUM = 8, LESS_THAN = 9, GREATER_THAN = 10 }; class ModuleMath : public ModuleBase { private: MathOperation _operation; static json add(const json &val1, const json &val2); static json subtract(const json &val1, const json &val2); static json multiply(const json &val1, const json &val2); static json divide(const json &val1, const json &val2); static json power(const json &val1, const json &val2); static json logarithm(const json &val1, const json &val2); static json minimum(const json &val1, const json &val2); static json maximum(const json &val1, const json &val2); static json less(const json &val1, const json &val2); static json greater(const json &val1, const json &val2); public: explicit ModuleMath(MathOperation operation = ADD); bool update() override; void setMathOperation(MathOperation operation); MathOperation getMathOperation(); }; } #endif