Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __RD_LESSQUERY_H__
00011 #define __RD_LESSQUERY_H__
00012 #include "Query.h"
00013 #include "EqualityQuery.h"
00014
00015 namespace Queries {
00016
00017
00018 template <class MatchFuncArgType, class DataFuncArgType=MatchFuncArgType,
00019 bool needsConversion=false>
00020 class LessQuery :
00021 public EqualityQuery<MatchFuncArgType, DataFuncArgType,needsConversion> {
00022
00023 public:
00024 LessQuery() { this->d_tol = 0;};
00025
00026 explicit LessQuery(DataFuncArgType v) {
00027 this->d_val = v;
00028 this->d_tol = 0;
00029 this->df_negate = false;
00030 };
00031
00032 LessQuery(DataFuncArgType v,DataFuncArgType t) {
00033 this->d_val = v;
00034 this->d_tol = t;
00035 this->df_negate = false;
00036 };
00037
00038 bool Match(const DataFuncArgType what) const {
00039 MatchFuncArgType mfArg = this->TypeConvert(what,Int2Type<needsConversion>());
00040 if( queryCmp(this->d_val,mfArg,this->d_tol) < 0 ){
00041 if( this->getNegation() ) return false;
00042 else return true;
00043 } else {
00044 if( this->getNegation() ) return true;
00045 else return false;
00046 }
00047 };
00048
00049 Query<MatchFuncArgType,DataFuncArgType,needsConversion> *
00050 copy( ) const {
00051 LessQuery<MatchFuncArgType,DataFuncArgType,needsConversion> *res =
00052 new LessQuery<MatchFuncArgType,DataFuncArgType,needsConversion>();
00053 res->setNegation(this->getNegation());
00054 res->setVal(this->d_val);
00055 res->setTol(this->d_tol);
00056 res->setDataFunc(this->d_dataFunc);
00057 res->d_description = this->d_description;
00058 return res;
00059 };
00060
00061 };
00062
00063 }
00064 #endif