![]() |
RDKit
Open-source cheminformatics and machine learning.
|
Base class for all queries. More...
#include <Query.h>
Public Types | |
typedef boost::shared_ptr< Query< MatchFuncArgType, DataFuncArgType, needsConversion > > | CHILD_TYPE |
typedef std::vector< CHILD_TYPE > | CHILD_VECT |
typedef CHILD_VECT::iterator | CHILD_VECT_I |
typedef CHILD_VECT::const_iterator | CHILD_VECT_CI |
Public Member Functions | |
Query () | |
virtual | ~Query () |
void | setNegation (bool what) |
sets whether or not we are negated More... | |
bool | getNegation () const |
returns whether or not we are negated More... | |
void | setDescription (const std::string &descr) |
sets our text description More... | |
void | setDescription (const char *descr) |
const std::string & | getDescription () const |
returns our text description More... | |
virtual std::string | getFullDescription () const |
returns a fuller text description More... | |
void | setMatchFunc (bool(*what)(MatchFuncArgType)) |
sets our match function More... | |
void | setDataFunc (MatchFuncArgType(*what)(DataFuncArgType)) |
sets our data function More... | |
void | addChild (CHILD_TYPE child) |
adds a child to our list of children More... | |
CHILD_VECT_CI | beginChildren () const |
returns an iterator for the beginning of our child vector More... | |
CHILD_VECT_CI | endChildren () const |
returns an iterator for the end of our child vector More... | |
virtual bool | Match (const DataFuncArgType arg) const |
returns whether or not we match the argument More... | |
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * | copy () const |
returns a copy of this Query More... | |
Public Attributes | |
bool(*)(MatchFuncArgType) | getMatchFunc () const |
returns our match function: More... | |
MatchFuncArgType(*)(DataFuncArgType) | getDataFunc () const |
returns our data function: More... | |
Protected Member Functions | |
MatchFuncArgType | TypeConvert (MatchFuncArgType what, Int2Type< false >) const |
calls our dataFunc (if it's set) on what and returns the result, otherwise returns what More... | |
MatchFuncArgType | TypeConvert (DataFuncArgType what, Int2Type< true >) const |
calls our dataFunc (which must be set) on what and returns the result More... | |
Protected Attributes | |
std::string | d_description |
CHILD_VECT | d_children |
bool | df_negate |
bool(* | d_matchFunc )(MatchFuncArgType) |
MatchFuncArgType(* | d_dataFunc )(DataFuncArgType) |
Base class for all queries.
Query objects have one or two functions associated with them:
bool matchFunc(MatchFuncArgType other)
returns true or false to indicate whether this query matches other
. This is mandatory.MatchFuncArgType dataFunc(DataFuncArgType other)
converts the argument other
from DataFuncArgType
to MatchFuncArgType
. This is optional if DataFuncArgType
is the same as (or implicitly convertible to) MatchFuncArgType
. typedef boost::shared_ptr< Query<MatchFuncArgType, DataFuncArgType, needsConversion> > Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_TYPE |
typedef std::vector< CHILD_TYPE > Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT |
typedef CHILD_VECT::const_iterator Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT_CI |
typedef CHILD_VECT::iterator Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT_I |
|
inline |
|
inlinevirtual |
|
inline |
adds a child to our list of children
Definition at line 86 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and Queries::Query< int, TargetPtr, needsConversion >::copy().
|
inline |
returns an iterator for the beginning of our child vector
Definition at line 88 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
|
inlinevirtual |
returns a copy of this Query
Notes:
delete
ing the result Reimplemented in RDKit::HasPropWithValueQuery< TargetPtr, std::string >, RDKit::HasPropWithValueQuery< TargetPtr, T >, RDKit::HasPropQuery< TargetPtr >, RDKit::RecursiveStructureQuery, RDKit::AtomRingQuery, Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< int, ConstAtomPtr, true >, Queries::EqualityQuery< int, TargetPtr, true >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< int, Atom const *, true >, Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, and Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >.
Definition at line 109 of file Query.h.
Referenced by Queries::Query< int, TargetPtr, needsConversion >::copy(), and RDKit::QueryAtom::QueryAtom().
|
inline |
returns an iterator for the end of our child vector
Definition at line 90 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
|
inline |
returns our text description
Definition at line 67 of file Query.h.
Referenced by Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::SetQuery< int, Atom const *, true >::getFullDescription(), Queries::EqualityQuery< int, TargetPtr, true >::getFullDescription(), and Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription().
|
inlinevirtual |
returns a fuller text description
Reimplemented in Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< int, ConstAtomPtr, true >, Queries::EqualityQuery< int, TargetPtr, true >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< int, Atom const *, true >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, and Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >.
|
inline |
returns whether or not we are negated
Definition at line 60 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, TargetPtr, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::SetQuery< int, Atom const *, true >::getFullDescription(), Queries::EqualityQuery< int, TargetPtr, true >::getFullDescription(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::getFullDescription(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::SetQuery< int, Atom const *, true >::Match(), Queries::EqualityQuery< int, TargetPtr, true >::Match(), and Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
|
inlinevirtual |
returns whether or not we match the argument
Reimplemented in RDKit::HasPropWithValueQuery< TargetPtr, std::string >, RDKit::HasPropWithValueQuery< TargetPtr, T >, RDKit::HasPropQuery< TargetPtr >, Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< int, ConstAtomPtr, true >, Queries::EqualityQuery< int, TargetPtr, true >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< int, Atom const *, true >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, and Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >.
|
inline |
sets our data function
Definition at line 81 of file Query.h.
Referenced by Queries::SetQuery< int, Atom const *, true >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, TargetPtr, true >::copy(), and Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
inline |
|
inline |
|
inline |
|
inline |
sets whether or not we are negated
Definition at line 58 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, TargetPtr, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), RDKit::AtomRingQuery::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::HasPropQuery< TargetPtr >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, T >::copy(), and RDKit::HasPropWithValueQuery< TargetPtr, std::string >::copy().
|
inlineprotected |
calls our dataFunc
(if it's set) on what
and returns the result, otherwise returns what
Definition at line 134 of file Query.h.
Referenced by Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match(), Queries::SetQuery< int, Atom const *, true >::Match(), Queries::EqualityQuery< int, TargetPtr, true >::Match(), and Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::Match().
|
inlineprotected |
|
protected |
|
protected |
Definition at line 130 of file Query.h.
Referenced by Queries::SetQuery< int, Atom const *, true >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, TargetPtr, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::Query< int, TargetPtr, needsConversion >::copy(), and RDKit::AtomRingQuery::copy().
|
protected |
Definition at line 123 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< int, Atom const *, true >::copy(), Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< int, TargetPtr, true >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::Query< int, TargetPtr, needsConversion >::copy(), RDKit::AtomRingQuery::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::HasPropQuery< TargetPtr >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, T >::copy(), and RDKit::HasPropWithValueQuery< TargetPtr, std::string >::copy().
|
protected |
Definition at line 129 of file Query.h.
Referenced by Queries::Query< int, TargetPtr, needsConversion >::copy().
|
protected |
Definition at line 128 of file Query.h.
Referenced by Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::AndQuery(), Queries::Query< int, TargetPtr, needsConversion >::copy(), Queries::EqualityQuery< int, TargetPtr, true >::EqualityQuery(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::GreaterEqualQuery(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::GreaterQuery(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::LessEqualQuery(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::LessQuery(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::OrQuery(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::RangeQuery(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::XOrQuery().
|
inline |
|
inline |