RDKit
Open-source cheminformatics and machine learning.
BondIterators.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2002-2006 Greg Landrum and Rational Discovery LLC
3 //
4 // @@ All Rights Reserved @@
5 // This file is part of the RDKit.
6 // The contents are covered by the terms of the BSD license
7 // which is included in the file license.txt, found at the root
8 // of the RDKit source tree.
9 //
10 /*! \file BondIterators.h
11 
12  \brief various tools for iterating over a molecule's Bonds
13 
14  <b>WARNING:</b> If you go changing the molecule underneath one of
15  these iterators you will be sad...
16 */
17 #include <RDGeneral/export.h>
18 #ifndef _RD_BOND_ITERATORS_H
19 #define _RD_BOND_ITERATORS_H
20 
21 #include "ROMol.h"
22 
23 namespace RDKit {
24 
25 //! \brief iterator for a molecule's bonds, currently BiDirectional,
26 //! but it theoretically ought to be RandomAccess.
28  // FIX: I'm not pleased with the lack of internal testing code
29  // (PREs and the like) in here
30  public:
31  BondIterator_() : _mol(NULL){};
33  BondIterator_(ROMol *mol, ROMol::EDGE_ITER pos);
36  bool operator==(const BondIterator_ &other) const;
37  bool operator!=(const BondIterator_ &other) const;
38  Bond *operator*() const;
39  // pre-increment
42  // pre-decrement
45 
46  private:
47  ROMol::EDGE_ITER _beg, _end, _pos;
48  ROMol *_mol;
49 };
50 //! \brief const iterator for a molecule's bonds, currently BiDirectional,
51 //! but it theoretically ought to be RandomAccess.
53  public:
54  ConstBondIterator_() : _mol(NULL){};
56  ConstBondIterator_(ROMol const *mol, ROMol::EDGE_ITER pos);
59  bool operator==(const ConstBondIterator_ &other) const;
60  bool operator!=(const ConstBondIterator_ &other) const;
61  Bond const *operator*() const;
62  // pre-increment
65  // pre-decrement
68 
69  private:
70  ROMol::EDGE_ITER _beg, _end, _pos;
71  ROMol const *_mol;
72 };
73 } // namespace RDKit
74 
75 #endif
RDKit::BondIterator_::operator++
BondIterator_ & operator++()
ROMol.h
Defines the primary molecule class ROMol as well as associated typedefs.
RDKit::BondIterator_::operator!=
bool operator!=(const BondIterator_ &other) const
RDKit::ConstBondIterator_::operator!=
bool operator!=(const ConstBondIterator_ &other) const
RDKit::Bond
class for representing a bond
Definition: Bond.h:47
RDKit::BondIterator_::BondIterator_
BondIterator_(ROMol *mol, ROMol::EDGE_ITER pos)
RDKit::ConstBondIterator_::operator--
ConstBondIterator_ & operator--()
RDKit::BondIterator_::operator--
BondIterator_ operator--(int)
RDKit::BondIterator_::BondIterator_
BondIterator_(const BondIterator_ &other)
RDKit::ConstBondIterator_::operator=
ConstBondIterator_ & operator=(const ConstBondIterator_ &other)
RDKit::BondIterator_::BondIterator_
BondIterator_()
Definition: BondIterators.h:31
RDKit::ROMol
Definition: ROMol.h:171
RDKit::BondIterator_::BondIterator_
BondIterator_(ROMol *mol)
RDKit::ConstBondIterator_
const iterator for a molecule's bonds, currently BiDirectional, but it theoretically ought to be Rand...
Definition: BondIterators.h:52
RDKIT_GRAPHMOL_EXPORT
#define RDKIT_GRAPHMOL_EXPORT
Definition: export.h:307
RDKit::ConstBondIterator_::ConstBondIterator_
ConstBondIterator_(const ConstBondIterator_ &other)
RDKit::BondIterator_::operator=
BondIterator_ & operator=(const BondIterator_ &other)
RDKit::ConstBondIterator_::operator==
bool operator==(const ConstBondIterator_ &other) const
RDKit::BondIterator_::operator++
BondIterator_ operator++(int)
RDKit::BondIterator_
iterator for a molecule's bonds, currently BiDirectional, but it theoretically ought to be RandomAcce...
Definition: BondIterators.h:27
RDKit::ConstBondIterator_::operator++
ConstBondIterator_ operator++(int)
RDKit::BondIterator_::operator==
bool operator==(const BondIterator_ &other) const
RDKit::ConstBondIterator_::ConstBondIterator_
ConstBondIterator_(ROMol const *mol)
RDKit
Std stuff.
Definition: Atom.h:30
RDKit::ConstBondIterator_::operator--
ConstBondIterator_ operator--(int)
RDKit::ConstBondIterator_::ConstBondIterator_
ConstBondIterator_(ROMol const *mol, ROMol::EDGE_ITER pos)
RDKit::BondIterator_::operator*
Bond * operator*() const
RDKit::ConstBondIterator_::operator++
ConstBondIterator_ & operator++()
RDKit::ConstBondIterator_::operator*
Bond const * operator*() const
RDKit::ConstBondIterator_::ConstBondIterator_
ConstBondIterator_()
Definition: BondIterators.h:54
RDKit::BondIterator_::operator--
BondIterator_ & operator--()
export.h