21 #include <boost/foreach.hpp> 27 typedef boost::shared_ptr<Atom>
ATOM_SPTR;
106 explicit Bond(BondType bT);
247 virtual void setQuery(QUERYBOND_QUERY *what);
249 virtual QUERYBOND_QUERY *
getQuery()
const;
253 QUERYBOND_QUERY *what,
255 bool maintainOrder =
true);
264 virtual bool Match(
Bond const *what)
const;
307 template <
typename T>
308 void setProp(
const char *key, T val,
bool computed =
false)
const {
310 std::string what(key);
314 template <
typename T>
315 void setProp(
const std::string &key, T val,
bool computed =
false)
const {
320 if (std::find(compLst.begin(), compLst.end(), key) == compLst.end()) {
321 compLst.push_back(key);
344 template <
typename T>
350 template <
typename T>
351 void getProp(
const std::string &key, T &res)
const {
357 template <
typename T>
362 template <
typename T>
370 template <
typename T>
375 template <
typename T>
400 std::string what(key);
407 STR_VECT_I svi = std::find(compLst.begin(), compLst.end(), key);
408 if (svi != compLst.end()) {
void setBeginAtomIdx(unsigned int what)
sets the index of our begin Atom
void setVal(const std::string &what, T &val)
Sets the value associated with a key.
BondStereo getStereo() const
returns our stereo code
virtual Bond * copy() const
returns a copy
STR_VECT getPropList() const
returns a list with the names of our properties
ROMol & getOwningMol() const
returns a reference to the ROMol that owns this Bond
double getBondTypeAsDouble() const
returns our bondType as a double (e.g. SINGLE->1.0, AROMATIC->1.5, etc.)
std::ostream & operator<<(std::ostream &target, const RDKit::Bond &b)
allows Bond objects to be dumped to streams
Atom * getEndAtom() const
returns a pointer to our end Atom
RWMol is a molecule class that is intended to be edited.
bool hasVal(const char *what) const
Returns whether or not the dictionary contains a particular key.
virtual bool hasQuery() const
bool hasProp(const std::string &key) const
bool df_isAromatic
sets our owning molecule
void clearComputedProps() const
clears all of our computed properties
Queries::Query< int, Bond const *, true > QUERYBOND_QUERY
boost::shared_ptr< Atom > ATOM_SPTR
virtual QUERYBOND_QUERY * getQuery() const
NOT CALLABLE.
void setProp(const char *key, T val, bool computed=false) const
sets a property value
BondStereo
the nature of the bond's stereochem (for cis/trans)
void getProp(const std::string &key, T &res) const
void clearProp(const char *key) const
clears the value of a property
void setIsConjugated(bool what)
sets our isConjugated flag
void setBondType(BondType bT)
sets our bondType
bool getValIfPresent(const std::string &what, T &res) const
Potentially gets the value associated with a particular key returns true on success/false on failure...
ROMol is a molecule class that is intended to have a fixed topology.
bool getPropIfPresent(const char *key, T &res) const
intentionally unspecified stereochemistry
standard two-electron dative
BondDir getBondDir() const
returns our direction
void getVal(const std::string &what, T &res) const
Gets the value associated with a particular key.
void clearVal(const std::string &what)
Clears the value associated with a particular key, removing the key from the dictionary.
void setIdx(unsigned int index)
sets our index within the ROMol
void setProp(const std::string &key, T val, bool computed=false) const
bool getIsAromatic() const
returns the status of our isAromatic flag
INT_VECT * dp_stereoAtoms
virtual void expandQuery(QUERYBOND_QUERY *what, Queries::CompositeQueryType how=Queries::COMPOSITE_AND, bool maintainOrder=true)
NOT CALLABLE.
bool getIsConjugated() const
returns the status of our isConjugated flag
Atom * getBeginAtom() const
returns a pointer to our begin Atom
std::vector< int > INT_VECT
double getValenceContrib(const Atom *at) const
returns our contribution to the explicit valence of an Atom
T getProp(const std::string &key) const
void setIsAromatic(bool what)
sets our isAromatic flag
T getProp(const char *key) const
bool hasProp(const char *key) const
returns whether or not we have a property with name key
boost::uint8_t d_bondType
unsigned int getOtherAtomIdx(unsigned int thisIdx) const
given the index of one Atom, returns the index of the other
unsigned int getEndAtomIdx() const
returns the index of our end Atom
Includes a bunch of functionality for handling Atom and Bond queries.
STR_VECT keys() const
Returns the set of keys in the dictionary.
void updatePropertyCache(bool strict=true)
calculates any of our lazy properties
const std::string computedPropName
INT_VECT & getStereoAtoms()
void setStereo(BondStereo what)
sets our stereo code
standard two-electron dative
class for representing a bond
void setOwningMol(ROMol *other)
sets our owning molecule
standard two-electron dative
void setBeginAtom(Atom *at)
sets our begin Atom
BondDir
the bond's direction (for chirality)
atomindex_t d_beginAtomIdx
void setEndAtomIdx(unsigned int what)
sets the index of our end Atom
Atom * getOtherAtom(Atom const *what) const
returns a pointer to the other Atom
unsigned int getBeginAtomIdx() const
returns the index of our begin Atom
void setOwningMol(ROMol &other)
sets our owning molecule
one-electron dative (e.g. from a C in a Cp ring to a metal)
#define PRECONDITION(expr, mess)
boost::uint16_t atomindex_t
BondType getBondType() const
returns our bondType
Bond & operator=(const Bond &other)
boost::shared_ptr< Bond > BOND_SPTR
Pulls in all the query types.
std::vector< std::string >::iterator STR_VECT_I
void setEndAtom(Atom *at)
sets our end Atom
const INT_VECT & getStereoAtoms() const
returns the indices of our stereo atoms
virtual bool Match(Bond const *what) const
returns whether or not we match the argument
void setBondDir(BondDir what)
sets our direction
Base class for all queries.
void getProp(const char *key, T &res) const
allows retrieval of a particular property value
unsigned int getIdx() const
returns our index within the ROMol
The Dict class can be used to store objects of arbitrary type keyed by strings.
void clearProp(const std::string &key) const
The class for representing atoms.
std::vector< std::string > STR_VECT
virtual void setQuery(QUERYBOND_QUERY *what)
NOT CALLABLE.
bool getPropIfPresent(const std::string &key, T &res) const