11 #ifndef RD_QUERYATOM_H
12 #define RD_QUERYATOM_H
52 dp_query = other.dp_query->
copy();
64 dp_query = other.dp_query->
copy();
72 dp_query = std::exchange(other.dp_query,
nullptr);
79 dp_query = std::exchange(other.dp_query,
nullptr);
89 bool hasQuery()
const override {
return dp_query !=
nullptr; }
92 std::string
getQueryType()
const override {
return dp_query->getTypeLabel(); }
121 bool maintainOrder =
true)
override;
136 std::string res =
"";
138 for (
unsigned int i = 0; i < depth; ++i) {
144 res +=
qhelper((*ci).get(), depth + 1);
152 std::string res =
"";
Defines the Atom class and associated typedefs.
#define PRECONDITION(expr, mess)
Pulls in all the query types.
Base class for all queries.
virtual std::string getFullDescription() const
returns a fuller text description
CHILD_VECT_CI endChildren() const
returns an iterator for the end of our child vector
CHILD_VECT_CI beginChildren() const
returns an iterator for the beginning of our child vector
virtual Query< MatchFuncArgType, DataFuncArgType, needsConversion > * copy() const
returns a copy of this Query
typename CHILD_VECT::const_iterator CHILD_VECT_CI
The class for representing atoms.
Atom & operator=(const Atom &other)
unsigned int getNumRadicalElectrons() const
returns the number of radical electrons for this Atom
virtual QUERYATOM_QUERY * getQuery() const
NOT CALLABLE.
virtual bool hasQuery() const
int getFormalCharge() const
returns the formal charge of this atom
unsigned int getIsotope() const
returns our isotope number
Class for storing atomic queries.
bool hasQuery() const override
bool QueryMatch(QueryAtom const *what) const
returns true if our query details match those of QueryAtom what
QUERYATOM_QUERY * getQuery() const override
returns our current query
void setQuery(QUERYATOM_QUERY *what) override
replaces our current query with the value passed in
QueryAtom(QueryAtom &&other) noexcept
Atom * copy() const override
returns a copy of this query, owned by the caller
bool Match(Atom const *what) const override
returns true if we match Atom what
Queries::Query< int, Atom const *, true > QUERYATOM_QUERY
QueryAtom & operator=(const QueryAtom &other)
QueryAtom(const QueryAtom &other)
QueryAtom(const Atom &other)
void expandQuery(QUERYATOM_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true) override
expands our current query
std::string getQueryType() const override
replaces our current query with the value passed in
QueryAtom & operator=(QueryAtom &&other) noexcept
#define RDKIT_GRAPHMOL_EXPORT
std::string qhelper(Atom::QUERYATOM_QUERY *q, unsigned int depth)
T * makeAtomFormalChargeQuery(int what, const std::string &descr)
returns a Query for matching formal charge
std::string describeQuery(const Atom *atom)
T * makeAtomIsotopeQuery(int what, const std::string &descr)
returns a Query for matching atoms with a particular isotope
T * makeAtomNumQuery(int what, const std::string &descr)
returns a Query for matching atomic number
T * makeAtomNumRadicalElectronsQuery(int what, const std::string &descr)
returns a Query for matching the number of radical electrons