 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef __RD_EQUALITYQUERY_H__
12 #define __RD_EQUALITYQUERY_H__
20 template <
typename MatchFuncArgType,
21 typename DataFuncArgType = MatchFuncArgType,
22 bool needsConversion =
false>
24 :
public Query<MatchFuncArgType, DataFuncArgType, needsConversion> {
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 {
52 MatchFuncArgType mfArg =
82 std::ostringstream res;
84 res <<
" " << this->
d_val;
void setVal(MatchFuncArgType what)
sets our target value
EqualityQuery(MatchFuncArgType v)
constructs with our target value
void setNegation(bool what)
sets whether or not we are negated
int queryCmp(const T1 v1, const T2 v2, const T1 tol)
MatchFuncArgType(* d_dataFunc)(MatchFuncArgType)
std::string getFullDescription() const
EqualityQuery(MatchFuncArgType v, MatchFuncArgType t)
constructs with our target value and a tolerance
virtual bool Match(const DataFuncArgType what) const
std::string d_description
void setDataFunc(MatchFuncArgType(*what)(MatchFuncArgType))
sets our data function
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
bool getNegation() const
returns whether or not we are negated
class to allow integer values to pick templates
const MatchFuncArgType getTol() const
returns out tolerance
const MatchFuncArgType getVal() const
returns our target value
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what
void setTol(MatchFuncArgType what)
sets our tolerance
Base class for all queries.
const std::string & getDescription() const
returns our text description
a Query implementing ==: arguments must match a particular value (within an optional tolerance)