17 #ifndef RD_MOLBUNDLE_AUG2017 18 #define RD_MOLBUNDLE_AUG2017 25 #include <boost/smart_ptr.hpp> 51 virtual const std::vector<boost::shared_ptr<ROMol>> &
getMols()
const {
58 virtual size_t addMol(boost::shared_ptr<ROMol> nmol) {
61 if (nmol->getNumAtoms() != d_mols[0]->getNumAtoms())
63 "all molecules in a bundle must have the same number of atoms");
65 if (nmol->getNumBonds() != d_mols[0]->getNumBonds())
67 "all molecules in a bundle must have the same number of bonds");
69 d_mols.push_back(nmol);
70 return (d_mols.size());
73 virtual size_t size()
const {
return d_mols.size(); };
75 virtual const boost::shared_ptr<ROMol>
getMol(
size_t idx)
const {
80 virtual const boost::shared_ptr<ROMol>
operator[](
size_t idx)
const {
85 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