 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
11 #ifndef __RD_QUERY_H__
12 #define __RD_QUERY_H__
15 #pragma warning(disable : 4800) // warning: converting things to bool
20 #include <boost/smart_ptr.hpp>
44 template <
class MatchFuncArgType,
class DataFuncArgType = MatchFuncArgType,
45 bool needsConversion =
false>
48 typedef boost::shared_ptr<
108 virtual bool Match(
const DataFuncArgType arg)
const {
114 tRes =
static_cast<bool>(mfArg);
165 MatchFuncArgType mfArg;
167 std::is_same<MatchFuncArgType, DataFuncArgType>::value) {
179 MatchFuncArgType mfArg;
190 template <
class T1,
class T2>
191 int queryCmp(
const T1 v1,
const T2 v2,
const T1 tol) {
void setMatchFunc(bool(*what)(MatchFuncArgType))
sets our match function
CHILD_VECT::const_iterator CHILD_VECT_CI
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
virtual bool Match(const DataFuncArgType arg) const
returns whether or not we match the argument
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)(DataFuncArgType)
boost::shared_ptr< Query< MatchFuncArgType, DataFuncArgType, needsConversion > > CHILD_TYPE
MatchFuncArgType TypeConvert(DataFuncArgType what, Int2Type< true >) const
calls our dataFunc (which must be set) on what and returns the
MatchFuncArgType(*)(DataFuncArgType) getDataFunc() const
returns our data function:
bool(* d_matchFunc)(MatchFuncArgType)
bool(*)(MatchFuncArgType) getMatchFunc() const
returns our match function:
void setDescription(const char *descr)
This is an overloaded member function, provided for convenience. It differs from the above function o...
std::string d_description
void setDataFunc(MatchFuncArgType(*what)(DataFuncArgType))
sets our data function
void addChild(CHILD_TYPE child)
adds a child to our list of children
bool getNegation() const
returns whether or not we are negated
class to allow integer values to pick templates
CHILD_VECT_CI endChildren() const
returns an iterator for the end of our child vector
virtual std::string getFullDescription() const
returns a fuller text description
CHILD_VECT_CI beginChildren() const
returns an iterator for the beginning of our child vector
MatchFuncArgType TypeConvert(MatchFuncArgType what, Int2Type< false >) const
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what
std::vector< CHILD_TYPE > CHILD_VECT
#define PRECONDITION(expr, mess)
Base class for all queries.
const std::string & getDescription() const
returns our text description
CHILD_VECT::iterator CHILD_VECT_I
void setDescription(const std::string &descr)
sets our text description
MatchFuncArgType(* d_dataFuncSameType)(MatchFuncArgType)