OEAtomBondSet

class OEAtomBondSet : public OESystem::OERoleSet

This class represents OEAtomBondSet that is a container that holds atom and bond pointers.

The following methods are publicly inherited from OERoleSet:

AddRole

GetRoles

ClearRoles

HasRole

DeleteRole

NumRoles

Constructors

OEAtomBondSet()

Default constructor that generates an empty container.

OEAtomBondSet(const OEAtomBondSet &rhs)

Copy constructor.

OEAtomBondSet(OESystem::OEIter<OEChem::OEAtomBase> &atoms)
OEAtomBondSet(OESystem::OEIter<OEChem::OEBondBase> &bonds)

OEAtomBondSet(OESystem::OEIterBase<OEChem::OEAtomBase> *atoms)
OEAtomBondSet(OESystem::OEIterBase<OEChem::OEBondBase> *bonds)

OEAtomBondSet(OESystem::OEIter<OEChem::OEAtomBase> &atoms,
              OESystem::OEIter<OEChem::OEBondBase> &bonds)
OEAtomBondSet(OESystem::OEIterBase<OEChem::OEAtomBase> *atoms,
              OESystem::OEIterBase<OEChem::OEBondBase> *bonds)

Constructors that generate an OEAtomBondSet container with the given atoms and bonds.

operator=

OEAtomBondSet &operator=(const OEAtomBondSet &rhs)

Assignment operator.

Add

bool Add(const OEMolBase& mol,
     const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& atompred)

bool Add(const OEMolBase& mol,
     const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& bondpred)

bool Add(const OEMolBase& mol,
     const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& atompred,
     const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& bondpred)

bool Add(const OEAtomBondSet& abset)

Adds the atom and bond objects to the container. Returns false if given a null pointer or if the atoms or bonds being added do not belong to the same molecule previous objects in the set belong to.

See also

AddAtom

bool AddAtom(OEChem::OEAtomBase *atom)

Adds an atom to the container. Returns false if given a null pointer or if the atom being added does not belong to the same molecule previous atoms and bonds in the set belong to.

See also

AddAtoms

bool AddAtoms(const std::vector<OEChem::OEAtomBase *> &atoms)

Adds all the atoms to the container. Returns false if given a null pointer or if any atom being added does not belong to the same molecule previous atoms and bonds in the set belong to.

See also

AddBond

bool AddBond(OEChem::OEBondBase *bond)

Adds a bond to the container. Returns false if given a null pointer or if the bond being added does not belong to the same molecule previous atoms and bonds in the set belong to.

See also

AddBonds

bool AddBonds(const std::vector<OEChem::OEBondBase *> &bonds)

Adds all the bonds to the container. Returns false if given a null pointer or if any bond being added does not belong to the same molecule previous atoms and bonds in the set belong to.

See also

Clear

void Clear()

Removes all atoms and bonds from the OEAtomBondSet and clears the OERoleSet.

ClearAtoms

void ClearAtoms()

Removes all atoms from the OEAtomBondSet.

ClearAtomsAndBonds

void ClearAtomsAndBonds()

Removes all atoms and bonds from the OEAtomBondSet but retains the existing OERoleSet.

ClearBonds

void ClearBonds()

Removes all bonds from the OEAtomBondSet.

CreateCopy

OESystem::OEAtomBondSet *CreateCopy() const

Deep copy constructor that returns a copy of the object. The memory for the returned object derived from OEAtomBondSet is dynamically allocated and owned by the caller.

The returned copy should be deallocated using C++ delete operator in order to prevent a memory leak.

HasAtom

bool HasAtom(OEChem::OEAtomBase *atom) const

Returns whether atom already belongs to the set.

HasBond

bool HasBond(OEChem::OEBondBase *bond) const

Returns whether bond already belongs to the set.

IsEmpty

bool IsEmpty() const

Returns whether the set contains any atoms or bonds.

GetAtoms

OESystem::OEIterBase<OEChem::OEAtomBase> *GetAtoms() const

Returns an iterator over the atoms that are stored in the OEAtomBondSet object.

OESystem::OEIterBase<OEAtomBase> *
  GetAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase> &) const =0

Returns an iterator over all of the atoms in the container that match the specified atom predicate (OEUnaryPredicate).

GetBonds

OESystem::OEIterBase<OEChem::OEBondBase> *GetBonds() const

Returns an iterator over the bonds that are stored in the OEAtomBondSet object.

OESystem::OEIterBase<OEBondBase> *
  GetBonds(const OESystem::OEUnaryPredicate<OEChem::OEBondBase> &) const =0

Returns an iterator over all of the bonds in the container that match the specified bond predicate (OEUnaryPredicate).

GetParent

const OEMolBase *GetParent() const

Returns the parent molecule of a OEAtomBondSet object. This method can be used to determine the molecule of which atoms and bonds the container stores. The ‘parent molecule’ property of a OEAtomBondSet object cannot be altered, as it is determined at the point the container is created. The OEAtomBondSet::GetParent method returns a null pointer if the container is empty.

NumAtoms

unsigned int NumAtoms() const

Returns the number of atoms stored in the OEAtomBondSet object.

unsigned int NumAtoms(const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& atompred) const

Returns the number of atoms stored in the OEAtomBondSet object matching the provided predicate.

NumBonds

unsigned int NumBonds() const

Returns the number of bonds stored in the OEAtomBondSet object.

unsigned int NumBonds(const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& bondpred) const

Returns the number of bonds stored in the OEAtomBondSet object matching the provided predicate.

Remove

bool Remove(const OEMolBase& mol,
     const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& atompred)

bool Remove(const OEMolBase& mol,
     const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& bondpred)

bool Remove(const OEMolBase& mol,
     const OESystem::OEUnaryPredicate<OEChem::OEAtomBase>& atompred,
     const OESystem::OEUnaryPredicate<OEChem::OEBondBase>& bondpred)

bool Remove(const OEAtomBondSet& abset)

Removes the objects from the container. Returns false if given a null pointer or if any of the objects being removed do not belong to the same molecule previous objects in the set belong to.

RemoveAtom

bool RemoveAtom(OEChem::OEAtomBase *atom)

Removes an atom from the container. Returns false if given a null pointer or if the atom being removed does not belong to the same molecule previous atoms in the set belong to.

RemoveAtoms

bool RemoveAtoms(const std::vector<OEChem::OEAtomBase *> &atoms)

Removes atoms from the container. Returns false if given a null pointer or if any atoms being removed do not belong to the same molecule previous atoms in the set belong to.

RemoveBond

bool RemoveBond(OEChem::OEBondBase *bond)

Removes a bond from the container. Returns false if given a null pointer or if the bond being removed does not belong to the same molecule previous bonds in the set belong to.

RemoveBonds

bool RemoveBonds(const std::vector<OEChem::OEBondBase *> &bonds)

Removes bonds from the container. Returns false if given a null pointer or if any bonds being removed do not belong to the same molecule previous bonds in the set belong to.

Sweep

bool Sweep()

Removes deleted atoms and bonds from the container.

Translate

bool Translate(OEAtomBase **amap, OEBondBase **bmap)

Translates the pointers in the container based on the provided mapping between the atoms or bonds in the array arguments. This can be used to convert an existing OEAtomBondSet container to refer to a copy of the molecule made from a subset operations.

See also

OESubsetMol