Chemical Data Processing Library C++ API - Version 1.1.1
Atom.hpp
Go to the documentation of this file.
1 /*
2  * Atom.hpp
3  *
4  * This file is part of the Chemical Data Processing Toolkit
5  *
6  * Copyright (C) 2003 Thomas Seidel <thomas.seidel@univie.ac.at>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with this library; see the file COPYING. If not, write to
20  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
29 #ifndef CDPL_CHEM_ATOM_HPP
30 #define CDPL_CHEM_ATOM_HPP
31 
32 #include "CDPL/Chem/APIPrefix.hpp"
35 #include "CDPL/Chem/Entity3D.hpp"
36 
37 
38 namespace CDPL
39 {
40 
41  namespace Chem
42  {
43 
44  class Molecule;
45 
50  public BondContainer,
51  public Entity3D
52  {
53 
54  public:
59 
64 
69 
74 
77 
80 
85  virtual const Molecule& getMolecule() const = 0;
86 
91  virtual Molecule& getMolecule() = 0;
92 
99  virtual const Bond& getBondToAtom(const Atom& atom) const = 0;
100 
107  virtual Bond& getBondToAtom(const Atom& atom) = 0;
108 
115  virtual const Bond* findBondToAtom(const Atom& atom) const = 0;
116 
123  virtual Bond* findBondToAtom(const Atom& atom) = 0;
124 
129  virtual std::size_t getIndex() const = 0;
130 
138  virtual std::size_t getNumAtoms() const = 0;
139 
147  virtual std::size_t getNumBonds() const = 0;
148 
156  virtual const Bond& getBond(std::size_t idx) const = 0;
157 
165  virtual Bond& getBond(std::size_t idx) = 0;
166 
174  virtual const Atom& getAtom(std::size_t idx) const = 0;
175 
183  virtual Atom& getAtom(std::size_t idx) = 0;
184 
190  virtual bool containsAtom(const Atom& atom) const = 0;
191 
197  virtual bool containsBond(const Bond& bond) const = 0;
198 
205  virtual std::size_t getAtomIndex(const Atom& atom) const = 0;
206 
213  virtual std::size_t getBondIndex(const Bond& bond) const = 0;
214 
220  Atom& operator=(const Atom& atom);
221 
222  protected:
226  virtual ~Atom() {}
227  };
228  } // namespace Chem
229 } // namespace CDPL
230 
231 #endif // CDPL_CHEM_ATOM_HPP
CDPL::Chem::Atom::getNumBonds
virtual std::size_t getNumBonds() const =0
Returns the number of incident bonds.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CHEM_API.
CDPL::Chem::Atom::getIndex
virtual std::size_t getIndex() const =0
Returns the index of the atom in its parent molecule.
CDPL_CHEM_API
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Chem::Atom::getBond
virtual const Bond & getBond(std::size_t idx) const =0
Returns a const reference to the incident bond at index idx.
CDPL::Chem::Bond
Bond.
Definition: Bond.hpp:50
CDPL::Chem::Atom::getBondToAtom
virtual const Bond & getBondToAtom(const Atom &atom) const =0
Returns a const reference to the Chem::Bond object that connects this atom to the argument atom.
CDPL::Chem::BondContainer::getBondsBegin
ConstBondIterator getBondsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Bond objects.
CDPL::Chem::Atom::~Atom
virtual ~Atom()
Virtual destructor.
Definition: Atom.hpp:226
CDPL::Chem::BondContainer::getBondsEnd
ConstBondIterator getBondsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Bond objects.
CDPL::Util::IndexedElementIterator
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
BondContainer.hpp
Definition of the class CDPL::Chem::BondContainer.
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
CDPL::Chem::Atom::getAtom
virtual const Atom & getAtom(std::size_t idx) const =0
Returns a const reference to the connected atom at index idx.
CDPL::Chem::AtomContainer::getAtomsBegin
ConstAtomIterator getAtomsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
CDPL::Chem::Atom::getAtom
virtual Atom & getAtom(std::size_t idx)=0
Returns a non-const reference to the connected atom at index idx.
Entity3D.hpp
Definition of the class CDPL::Chem::Entity3D.
CDPL::Chem::Molecule
Molecule.
Definition: Molecule.hpp:49
CDPL::Chem::Atom::getBondIndex
virtual std::size_t getBondIndex(const Bond &bond) const =0
Returns the index of the specified incident bond.
CDPL::Chem::AtomContainer
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
CDPL::Chem::Atom::BondIterator
BondContainer::BondIterator BondIterator
A mutable random access iterator used to iterate over the incident bonds.
Definition: Atom.hpp:68
AtomContainer.hpp
Definition of the class CDPL::Chem::AtomContainer.
CDPL::Chem::Atom::ConstAtomIterator
AtomContainer::ConstAtomIterator ConstAtomIterator
A constant random access iterator used to iterate over the connected atoms.
Definition: Atom.hpp:63
CDPL::Chem::Atom::getBond
virtual Bond & getBond(std::size_t idx)=0
Returns a non-const reference to the incident bond at index idx.
CDPL::Chem::Atom::getMolecule
virtual Molecule & getMolecule()=0
Returns a non-const reference to the parent molecule.
CDPL::Chem::Atom::getBondToAtom
virtual Bond & getBondToAtom(const Atom &atom)=0
Returns a non-const reference to the Chem::Bond object that connects this atom to the argument atom.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Chem::Atom::getMolecule
virtual const Molecule & getMolecule() const =0
Returns a const reference to the parent molecule.
CDPL::Chem::BondContainer
A common interface for data-structures that support a random access to stored Chem::Bond instances.
Definition: BondContainer.hpp:54
CDPL::Chem::Atom::containsBond
virtual bool containsBond(const Bond &bond) const =0
Tells whether the specified bond is incident to this atom.
CDPL::Chem::Atom::AtomIterator
AtomContainer::AtomIterator AtomIterator
A mutable random access iterator used to iterate over the connected atoms.
Definition: Atom.hpp:58
CDPL::Chem::Atom::containsAtom
virtual bool containsAtom(const Atom &atom) const =0
Tells whether this atom and the argument atom are connected by a bond.
CDPL::Chem::Atom::findBondToAtom
virtual Bond * findBondToAtom(const Atom &atom)=0
Returns a pointer to the non-const Chem::Bond object that connects this atom to the argument atom.
CDPL::Chem::Entity3D
Entity3D.
Definition: Entity3D.hpp:46
CDPL::Chem::Atom::findBondToAtom
virtual const Bond * findBondToAtom(const Atom &atom) const =0
Returns a pointer to the const Chem::Bond object that connects this atom to the argument atom.
CDPL::Chem::Atom::getAtomIndex
virtual std::size_t getAtomIndex(const Atom &atom) const =0
Returns the index of the specified connected atom.
CDPL::Chem::Atom::ConstBondIterator
BondContainer::ConstBondIterator ConstBondIterator
A constant random access iterator used to iterate over the incident bonds.
Definition: Atom.hpp:73
CDPL::Chem::AtomContainer::getAtomsEnd
ConstAtomIterator getAtomsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
CDPL::Chem::Atom::getNumAtoms
virtual std::size_t getNumAtoms() const =0
Returns the number of connected atoms.