3.2.5 GetIdx

virtual unsigned int GetIdx() const

Return the bond index of an bond. This value is assigned by OEChem when a bond is created. The bond index is unique for the bonds of a given molecule, and is stable (not reused) for the lifetime of that OEMolBase. These values may not be assigned sequentially, and may contain gaps. Bond indices are guaranteed to be less than OEMolBase::GetMaxBondIdx. Bond indices are typically only used for efficiently storing data in arrays (or vectors) externally to the OEMolBase. They arrays can be conveniently index via OEBondBase::GetIdx(). For iterating across the bonds of a molecule, use OEMolBase::GetBonds() and for keeping track of a particular bond use its OEBondBase*.