Chemical Data Processing Library C++ API - Version 1.2.0
Bond.hpp
Go to the documentation of this file.
1 /*
2  * Bond.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_BOND_HPP
30 #define CDPL_CHEM_BOND_HPP
31 
32 #include "CDPL/Chem/APIPrefix.hpp"
35 
36 
37 namespace CDPL
38 {
39 
40  namespace Chem
41  {
42 
43  class Molecule;
44 
50  {
51 
52  public:
57 
62 
65 
70  virtual const Molecule& getMolecule() const = 0;
71 
76  virtual Molecule& getMolecule() = 0;
77 
82  virtual const Atom& getBegin() const = 0;
83 
88  virtual Atom& getBegin() = 0;
89 
94  virtual const Atom& getEnd() const = 0;
95 
100  virtual Atom& getEnd() = 0;
101 
108  virtual const Atom& getNeighbor(const Atom& atom) const = 0;
109 
116  virtual Atom& getNeighbor(const Atom& atom) = 0;
117 
122  virtual std::size_t getIndex() const = 0;
123 
131  virtual std::size_t getNumAtoms() const = 0;
132 
143  virtual const Atom& getAtom(std::size_t idx) const = 0;
144 
155  virtual Atom& getAtom(std::size_t idx) = 0;
156 
162  virtual bool containsAtom(const Atom& atom) const = 0;
163 
174  virtual std::size_t getAtomIndex(const Atom& atom) const = 0;
175 
181  Bond& operator=(const Bond& bond);
182 
183  protected:
187  virtual ~Bond() {}
188  };
189  } // namespace Chem
190 } // namespace CDPL
191 
192 #endif // CDPL_CHEM_BOND_HPP
Definition of the class CDPL::Chem::AtomContainer.
Definition of the preprocessor macro CDPL_CHEM_API.
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
Definition of the class CDPL::Base::PropertyContainer.
A class providing methods for the storage and lookup of object properties.
Definition: PropertyContainer.hpp:75
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
ConstAtomIterator getAtomsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
ConstAtomIterator getAtomsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
Atom.
Definition: Atom.hpp:52
Bond.
Definition: Bond.hpp:50
virtual Atom & getEnd()=0
Returns a non-const reference to the end atom of the bond.
virtual const Atom & getAtom(std::size_t idx) const =0
Returns a const reference to the atom at index idx.
virtual std::size_t getIndex() const =0
Returns the index of the bond in its parent molecule.
virtual Atom & getAtom(std::size_t idx)=0
Returns a non-const reference to the atom at index idx.
virtual const Atom & getNeighbor(const Atom &atom) const =0
Returns a const reference to the connected neighbor of the argument atom.
Bond & operator=(const Bond &bond)
Assignment operator that replaces the current set of properties with the properties of bond;.
virtual std::size_t getNumAtoms() const =0
Returns the number of atoms connected by the bond.
virtual Atom & getBegin()=0
Returns a non-const reference to the start atom of the bond.
AtomContainer::ConstAtomIterator ConstAtomIterator
A constant random access iterator used to iterate over the connected atoms.
Definition: Bond.hpp:61
virtual const Molecule & getMolecule() const =0
Returns a const reference to the parent molecule.
virtual const Atom & getBegin() const =0
Returns a const reference to the start atom of the bond.
virtual bool containsAtom(const Atom &atom) const =0
Tells whether the bond is incident to the specified atom.
virtual Molecule & getMolecule()=0
Returns a non-const reference to the parent molecule.
AtomContainer::AtomIterator AtomIterator
A mutable random access iterator used to iterate over the connected atoms.
Definition: Bond.hpp:56
virtual Atom & getNeighbor(const Atom &atom)=0
Returns a non-const reference to the connected neighbor of the argument atom.
virtual const Atom & getEnd() const =0
Returns a const reference to the end atom of the bond.
virtual ~Bond()
Virtual destructor.
Definition: Bond.hpp:187
virtual std::size_t getAtomIndex(const Atom &atom) const =0
Returns the index of the specified atom.
Molecule.
Definition: Molecule.hpp:49
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
The namespace of the Chemical Data Processing Library.