Chemical Data Processing Library C++ API - Version 1.1.1
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
CDPL::Chem::Bond::getNeighbor
virtual Atom & getNeighbor(const Atom &atom)=0
Returns a non-const reference to the connected neighbor of the argument atom.
APIPrefix.hpp
Definition of the preprocessor macro CDPL_CHEM_API.
CDPL_CHEM_API
#define CDPL_CHEM_API
Tells the compiler/linker which classes, functions and variables are part of the library API.
CDPL::Chem::Bond
Bond.
Definition: Bond.hpp:50
CDPL::Chem::Bond::getAtom
virtual const Atom & getAtom(std::size_t idx) const =0
Returns a const reference to the atom at index idx.
CDPL::Util::IndexedElementIterator
A STL compatible random access iterator for container elements accessible by index.
Definition: IndexedElementIterator.hpp:125
CDPL::Chem::Atom
Atom.
Definition: Atom.hpp:52
CDPL::Chem::Bond::getNeighbor
virtual const Atom & getNeighbor(const Atom &atom) const =0
Returns a const reference to the connected neighbor of the argument atom.
CDPL::Chem::AtomContainer::getAtomsBegin
ConstAtomIterator getAtomsBegin() const
Returns a constant iterator pointing to the beginning of the stored const Chem::Atom objects.
CDPL::Chem::Bond::AtomIterator
AtomContainer::AtomIterator AtomIterator
A mutable random access iterator used to iterate over the connected atoms.
Definition: Bond.hpp:56
CDPL::Chem::Molecule
Molecule.
Definition: Molecule.hpp:49
CDPL::Chem::AtomContainer
A common interface for data-structures that support a random access to stored Chem::Atom instances.
Definition: AtomContainer.hpp:55
AtomContainer.hpp
Definition of the class CDPL::Chem::AtomContainer.
CDPL::Chem::Bond::containsAtom
virtual bool containsAtom(const Atom &atom) const =0
Tells whether the bond is incident to the specified atom.
CDPL::Chem::Bond::getAtom
virtual Atom & getAtom(std::size_t idx)=0
Returns a non-const reference to the atom at index idx.
CDPL::Base::PropertyContainer
A class providing methods for the storage and lookup of object properties.
Definition: PropertyContainer.hpp:75
CDPL::Chem::Bond::getAtomIndex
virtual std::size_t getAtomIndex(const Atom &atom) const =0
Returns the index of the specified atom.
CDPL
The namespace of the Chemical Data Processing Library.
CDPL::Chem::Bond::getNumAtoms
virtual std::size_t getNumAtoms() const =0
Returns the number of atoms connected by the bond.
CDPL::Chem::Bond::getIndex
virtual std::size_t getIndex() const =0
Returns the index of the bond in its parent molecule.
CDPL::Chem::Bond::getEnd
virtual const Atom & getEnd() const =0
Returns a const reference to the end atom of the bond.
CDPL::Chem::Bond::~Bond
virtual ~Bond()
Virtual destructor.
Definition: Bond.hpp:187
CDPL::Chem::Bond::getMolecule
virtual const Molecule & getMolecule() const =0
Returns a const reference to the parent molecule.
CDPL::Chem::Bond::ConstAtomIterator
AtomContainer::ConstAtomIterator ConstAtomIterator
A constant random access iterator used to iterate over the connected atoms.
Definition: Bond.hpp:61
PropertyContainer.hpp
Definition of the class CDPL::Base::PropertyContainer.
CDPL::Chem::Bond::getBegin
virtual Atom & getBegin()=0
Returns a non-const reference to the start atom of the bond.
CDPL::Chem::Bond::getBegin
virtual const Atom & getBegin() const =0
Returns a const reference to the start atom of the bond.
CDPL::Chem::Bond::getEnd
virtual Atom & getEnd()=0
Returns a non-const reference to the end atom of the bond.
CDPL::Chem::AtomContainer::getAtomsEnd
ConstAtomIterator getAtomsEnd() const
Returns a constant iterator pointing to the end of the stored const Chem::Atom objects.
CDPL::Chem::Bond::getMolecule
virtual Molecule & getMolecule()=0
Returns a non-const reference to the parent molecule.