#include "oechem.h" #include using namespace OESystem; using namespace OEChem; using namespace std; bool MyMolIsEmpty(OEMolBase &mol) { return mol.GetAtoms()? false : true; } unsigned int MyNumAtoms(OEMolBase &mol) { OEIter atom; unsigned int result = 0; for (atom = mol.GetAtoms(); atom; ++atom) ++result; return result; } unsigned int MyNumBonds(OEMolBase &mol) { OEIter bond; unsigned int result = 0; for (bond = mol.GetBonds(); bond; ++bond) ++result; return result; } int main() { OEMol mol; OEParseSmiles(mol, "c1ccccc1"); if (!MyMolIsEmpty(mol)) { cerr << "num atoms: " << MyNumAtoms(mol) << endl; cerr << "num bonds: " << MyNumBonds(mol) << endl; } return 0; }