10 #ifndef __RD_EQUALITYQUERY_H__ 11 #define __RD_EQUALITYQUERY_H__ 20 template <
typename MatchFuncArgType,
typename DataFuncArgType=MatchFuncArgType,
21 bool needsConversion=
false>
44 const MatchFuncArgType
getVal()
const {
return this->
d_val; };
49 const MatchFuncArgType
getTol()
const {
return this->
d_tol; };
51 virtual bool Match(
const DataFuncArgType what)
const {
83 std::ostringstream res;
85 res<<
" "<<this->
d_val;
bool getNegation() const
returns whether or not we are negated
int queryCmp(const T1 v1, const T2 v2, const T1 tol)
const std::string & getDescription() const
returns our text description
std::string getFullDescription() const
returns a fuller text description
void setNegation(bool what)
sets whether or not we are negated
void setTol(MatchFuncArgType what)
sets our tolerance
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what ...
virtual bool Match(const DataFuncArgType what) const
returns whether or not we match the argument
const MatchFuncArgType getVal() const
returns our target value
void setVal(MatchFuncArgType what)
sets our target value
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
class to allow integer values to pick templates
EqualityQuery(MatchFuncArgType v, MatchFuncArgType t)
constructs with our target value and a tolerance
MatchFuncArgType(* d_dataFunc)(DataFuncArgType)
a Query implementing ==: arguments must match a particular value (within an optional tolerance) ...
void setDataFunc(MatchFuncArgType(*what)(DataFuncArgType))
sets our data function
std::string d_description
Base class for all queries.
EqualityQuery(MatchFuncArgType v)
constructs with our target value
const MatchFuncArgType getTol() const
returns out tolerance