RDKit
Open-source cheminformatics and machine learning.
RDKit::RDProps Class Reference

#include <RDProps.h>

Inheritance diagram for RDKit::RDProps:
RDKit::Atom RDKit::Bond RDKit::ROMol RDKit::QueryAtom RDKit::QueryBond RDKit::RWMol

Public Member Functions

 RDProps ()
 
 RDProps (const RDProps &rhs)
 
RDPropsoperator= (const RDProps &rhs)
 
void clear ()
 
STR_VECT getPropList (bool includePrivate=true, bool includeComputed=true) const
 returns a list with the names of our properties More...
 
template<typename T >
void setProp (const std::string &key, T val, bool computed=false) const
 sets a property value More...
 
template<typename T >
void getProp (const std::string &key, T &res) const
 allows retrieval of a particular property value More...
 
template<typename T >
getProp (const std::string &key) const
 
template<typename T >
bool getPropIfPresent (const std::string &key, T &res) const
 
bool hasProp (const std::string &key) const
 
void clearProp (const std::string &key) const
 clears the value of a property More...
 
void clearComputedProps () const
 clears all of our computed properties More...
 

Protected Attributes

Dict dp_props
 

Detailed Description

Definition at line 9 of file RDProps.h.

Constructor & Destructor Documentation

RDKit::RDProps::RDProps ( )
inline

Definition at line 17 of file RDProps.h.

RDKit::RDProps::RDProps ( const RDProps rhs)
inline

Definition at line 18 of file RDProps.h.

Member Function Documentation

void RDKit::RDProps::clear ( )
inline

Definition at line 23 of file RDProps.h.

References RDKit::Dict::reset().

void RDKit::RDProps::clearComputedProps ( ) const
inline

clears all of our computed properties

Definition at line 140 of file RDProps.h.

References RDKit::Dict::clearVal(), RDKit::detail::computedPropName, getPropIfPresent(), and RDKit::Dict::setVal().

Referenced by RDKit::ROMol::endConformers().

void RDKit::RDProps::clearProp ( const std::string &  key) const
inline

clears the value of a property

Notes:

  • if no property with name key exists, a KeyErrorException will be thrown.
  • if the property is marked as computed, it will also be removed from our list of computedPropertiesThis is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 127 of file RDProps.h.

References RDKit::Dict::clearVal(), RDKit::detail::computedPropName, getPropIfPresent(), and RDKit::Dict::setVal().

Referenced by RDKit::Atom::setAtomMapNum().

template<typename T >
void RDKit::RDProps::getProp ( const std::string &  key,
T &  res 
) const
inline

allows retrieval of a particular property value

Parameters
keythe name under which the property should be stored. If a property is already stored under this name, it will be replaced.
resa reference to the storage location for the value.

Notes:

  • if no property with name key exists, a KeyErrorException will be thrown.
  • the boost::lexical_cast machinery is used to attempt type conversions. If this fails, a boost::bad_lexical_cast exception will be thrown.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 95 of file RDProps.h.

References RDKit::Dict::getVal().

Referenced by RDKit::Drawing::detail::getAtomSymbolAndOrientation().

template<typename T >
T RDKit::RDProps::getProp ( const std::string &  key) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 101 of file RDProps.h.

References RDKit::Dict::getVal().

template<typename T >
bool RDKit::RDProps::getPropIfPresent ( const std::string &  key,
T &  res 
) const
inline

returns whether or not we have a property with name key and assigns the value if we do This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 109 of file RDProps.h.

References RDKit::Dict::getValIfPresent().

Referenced by clearComputedProps(), clearProp(), RDKit::Atom::getAtomMapNum(), getPropList(), and setProp().

STR_VECT RDKit::RDProps::getPropList ( bool  includePrivate = true,
bool  includeComputed = true 
) const
inline

returns a list with the names of our properties

Definition at line 32 of file RDProps.h.

References RDKit::detail::computedPropName, getPropIfPresent(), and RDKit::Dict::keys().

bool RDKit::RDProps::hasProp ( const std::string &  key) const
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 114 of file RDProps.h.

References RDKit::Dict::hasVal().

Referenced by RDKit::Drawing::detail::getAtomSymbolAndOrientation(), RDKit::queryAtomMissingChiralTag(), and RDKit::Atom::setAtomMapNum().

RDProps& RDKit::RDProps::operator= ( const RDProps rhs)
inline

Definition at line 19 of file RDProps.h.

References dp_props.

template<typename T >
void RDKit::RDProps::setProp ( const std::string &  key,
val,
bool  computed = false 
) const
inline

sets a property value

Parameters
keythe name under which the property should be stored. If a property is already stored under this name, it will be replaced.
valthe value to be stored
computed(optional) allows the property to be flagged computed.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 64 of file RDProps.h.

References RDKit::detail::computedPropName, getPropIfPresent(), and RDKit::Dict::setVal().

Referenced by RDKit::Atom::setAtomMapNum().

Member Data Documentation

Dict RDKit::RDProps::dp_props
mutableprotected

Definition at line 11 of file RDProps.h.

Referenced by RDKit::RWMol::clear(), and operator=().


The documentation for this class was generated from the following file: