Chemical Data Processing Library C++ API - Version 1.1.1
Public Member Functions | Friends | List of all members
CDPL::Chem::BasicBond Class Reference

BasicBond. More...

#include <BasicBond.hpp>

+ Inheritance diagram for CDPL::Chem::BasicBond:

Public Member Functions

std::size_t getNumAtoms () const
 Returns the number of atoms connected by the bond. More...
 
const MoleculegetMolecule () const
 Returns a const reference to the parent molecule. More...
 
MoleculegetMolecule ()
 Returns a non-const reference to the parent molecule. More...
 
const AtomgetBegin () const
 Returns a const reference to the start atom of the bond. More...
 
AtomgetBegin ()
 Returns a non-const reference to the start atom of the bond. More...
 
const AtomgetEnd () const
 Returns a const reference to the end atom of the bond. More...
 
AtomgetEnd ()
 Returns a non-const reference to the end atom of the bond. More...
 
const AtomgetAtom (std::size_t idx) const
 Returns a const reference to the atom at index idx. More...
 
AtomgetAtom (std::size_t idx)
 Returns a non-const reference to the atom at index idx. More...
 
bool containsAtom (const Atom &atom) const
 Tells whether the bond is incident to the specified atom. More...
 
std::size_t getAtomIndex (const Atom &atom) const
 Returns the index of the specified atom. More...
 
const AtomgetNeighbor (const Atom &atom) const
 Returns a const reference to the connected neighbor of the argument atom. More...
 
AtomgetNeighbor (const Atom &atom)
 Returns a non-const reference to the connected neighbor of the argument atom. More...
 
std::size_t getIndex () const
 Returns the index of the bond in its parent molecule. More...
 
void orderAtoms (const AtomCompareFunction &func)
 Orders the stored atoms according to criteria implemented by the provided atom comparison function. More...
 
BasicBondoperator= (const BasicBond &bond)
 Assignment operator that replaces the current set of properties with the properties of bond;. More...
 
Bondoperator= (const Bond &bond)
 Assignment operator that replaces the current set of properties with the properties of bond;. More...
 
- Public Member Functions inherited from CDPL::Chem::Bond
Bondoperator= (const Bond &bond)
 Assignment operator that replaces the current set of properties with the properties of bond;. 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...
 
- 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...
 
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::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...
 

Friends

class BasicMolecule
 
class BasicAtom
 

Additional Inherited Members

- Public Types inherited from CDPL::Chem::Bond
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...
 
- 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::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...
 
- Protected Member Functions inherited from CDPL::Chem::Bond
virtual ~Bond ()
 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::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

BasicBond.

Member Function Documentation

◆ getNumAtoms()

std::size_t CDPL::Chem::BasicBond::getNumAtoms ( ) const
virtual

Returns the number of atoms connected by the bond.

Since a bond connects exactly two atoms, the return value is always 2.

Returns
The number of atoms connected by the bond (always 2).

Implements CDPL::Chem::Bond.

◆ getMolecule() [1/2]

const Molecule& CDPL::Chem::BasicBond::getMolecule ( ) const
virtual

Returns a const reference to the parent molecule.

Returns
A const reference to the parent molecule.

Implements CDPL::Chem::Bond.

◆ getMolecule() [2/2]

Molecule& CDPL::Chem::BasicBond::getMolecule ( )
virtual

Returns a non-const reference to the parent molecule.

Returns
A non-const reference to the parent molecule.

Implements CDPL::Chem::Bond.

◆ getBegin() [1/2]

const Atom& CDPL::Chem::BasicBond::getBegin ( ) const
virtual

Returns a const reference to the start atom of the bond.

Returns
A const reference to the start atom of the bond.

Implements CDPL::Chem::Bond.

◆ getBegin() [2/2]

Atom& CDPL::Chem::BasicBond::getBegin ( )
virtual

Returns a non-const reference to the start atom of the bond.

Returns
A non-const reference to the start atom of the bond.

Implements CDPL::Chem::Bond.

◆ getEnd() [1/2]

const Atom& CDPL::Chem::BasicBond::getEnd ( ) const
virtual

Returns a const reference to the end atom of the bond.

Returns
A const reference to the end atom of the bond.

Implements CDPL::Chem::Bond.

◆ getEnd() [2/2]

Atom& CDPL::Chem::BasicBond::getEnd ( )
virtual

Returns a non-const reference to the end atom of the bond.

Returns
A non-const reference to the end atom of the bond.

Implements CDPL::Chem::Bond.

◆ getAtom() [1/2]

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

Returns a const reference to the atom at index idx.

The index 0 specifies the start atom (see getBegin() const) and 1 the end atom of the bond (see getEnd() const).

Parameters
idxThe index of the atom to return.
Returns
A const reference to the atom at index idx.
Exceptions
Base::IndexErrorif idx is not in the range [0, 1].

Implements CDPL::Chem::Bond.

◆ getAtom() [2/2]

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

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

The index 0 specifies the start atom (see getBegin() const) and 1 the end atom of the bond (see getEnd() const).

Parameters
idxThe index of the atom to return.
Returns
A non-const reference to the atom at index idx.
Exceptions
Base::IndexErrorif idx is not in the range [0, 1].

Implements CDPL::Chem::Bond.

◆ containsAtom()

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

Tells whether the bond is incident to the specified atom.

Parameters
atomThe atom to check.
Returns
true if the bond is incident to the specified atom, and false otherwise.

Implements CDPL::Chem::Bond.

◆ getAtomIndex()

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

Returns the index of the specified atom.

If the specified atom is the start atom of the bond, the index 0 is returned. For the end atom of the bond, the value 1 will be returned.

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

Implements CDPL::Chem::Bond.

◆ getNeighbor() [1/2]

const Atom& CDPL::Chem::BasicBond::getNeighbor ( const Atom atom) const
virtual

Returns a const reference to the connected neighbor of the argument atom.

Parameters
atomThe atom for which to return the connected neighbor atom.
Returns
A const reference to the connected neighbor of the argument atom.
Exceptions
Base::ItemNotFoundif the bond is not incident to the specified atom.

Implements CDPL::Chem::Bond.

◆ getNeighbor() [2/2]

Atom& CDPL::Chem::BasicBond::getNeighbor ( const Atom atom)
virtual

Returns a non-const reference to the connected neighbor of the argument atom.

Parameters
atomThe atom for which to return the connected neighbor atom.
Returns
A non-const reference to the connected neighbor atom of the argument atom.
Exceptions
Base::ItemNotFoundif the specified atom is not involved in the bond.

Implements CDPL::Chem::Bond.

◆ getIndex()

std::size_t CDPL::Chem::BasicBond::getIndex ( ) const
virtual

Returns the index of the bond in its parent molecule.

Returns
The zero-based index of the bond.

Implements CDPL::Chem::Bond.

◆ orderAtoms()

void CDPL::Chem::BasicBond::orderAtoms ( const AtomCompareFunction func)
virtual

Orders the stored atoms according to criteria implemented by the provided atom comparison function.

Parameters
funcThe atom comparison function implementing the applied ordering criteria.

Implements CDPL::Chem::AtomContainer.

◆ operator=() [1/2]

BasicBond& CDPL::Chem::BasicBond::operator= ( const BasicBond bond)

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

Parameters
bondThe bond whose properties get copied.
Returns
A reference to itself.

◆ operator=() [2/2]

Bond& CDPL::Chem::Bond::operator=

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

Parameters
bondThe bond whose properties get copied.
Returns
A reference to itself.

Friends And Related Function Documentation

◆ BasicMolecule

friend class BasicMolecule
friend

◆ BasicAtom

friend class BasicAtom
friend

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