Changes in src/molecule.hpp [c67ff9:4d2b33]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.hpp
rc67ff9 r4d2b33 21 21 #include <vector> 22 22 23 #include <boost/iterator/transform_iterator.hpp> 24 23 25 #include <string> 24 26 25 #include "AtomIdSet.hpp"26 27 #include "Atom/AtomSet.hpp" 27 28 #include "CodePatterns/Cacheable.hpp" 28 29 #include "CodePatterns/Observer/Observable.hpp" 30 #include "CodePatterns/Observer/ObservedIterator.hpp" 29 31 #include "Descriptors/AtomIdDescriptor.hpp" 30 32 #include "Fragmentation/HydrogenSaturation_enum.hpp" … … 33 35 #include "IdPool_policy.hpp" 34 36 #include "IdPool.hpp" 35 #include "Shapes/Shape.hpp"36 37 #include "types.hpp" 38 39 // TODO: Was is the include of MoleculeDescriptor_impl.hpp doing in molecule.hpp 40 #include "Descriptors/MoleculeDescriptor_impl.hpp" 37 41 38 42 /****************************************** forward declarations *****************************/ … … 50 54 class MoleculeLeafClass; 51 55 class MoleculeListClass; 52 class MoleculeUnittest;56 class periodentafel; 53 57 class RealSpaceMatrix; 54 58 class Vector; 59 class Shape; 60 61 /******************************** Some definitions for easier reading **********************************/ 62 63 struct FromIdToAtom : 64 public std::unary_function<atom *, atomId_t> 65 { 66 atom * operator()(atomId_t id) const { 67 return World::getInstance().getAtom(AtomById(id)); 68 } 69 }; 55 70 56 71 /************************************* Class definitions ****************************************/ … … 61 76 class molecule : public Observable 62 77 { 63 //!> grant unit test access64 friend class MoleculeUnittest;65 //!> function may access cstor66 78 friend molecule *NewMolecule(); 67 //!> function may access dstor68 79 friend void DeleteMolecule(molecule *); 69 80 70 81 public: 71 typedef AtomIdSet::atomIdSetatomIdSet;72 typedef AtomIdSet::iteratoriterator;73 typedef AtomIdSet::const_iteratorconst_iterator;82 typedef std::set<atomId_t> atomIdSet; 83 typedef boost::transform_iterator<FromIdToAtom, atomIdSet::iterator, atom *, atomId_t> iterator; 84 typedef boost::transform_iterator<FromIdToAtom, atomIdSet::const_iterator, const atom *, atomId_t const &> const_iterator; 74 85 75 86 int MDSteps; //!< The number of MD steps in Trajectories … … 86 97 Cacheable<int> BondCount; //!< number of atoms, brought up-to-date by doCountBonds() 87 98 moleculeId_t id; 88 AtomIdSet atomIds; //<!set of atomic ids to check uniqueness of atoms99 atomIdSet atomIds; //<!set of atomic ids to check uniqueness of atoms 89 100 IdPool<atomId_t, uniqueId> atomIdPool; //!< pool of internal ids such that way may guarantee uniqueness 90 101 … … 114 125 World::AtomComposite getAtomSet() const; 115 126 116 // simply pass on all functions to AtomIdSet 117 iterator begin() { 118 return atomIds.begin(); 119 } 120 const_iterator begin() const 121 { 122 return atomIds.begin(); 123 } 124 iterator end() 125 { 126 return atomIds.end(); 127 } 128 const_iterator end() const 129 { 130 return atomIds.end(); 131 } 132 bool empty() const 133 { 134 return atomIds.empty(); 135 } 136 size_t size() const 137 { 138 return atomIds.size(); 139 } 140 const_iterator find(atom * key) const 141 { 142 return atomIds.find(key); 143 } 144 145 /** Returns the set of atomic ids contained in this molecule. 146 * 147 * @return set of atomic ids 148 */ 149 const atomIdSet & getAtomIds() const { 150 return atomIds.getAtomIds(); 151 } 152 153 std::pair<iterator, bool> insert(atom * const key); 154 127 iterator begin(); 128 const_iterator begin() const; 129 iterator end(); 130 const_iterator end() const; 131 bool empty() const; 132 size_t size() const; 133 const_iterator find(atom * key) const; 134 pair<iterator, bool> insert(atom * const key); 155 135 bool containsAtom(atom* key); 156 136 … … 165 145 */ 166 146 const_iterator erase(const_iterator loc); 167 168 147 /** Erase an atom from the list. 169 148 * \note This should only be called by atom::removeFromMolecule(), … … 198 177 199 178 public: 200 201 /** Function to create a bounding spherical shape for the currently associated atoms.202 *203 */204 Shape getBoundingShape() const;205 179 206 180 /// remove atoms from molecule. … … 255 229 bond * CopyBond(atom *left, atom *right, bond *CopyBond); 256 230 257 molecule *CopyMolecule( const Vector &offset = zeroVec) const;231 molecule *CopyMolecule() const; 258 232 molecule* CopyMoleculeFromSubRegion(const Shape&) const; 259 233
Note:
See TracChangeset
for help on using the changeset viewer.