#include "IVComparison.hxx" #include #include OA_EXCEPTION(MethodNotImplemented,COMET::EoaCore); bool COMET::IVComparison::operator()(double lhs,double rhs){ throw MethodNotImplemented(); return false; } bool COMET::IVComparison::operator()(const std::string& lhs,const std::string& rhs){ throw MethodNotImplemented(); return false; } struct EqualTo:public COMET::IVComparison{ bool operator()(double lhs,double rhs){return lhs==rhs;} bool operator()(const std::string& lhs,const std::string& rhs){return lhs==rhs;} }; struct LessThan:public COMET::IVComparison{ bool operator()(double lhs,double rhs){return lhsrhs;} using IVComparison::operator(); }; struct LessEqual:public COMET::IVComparison{ bool operator()(double lhs,double rhs){return lhs<=rhs;} using IVComparison::operator(); }; struct GreaterEqual:public COMET::IVComparison{ bool operator()(double lhs,double rhs){return lhs>=rhs;} using IVComparison::operator(); }; COMET::IVComparison* COMET::IVComparison::Make(const std::string& name){ if(name=="=="){ return new EqualTo; }else if(name==">="){ return new GreaterEqual; }else if(name==">"){ return new GreaterThan; }else if(name=="<="){ return new LessEqual; }else if(name=="<"){ return new LessThan; } else{ COMETError("Unknown comparison: '"<