indigoX
iters.hpp
Go to the documentation of this file.
1 //
2 // iters.hpp
3 // indigox
4 //
5 // Created by Ivan Welsh on 7/01/18.
6 // Copyright © 2018 Hermes Productions. All rights reserved.
7 //
8 
9 #include "atom.hpp"
10 #include "bond.hpp"
11 #include "molecule.hpp"
12 
13 #include <array>
14 #include <cstdint>
15 #include <unordered_map>
16 #include <vector>
17 
18 #ifndef INDIGOX_CLASSES_ITERS_HPP
19 #define INDIGOX_CLASSES_ITERS_HPP
20 
21 namespace indigox {
22 
23  enum IteratorType {
30  };
31 
32  class AtomIterator {
33  public:
34  AtomIterator();
38  AtomIterator(const AtomIterator &);
39  ~AtomIterator();
40 
42  operator bool() const;
43  // Preincrement
45  // Post increment
47  // Shared pointer to current atom
48  Atom operator->() const;
49  Atom operator*() const;
50 
51  private:
52  void ResetToOther(const AtomIterator &);
53 
54  private:
55  IteratorType type_;
56  MolAtomIterator itMol_;
57  Molecule parentMol_;
58  BondAtomIterator itBond_;
59  Bond parentBond_;
60  AtomBondIter itAtom_;
61  Atom parentAtom_;
62 
63  Atom ptr_;
64  };
65 } // namespace indigox
66 
67 #endif /* INDIGOX_CLASSES_ITERS_HPP */
Definition: iters.hpp:27
Definition: bond.hpp:11
Definition: atom.hpp:13
Definition: iters.hpp:25
Definition: iters.hpp:24
Atom operator *() const
Definition: iters.hpp:29
IteratorType
Definition: iters.hpp:23
Namespace for all graph related functionality.
Definition: access.hpp:7
Definition: iters.hpp:32
Atom operator->() const
AtomIterator & operator++()
Definition: molecule.hpp:15
AtomIterator & operator=(const AtomIterator &)
Definition: iters.hpp:28
Definition: iters.hpp:26