Chemical Data Processing Library C++ API - Version 1.1.1
Public Types | Public Member Functions | Protected Member Functions | List of all members
CDPL::Chem::Atom Class Referenceabstract

Atom. More...

#include <Atom.hpp>

+ Inheritance diagram for CDPL::Chem::Atom:

Public Types

typedef AtomContainer::AtomIterator AtomIterator
 A mutable random access iterator used to iterate over the connected atoms. More...
 
typedef AtomContainer::ConstAtomIterator ConstAtomIterator
 A constant random access iterator used to iterate over the connected atoms. More...
 
typedef BondContainer::BondIterator BondIterator
 A mutable random access iterator used to iterate over the incident bonds. More...
 
typedef BondContainer::ConstBondIterator ConstBondIterator
 A constant random access iterator used to iterate over the incident bonds. More...
 
- Public Types inherited from CDPL::Chem::AtomContainer
typedef Util::IndexedElementIterator< const Atom, ConstAtomAccessor > ConstAtomIterator
 A constant random access iterator used to iterate over the stored const Chem::Atom objects. More...
 
typedef Util::IndexedElementIterator< Atom, AtomAccessor > AtomIterator
 A mutable random access iterator used to iterate over the stored Chem::Atom objects. More...
 
- Public Types inherited from CDPL::Chem::Entity3DContainer
typedef Util::IndexedElementIterator< const Entity3D, ConstEntityAccessor > ConstEntityIterator
 A constant random access iterator used to iterate over the stored const Chem::Entity3D objects. More...
 
typedef Util::IndexedElementIterator< Entity3D, EntityAccessor > EntityIterator
 A mutable random access iterator used to iterate over the stored Chem::Entity3D objects. More...
 
- Public Types inherited from CDPL::Chem::BondContainer
typedef Util::IndexedElementIterator< const Bond, ConstBondAccessor > ConstBondIterator
 A constant random access iterator used to iterate over the stored const Chem::Bond objects. More...
 
typedef Util::IndexedElementIterator< Bond, BondAccessor > BondIterator
 A mutable random access iterator used to iterate over the stored Chem::Bond objects. More...
 
- Public Types inherited from CDPL::Base::PropertyContainer
typedef PropertyMap::value_type PropertyEntry
 A Base::LookupKey / Base::Any pair that stores the property value for a given property key. More...
 
typedef PropertyMap::const_iterator ConstPropertyIterator
 A constant iterator used to iterate over the property entries. More...
 

Public Member Functions

virtual const MoleculegetMolecule () const =0
 Returns a const reference to the parent molecule. More...
 
virtual MoleculegetMolecule ()=0
 Returns a non-const reference to the parent molecule. More...
 
virtual const BondgetBondToAtom (const Atom &atom) const =0
 Returns a const reference to the Chem::Bond object that connects this atom to the argument atom. More...
 
virtual BondgetBondToAtom (const Atom &atom)=0
 Returns a non-const reference to the Chem::Bond object that connects this atom to the argument atom. More...
 
virtual const BondfindBondToAtom (const Atom &atom) const =0
 Returns a pointer to the const Chem::Bond object that connects this atom to the argument atom. More...
 
virtual BondfindBondToAtom (const Atom &atom)=0
 Returns a pointer to the non-const Chem::Bond object that connects this atom to the argument atom. More...
 
virtual std::size_t getIndex () const =0
 Returns the index of the atom in its parent molecule. More...
 
virtual std::size_t getNumAtoms () const =0
 Returns the number of connected atoms. More...
 
virtual std::size_t getNumBonds () const =0
 Returns the number of incident bonds. More...
 
virtual const BondgetBond (std::size_t idx) const =0
 Returns a const reference to the incident bond at index idx. More...
 
virtual BondgetBond (std::size_t idx)=0
 Returns a non-const reference to the incident bond at index idx. More...
 
virtual const AtomgetAtom (std::size_t idx) const =0
 Returns a const reference to the connected atom at index idx. More...
 
virtual AtomgetAtom (std::size_t idx)=0
 Returns a non-const reference to the connected atom at index idx. More...
 
virtual bool containsAtom (const Atom &atom) const =0
 Tells whether this atom and the argument atom are connected by a bond. More...
 
virtual bool containsBond (const Bond &bond) const =0
 Tells whether the specified bond is incident to this atom. More...
 
virtual std::size_t getAtomIndex (const Atom &atom) const =0
 Returns the index of the specified connected atom. More...
 
virtual std::size_t getBondIndex (const Bond &bond) const =0
 Returns the index of the specified incident bond. More...
 
Atomoperator= (const Atom &atom)
 Assignment operator that replaces the current set of properties with the properties of atom;. More...
 
ConstAtomIterator getAtomsBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More...
 
AtomIterator getAtomsBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More...
 
ConstAtomIterator getAtomsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More...
 
AtomIterator getAtomsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More...
 
ConstBondIterator getBondsBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More...
 
BondIterator getBondsBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More...
 
ConstBondIterator getBondsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More...
 
BondIterator getBondsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More...
 
- Public Member Functions inherited from CDPL::Chem::AtomContainer
ConstAtomIterator getAtomsBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More...
 
ConstAtomIterator getAtomsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More...
 
AtomIterator getAtomsBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More...
 
AtomIterator getAtomsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More...
 
ConstAtomIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects. More...
 
ConstAtomIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Atom objects. More...
 
AtomIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects. More...
 
AtomIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Atom objects. More...
 
virtual std::size_t getNumEntities () const
 Returns the number of stored Chem::Entity3D objects. More...
 
virtual const Entity3DgetEntity (std::size_t idx) const
 Returns a const reference to the Chem::Entity3D instance at index idx. More...
 
virtual Entity3DgetEntity (std::size_t idx)
 Returns a non-const reference to the entity at index idx. More...
 
virtual void orderAtoms (const AtomCompareFunction &func)=0
 Orders the stored atoms according to criteria implemented by the provided atom comparison function. More...
 
const AtomContainergetAtoms () const
 Returns a const reference to itself. More...
 
AtomContainergetAtoms ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Chem::Entity3DContainer
ConstEntityIterator getEntitiesBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More...
 
ConstEntityIterator getEntitiesEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More...
 
EntityIterator getEntitiesBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More...
 
EntityIterator getEntitiesEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More...
 
ConstEntityIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Entity3D objects. More...
 
ConstEntityIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Entity3D objects. More...
 
EntityIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Entity3D objects. More...
 
EntityIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Entity3D objects. More...
 
const Entity3DContainergetEntities () const
 Returns a const reference to itself. More...
 
Entity3DContainergetEntities ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Chem::BondContainer
ConstBondIterator getBondsBegin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More...
 
ConstBondIterator getBondsEnd () const
 Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More...
 
BondIterator getBondsBegin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More...
 
BondIterator getBondsEnd ()
 Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More...
 
ConstBondIterator begin () const
 Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects. More...
 
ConstBondIterator end () const
 Returns a constant iterator pointing to the end of the stored const Chem::Bond objects. More...
 
BondIterator begin ()
 Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects. More...
 
BondIterator end ()
 Returns a mutable iterator pointing to the end of the stored Chem::Bond objects. More...
 
virtual void orderBonds (const BondCompareFunction &func)=0
 Orders the stored bonds according to criteria implemented by the provided bond comparison function. More...
 
const BondContainergetBonds () const
 Returns a const reference to itself. More...
 
BondContainergetBonds ()
 Returns a reference to itself. More...
 
- Public Member Functions inherited from CDPL::Base::PropertyContainer
std::size_t getNumProperties () const
 Returns the number of property entries. More...
 
template<typename T >
void setProperty (const LookupKey &key, T &&val)
 Sets the value of the property specified by key to val. More...
 
template<typename T >
const T & getProperty (const LookupKey &key) const
 Returns the value of the property specified by key as a const reference to an object of type T. More...
 
template<typename T >
const T & getPropertyOrDefault (const LookupKey &key, const T &def_val) const
 Returns the value of the property specified by key as a const reference to an object of type T, or the default value def_val if a stored value does not exist. More...
 
const AnygetProperty (const LookupKey &key, bool throw_=false) const
 Returns the value of the property specified by key. More...
 
bool isPropertySet (const LookupKey &key) const
 Tells whether or not a value has been assigned to the property specified by key. More...
 
ConstPropertyIterator getPropertiesBegin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator getPropertiesEnd () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
ConstPropertyIterator begin () const
 Returns a constant iterator pointing to the beginning of the property entries. More...
 
ConstPropertyIterator end () const
 Returns a constant iterator pointing to the end of the property entries. More...
 
bool removeProperty (const LookupKey &key)
 Clears the value of the property specified by key. More...
 
void clearProperties ()
 Clears all property values. More...
 
void addProperties (const PropertyContainer &cntnr)
 Adds the property value entries in the PropertyContainer instance cntnr. More...
 
void copyProperties (const PropertyContainer &cntnr)
 Replaces the current set of properties by a copy of the entries in cntnr. More...
 
void swap (PropertyContainer &cntnr)
 Exchanges the properties of this container with the properties of the container cntnr. More...
 
const PropertyContainergetProperties () const
 Returns a const reference to itself. More...
 

Protected Member Functions

virtual ~Atom ()
 Virtual destructor. More...
 
- Protected Member Functions inherited from CDPL::Chem::AtomContainer
virtual ~AtomContainer ()
 Virtual destructor. More...
 
AtomContaineroperator= (const AtomContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Chem::Entity3DContainer
virtual ~Entity3DContainer ()
 Virtual destructor. More...
 
Entity3DContaineroperator= (const Entity3DContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Chem::BondContainer
virtual ~BondContainer ()
 Virtual destructor. More...
 
BondContaineroperator= (const BondContainer &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Chem::Entity3D
 Entity3D ()
 Default constructor. More...
 
 Entity3D (const Entity3D &entity)
 Constructs a copy of the Entity3D instance entity. More...
 
virtual ~Entity3D ()
 Virtual destructor. More...
 
Entity3Doperator= (const Entity3D &cntnr)
 Assignment operator. More...
 
- Protected Member Functions inherited from CDPL::Base::PropertyContainer
 PropertyContainer ()
 Constructs an empty PropertyContainer instance. More...
 
 PropertyContainer (const PropertyContainer &cntnr)
 Constructs a copy of the PropertyContainer instance cntnr. More...
 
virtual ~PropertyContainer ()
 Virtual destructor. More...
 
PropertyContaineroperator= (const PropertyContainer &cntnr)
 Assignment operator. More...
 

Detailed Description

Atom.

Member Typedef Documentation

◆ AtomIterator

A mutable random access iterator used to iterate over the connected atoms.

◆ ConstAtomIterator

A constant random access iterator used to iterate over the connected atoms.

◆ BondIterator

A mutable random access iterator used to iterate over the incident bonds.

◆ ConstBondIterator

A constant random access iterator used to iterate over the incident bonds.

Constructor & Destructor Documentation

◆ ~Atom()

virtual CDPL::Chem::Atom::~Atom ( )
inlineprotectedvirtual

Virtual destructor.

Member Function Documentation

◆ getMolecule() [1/2]

virtual const Molecule& CDPL::Chem::Atom::getMolecule ( ) const
pure virtual

Returns a const reference to the parent molecule.

Returns
A const reference to the parent molecule.

Implemented in CDPL::Chem::BasicAtom.

◆ getMolecule() [2/2]

virtual Molecule& CDPL::Chem::Atom::getMolecule ( )
pure virtual

Returns a non-const reference to the parent molecule.

Returns
A non-const reference to the parent molecule.

Implemented in CDPL::Chem::BasicAtom.

◆ getBondToAtom() [1/2]

virtual const Bond& CDPL::Chem::Atom::getBondToAtom ( const Atom atom) const
pure virtual

Returns a const reference to the Chem::Bond object that connects this atom to the argument atom.

Parameters
atomThe adjacent atom for which to return the connecting bond.
Returns
A const reference to the Chem::Bond object connecting this atom and the argument atom.
Exceptions
Base::ItemNotFoundif the argument atom is not connected to this atom.

Implemented in CDPL::Chem::BasicAtom.

◆ getBondToAtom() [2/2]

virtual Bond& CDPL::Chem::Atom::getBondToAtom ( const Atom atom)
pure virtual

Returns a non-const reference to the Chem::Bond object that connects this atom to the argument atom.

Parameters
atomThe adjacent atom for which to return the connecting bond.
Returns
A non-const reference to the Chem::Bond object connecting this atom and the argument atom.
Exceptions
Base::ItemNotFoundif the argument atom is not connected to this atom.

Implemented in CDPL::Chem::BasicAtom.

◆ findBondToAtom() [1/2]

virtual const Bond* CDPL::Chem::Atom::findBondToAtom ( const Atom atom) const
pure virtual

Returns a pointer to the const Chem::Bond object that connects this atom to the argument atom.

Parameters
atomThe adjacent atom for which to return a pointer to the connecting bond.
Returns
A pointer to the const Chem::Bond object that connects this atom to the argument atom, or null if the argument atom is not connected.

Implemented in CDPL::Chem::BasicAtom.

◆ findBondToAtom() [2/2]

virtual Bond* CDPL::Chem::Atom::findBondToAtom ( const Atom atom)
pure virtual

Returns a pointer to the non-const Chem::Bond object that connects this atom to the argument atom.

Parameters
atomThe adjacent atom for which to return a pointer to the connecting bond.
Returns
A pointer to the non-const Chem::Bond object that connects this atom to the argument atom, or null if the argument atom is not connected.

Implemented in CDPL::Chem::BasicAtom.

◆ getIndex()

virtual std::size_t CDPL::Chem::Atom::getIndex ( ) const
pure virtual

Returns the index of the atom in its parent molecule.

Returns
The zero-based index of the atom.

Implemented in CDPL::Chem::BasicAtom.

◆ getNumAtoms()

virtual std::size_t CDPL::Chem::Atom::getNumAtoms ( ) const
pure virtual

Returns the number of connected atoms.

Equivalent to getNumBonds().

Returns
The number of connected atoms.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getNumBonds()

virtual std::size_t CDPL::Chem::Atom::getNumBonds ( ) const
pure virtual

Returns the number of incident bonds.

Equivalent to getNumAtoms().

Returns
The number of incident bonds.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getBond() [1/2]

virtual const Bond& CDPL::Chem::Atom::getBond ( std::size_t  idx) const
pure virtual

Returns a const reference to the incident bond at index idx.

Parameters
idxThe index of the incident bond to return.
Returns
A const reference to the incident bond at index idx.
Exceptions
Base::IndexErrorif idx is not in the range [0, getNumBonds() - 1].
Note
The order of incident bonds corresponds to the order of the connected atoms.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getBond() [2/2]

virtual Bond& CDPL::Chem::Atom::getBond ( std::size_t  idx)
pure virtual

Returns a non-const reference to the incident bond at index idx.

Parameters
idxThe index of the incident bond to return.
Returns
A non-const reference to the incident bond at index idx.
Exceptions
Base::IndexErrorif idx is not in the range [0, getNumBonds() - 1].
Note
The order of incident bonds corresponds to the order of connected atoms.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getAtom() [1/2]

virtual const Atom& CDPL::Chem::Atom::getAtom ( std::size_t  idx) const
pure virtual

Returns a const reference to the connected atom at index idx.

Parameters
idxThe index of the atom to return.
Returns
A const reference to the connected atom at index idx.
Exceptions
Base::IndexErrorif idx is not in the range [0, getNumAtoms() - 1].
Note
The order of connected atoms corresponds to the order of connecting bonds.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getAtom() [2/2]

virtual Atom& CDPL::Chem::Atom::getAtom ( std::size_t  idx)
pure virtual

Returns a non-const reference to the connected atom at index idx.

Parameters
idxThe index of the atom to return.
Returns
A non-const reference to the connected atom at index idx.
Exceptions
Base::IndexErrorif idx is not in the range [0, getNumAtoms() - 1].
Note
The order of connected atoms corresponds to the order of connecting bonds.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ containsAtom()

virtual bool CDPL::Chem::Atom::containsAtom ( const Atom atom) const
pure virtual

Tells whether this atom and the argument atom are connected by a bond.

Parameters
atomThe atom to test for adjacency.
Returns
true if the argument atom is connected to this atom, and false otherwise.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ containsBond()

virtual bool CDPL::Chem::Atom::containsBond ( const Bond bond) const
pure virtual

Tells whether the specified bond is incident to this atom.

Parameters
bondThe bond to test for incidence.
Returns
true if the argument bond is incident to this atom, and false otherwise.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getAtomIndex()

virtual std::size_t CDPL::Chem::Atom::getAtomIndex ( const Atom atom) const
pure virtual

Returns the index of the specified connected atom.

Parameters
atomThe connected atom for which to return the index.
Returns
The zero-based index of the specified atom.
Exceptions
Base::ItemNotFoundif the specified atom is not connected to this atom.

Implements CDPL::Chem::AtomContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ getBondIndex()

virtual std::size_t CDPL::Chem::Atom::getBondIndex ( const Bond bond) const
pure virtual

Returns the index of the specified incident bond.

Parameters
bondThe bond for which to return the index.
Returns
The zero-based index of the specified bond.
Exceptions
Base::ItemNotFoundif the specified bond is not incident to this atom.

Implements CDPL::Chem::BondContainer.

Implemented in CDPL::Chem::BasicAtom.

◆ operator=()

Atom& CDPL::Chem::Atom::operator= ( const Atom atom)

Assignment operator that replaces the current set of properties with the properties of atom;.

Parameters
atomThe atom whose properties get copied.
Returns
A reference to itself.

◆ getAtomsBegin() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::getAtomsBegin

Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.

Returns
A constant iterator pointing to the beginning of the stored const Chem::Atom objects.

◆ getAtomsBegin() [2/2]

AtomIterator CDPL::Chem::AtomContainer::getAtomsBegin

Returns a mutable iterator pointing to the beginning of the stored Chem::Atom objects.

Returns
A mutable iterator pointing to the beginning of the stored Chem::Atom objects.

◆ getAtomsEnd() [1/2]

ConstAtomIterator CDPL::Chem::AtomContainer::getAtomsEnd

Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.

Returns
A constant iterator pointing to the end of the stored const Chem::Atom objects.

◆ getAtomsEnd() [2/2]

AtomIterator CDPL::Chem::AtomContainer::getAtomsEnd

Returns a mutable iterator pointing to the end of the stored Chem::Atom objects.

Returns
A mutable iterator pointing to the end of the stored Chem::Atom objects.

◆ getBondsBegin() [1/2]

ConstBondIterator CDPL::Chem::BondContainer::getBondsBegin

Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects.

Returns
A constant iterator pointing to the beginning of the stored const Chem::Bond objects.

◆ getBondsBegin() [2/2]

BondIterator CDPL::Chem::BondContainer::getBondsBegin

Returns a mutable iterator pointing to the beginning of the stored Chem::Bond objects.

Returns
A mutable iterator pointing to the beginning of the stored Chem::Bond objects.

◆ getBondsEnd() [1/2]

ConstBondIterator CDPL::Chem::BondContainer::getBondsEnd

Returns a constant iterator pointing to the end of the stored const Chem::Bond objects.

Returns
A constant iterator pointing to the end of the stored const Chem::Bond objects.

◆ getBondsEnd() [2/2]

BondIterator CDPL::Chem::BondContainer::getBondsEnd

Returns a mutable iterator pointing to the end of the stored Chem::Bond objects.

Returns
A mutable iterator pointing to the end of the stored Chem::Bond objects.

The documentation for this class was generated from the following file: