#ifndef __maskOperation_hpp__ #define __maskOperation_hpp__ #include "types.hpp" #include "dictionary.hpp" namespace pFlow { template struct greaterThanOp { TypeInfoNV("greaterThan"); inline bool operator()(const T &compVal, const T &val) const { return val > compVal; } }; template struct greaterThanEqOp { TypeInfoNV("greaterThanEq"); inline bool operator()(const T &compVal, const T &val) const { return val >= compVal; } }; template struct lessThanOp { TypeInfoNV("lessThan"); inline bool operator()(const T &compVal, const T &val) const { return val < compVal; } }; template struct lessThanEqOp { TypeInfoNV("lessThanEq"); inline bool operator()(const T &compVal, const T &val) const { return val <= compVal; } }; template struct equalOp { TypeInfoNV("equal"); inline bool operator()(const T &compVal, const T &val) const { return equal(val , compVal); } }; template struct betweenOp { TypeInfoNV("between"); inline bool operator()(const T &compVal1, const T &compVal2 ,const T &val) const { return val>compVal1 && val struct betweenEqOp { TypeInfoNV("betweenEq"); inline bool operator()(const T &compVal1, const T &compVal2 ,const T &val) const { return val>=compVal1 && val<=compVal2; } }; template struct allOp { TypeInfoNV("all"); inline bool operator()() const {return true; } }; template class Operator> class compareOne { public: using opertorType = Operator; protected: T compValue_{}; opertorType operator_{}; public: TypeInfoNV(Operator::TYPENAME()); compareOne(const dictionary& dict) : compValue_(dict.getVal("value")) {} bool operator()(const T& value)const { return operator_(compValue_, value); } }; template class Operator> class compareTwo { public: using opertorType = Operator; protected: T compValue1_; T compValue2_; opertorType operator_{}; public: TypeInfoNV(opertorType::TYPENAME()); compareTwo(const dictionary& dict) : compValue1_(dict.getVal("value1")), compValue2_(dict.getVal("value2")) {} bool operator()(const T& value)const { return operator_(compValue1_, compValue2_, value); } }; template class compareZero { protected: Operator operator_{}; public: TypeInfoNV(Operator::TYPENAME()); compareZero(const dictionary& dict); bool operator()(const T& value) const { return operator_(); } }; } #endif //__maskOperation_hpp__