![]() |
RDKit
Open-source cheminformatics and machine learning.
|
Base class for all queries. More...
#include <Query.h>
Public Types | |
| using | CHILD_TYPE = std::shared_ptr< Query< MatchFuncArgType, DataFuncArgType, needsConversion > > |
| using | CHILD_VECT = std::vector< CHILD_TYPE > |
| using | CHILD_VECT_I = typename CHILD_VECT::iterator |
| using | CHILD_VECT_CI = typename CHILD_VECT::const_iterator |
| using | MATCH_FUNC_ARG_TYPE = MatchFuncArgType |
| using | DATA_FUNC_ARG_TYPE = DataFuncArgType |
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) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| const std::string & | getDescription () const |
| returns our text description More... | |
| virtual std::string | getFullDescription () const |
| returns a fuller text description More... | |
| void | setTypeLabel (const std::string &typ) |
| sets our type label More... | |
| void | setTypeLabel (const char *typ) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| const std::string & | getTypeLabel () const |
| returns our text label. 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 |
Protected Attributes | |
| MatchFuncArgType | d_val = 0 |
| MatchFuncArgType | d_tol = 0 |
| std::string | d_description = "" |
| std::string | d_queryType = "" |
| CHILD_VECT | d_children |
| bool | df_negate {false} |
| bool(* | d_matchFunc )(MatchFuncArgType) |
| union { | |
| MatchFuncArgType(* d_dataFunc )(DataFuncArgType) | |
| MatchFuncArgType(* d_dataFuncSameType )(MatchFuncArgType) | |
| }; | |
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. | using Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_TYPE = std::shared_ptr< Query<MatchFuncArgType, DataFuncArgType, needsConversion> > |
| using Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT = std::vector<CHILD_TYPE> |
| using Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT_CI = typename CHILD_VECT::const_iterator |
| using Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::CHILD_VECT_I = typename CHILD_VECT::iterator |
| using Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::DATA_FUNC_ARG_TYPE = DataFuncArgType |
| using Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::MATCH_FUNC_ARG_TYPE = MatchFuncArgType |
|
inline |
|
inlinevirtual |
|
inline |
adds a child to our list of children
Definition at line 103 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
inline |
returns an iterator for the beginning of our child vector
Definition at line 105 of file Query.h.
Referenced by RDKit::detail::qhelper().
|
inlinevirtual |
returns a copy of this Query
Notes:
deleteing the result Reimplemented in RDKit::AtomRingQuery, RDKit::RecursiveStructureQuery, RDKit::HasPropQuery< TargetPtr >, RDKit::HasPropWithValueQuery< TargetPtr, T >, RDKit::HasPropWithValueQuery< TargetPtr, std::string >, RDKit::HasPropWithValueQuery< TargetPtr, ExplicitBitVect >, Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, MatchFuncArgType, false >, Queries::EqualityQuery< int, ConstAtomPtr, true >, Queries::EqualityQuery< int, TargetPtr, true >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< int, Atom const *, true >, and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >.
Definition at line 131 of file Query.h.
References Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::addChild(), Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_dataFunc, Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_description, Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_matchFunc, Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_queryType, Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_tol, Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_val, and Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::df_negate.
Referenced by RDKit::QueryAtom::operator=(), RDKit::QueryAtom::QueryAtom(), and RDKit::QueryBond::QueryBond().
|
inline |
returns an iterator for the end of our child vector
Definition at line 107 of file Query.h.
Referenced by RDKit::detail::qhelper().
|
inline |
|
inlinevirtual |
returns a fuller text description
Reimplemented in Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::EqualityQuery< MatchFuncArgType, MatchFuncArgType, false >, Queries::EqualityQuery< int, ConstAtomPtr, true >, Queries::EqualityQuery< int, TargetPtr, true >, Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >, and Queries::SetQuery< int, Atom const *, true >.
Definition at line 72 of file Query.h.
Referenced by RDKit::detail::qhelper().
|
inline |
|
inline |
|
inlinevirtual |
returns whether or not we match the argument
Reimplemented in Queries::SetQuery< int, Atom const *, true >, Queries::EqualityQuery< int, ConstAtomPtr, true >, Queries::EqualityQuery< MatchFuncArgType, MatchFuncArgType, false >, RDKit::HasPropQuery< TargetPtr >, RDKit::HasPropWithValueQuery< TargetPtr, T >, RDKit::HasPropWithValueQuery< TargetPtr, std::string >, RDKit::HasPropWithValueQuery< TargetPtr, ExplicitBitVect >, and Queries::EqualityQuery< int, TargetPtr, true >.
|
inline |
sets our data function
Definition at line 94 of file Query.h.
Referenced by Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and RDKit::makeAtomRangeQuery().
|
inline |
|
inline |
sets our text description
Definition at line 64 of file Query.h.
Referenced by RDKit::makeAtomRangeQuery().
|
inline |
|
inline |
sets whether or not we are negated
Definition at line 59 of file Query.h.
Referenced by RDKit::AtomRingQuery::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::HasPropQuery< TargetPtr >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, T >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, std::string >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, ExplicitBitVect >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
inline |
|
inline |
|
inlineprotected |
calls our dataFunc (which must be set) on what and returns the result
Definition at line 182 of file Query.h.
References PRECONDITION.
|
inlineprotected |
| union { ... } Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::@8 |
|
protected |
| MatchFuncArgType(* Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_dataFunc) (DataFuncArgType) |
Definition at line 164 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and RDKit::AtomRingQuery::copy().
| MatchFuncArgType(* Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::d_dataFuncSameType) (MatchFuncArgType) |
|
protected |
Definition at line 152 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), RDKit::AtomRingQuery::copy(), RDKit::RecursiveStructureQuery::copy(), RDKit::HasPropQuery< TargetPtr >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, T >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, std::string >::copy(), RDKit::HasPropWithValueQuery< TargetPtr, ExplicitBitVect >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
protected |
Definition at line 156 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
protected |
Definition at line 153 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::AndQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::EqualityQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::GreaterQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessEqualQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::LessQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::OrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::RangeQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), Queries::SetQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy(), and Queries::XOrQuery< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
protected |
Definition at line 151 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
protected |
Definition at line 150 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
protected |
Definition at line 155 of file Query.h.
Referenced by Queries::Query< MatchFuncArgType, DataFuncArgType, needsConversion >::copy().
|
inline |
|
inline |