16 #ifndef RD_MOLBUNDLE_AUG2017 17 #define RD_MOLBUNDLE_AUG2017 24 #include <boost/smart_ptr.hpp> 50 virtual const std::vector<boost::shared_ptr<ROMol> > &
getMols()
const {
57 virtual size_t addMol(boost::shared_ptr<ROMol> nmol) {
60 if (nmol->getNumAtoms() != d_mols[0]->getNumAtoms())
62 "all molecules in a bundle must have the same number of atoms");
64 if (nmol->getNumBonds() != d_mols[0]->getNumBonds())
66 "all molecules in a bundle must have the same number of bonds");
68 d_mols.push_back(nmol);
69 return (d_mols.size());
72 virtual size_t size()
const {
return d_mols.size(); };
74 virtual const boost::shared_ptr<ROMol>
getMol(
size_t idx)
const {
79 virtual const boost::shared_ptr<ROMol>
operator[](
size_t idx)
const {
84 std::vector<boost::shared_ptr<ROMol> > d_mols;
virtual size_t addMol(boost::shared_ptr< ROMol > nmol)
virtual const boost::shared_ptr< ROMol > getMol(size_t idx) const
returns a particular molecule in the bundle
virtual const boost::shared_ptr< ROMol > operator[](size_t idx) const
returns a particular molecule from the bundle
Class to allow us to throw an IndexError from C++ and have it make it back to Python.
virtual size_t size() const
returns the number of molecules from the bundle
#define PRECONDITION(expr, mess)
Class to allow us to throw a ValueError from C++ and have it make it back to Python.
virtual const std::vector< boost::shared_ptr< ROMol > > & getMols() const
returns our molecules
MolBundle(const MolBundle &other)
copy constructor