| [5d1611] | 1 | /*
 | 
|---|
 | 2 |  * World.hpp
 | 
|---|
 | 3 |  *
 | 
|---|
 | 4 |  *  Created on: Feb 3, 2010
 | 
|---|
 | 5 |  *      Author: crueger
 | 
|---|
 | 6 |  */
 | 
|---|
 | 7 | 
 | 
|---|
 | 8 | #ifndef WORLD_HPP_
 | 
|---|
 | 9 | #define WORLD_HPP_
 | 
|---|
 | 10 | 
 | 
|---|
| [b34306] | 11 | /*********************************************** includes ***********************************/
 | 
|---|
 | 12 | 
 | 
|---|
| [7c4e29] | 13 | #include <string>
 | 
|---|
| [d346b6] | 14 | #include <map>
 | 
|---|
| [fc1b24] | 15 | #include <vector>
 | 
|---|
| [354859] | 16 | #include <set>
 | 
|---|
| [7c4e29] | 17 | #include <boost/thread.hpp>
 | 
|---|
| [865a945] | 18 | #include <boost/shared_ptr.hpp>
 | 
|---|
| [5d1611] | 19 | 
 | 
|---|
| [ead4e6] | 20 | #include "types.hpp"
 | 
|---|
| [6e97e5] | 21 | #include "Descriptors/SelectiveIterator.hpp"
 | 
|---|
| [5d1611] | 22 | #include "Patterns/Observer.hpp"
 | 
|---|
 | 23 | #include "Patterns/Cacheable.hpp"
 | 
|---|
| [23b547] | 24 | #include "Patterns/Singleton.hpp"
 | 
|---|
| [b99bf3] | 25 | #include "Patterns/ObservedContainer.hpp"
 | 
|---|
| [23b547] | 26 | 
 | 
|---|
| [b34306] | 27 | // include config.h
 | 
|---|
 | 28 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 29 | #include <config.h>
 | 
|---|
 | 30 | #endif
 | 
|---|
| [5d1611] | 31 | 
 | 
|---|
 | 32 | // forward declarations
 | 
|---|
| [4d9c01] | 33 | class atom;
 | 
|---|
| [fc1b24] | 34 | class AtomDescriptor;
 | 
|---|
| [7a1ce5] | 35 | class AtomDescriptor_impl;
 | 
|---|
| [43dad6] | 36 | template<typename T> class AtomsCalculation;
 | 
|---|
| [84c494] | 37 | class Box;
 | 
|---|
| [43dad6] | 38 | class config;
 | 
|---|
 | 39 | class ManipulateAtomsProcess;
 | 
|---|
| [84c494] | 40 | class Matrix;
 | 
|---|
| [43dad6] | 41 | class molecule;
 | 
|---|
| [1c51c8] | 42 | class MoleculeDescriptor;
 | 
|---|
 | 43 | class MoleculeDescriptor_impl;
 | 
|---|
| [43dad6] | 44 | class MoleculeListClass;
 | 
|---|
 | 45 | class periodentafel;
 | 
|---|
 | 46 | class ThermoStatContainer;
 | 
|---|
| [5d1611] | 47 | 
 | 
|---|
| [fa0b18] | 48 | 
 | 
|---|
| [b34306] | 49 | /****************************************** forward declarations *****************************/
 | 
|---|
| [23b547] | 50 | 
 | 
|---|
| [b34306] | 51 | /********************************************** Class World *******************************/
 | 
|---|
| [23b547] | 52 | 
 | 
|---|
 | 53 | class World : public Singleton<World>, public Observable
 | 
|---|
| [5d1611] | 54 | {
 | 
|---|
| [23b547] | 55 | 
 | 
|---|
 | 56 | // Make access to constructor and destructor possible from inside the singleton
 | 
|---|
 | 57 | friend class Singleton<World>;
 | 
|---|
 | 58 | 
 | 
|---|
| [b54ac8] | 59 | // necessary for coupling with descriptors
 | 
|---|
| [7a1ce5] | 60 | friend class AtomDescriptor_impl;
 | 
|---|
| [865a945] | 61 | friend class AtomDescriptor;
 | 
|---|
| [1c51c8] | 62 | friend class MoleculeDescriptor_impl;
 | 
|---|
 | 63 | friend class MoleculeDescriptor;
 | 
|---|
| [41aa39] | 64 | // coupling with descriptors over selection
 | 
|---|
 | 65 | friend class AtomSelectionDescriptor_impl;
 | 
|---|
| [cf0ca1] | 66 | friend class MoleculeSelectionDescriptor_impl;
 | 
|---|
| [865a945] | 67 | 
 | 
|---|
| [b54ac8] | 68 | // Actions, calculations etc associated with the World
 | 
|---|
| [7c4e29] | 69 | friend class ManipulateAtomsProcess;
 | 
|---|
| [b54ac8] | 70 | template<typename> friend class AtomsCalculation;
 | 
|---|
| [5d1611] | 71 | public:
 | 
|---|
| [23b547] | 72 | 
 | 
|---|
 | 73 |   // Types for Atom and Molecule structures
 | 
|---|
| [4ef9b7] | 74 |   typedef ObservedContainer<std::map<atomId_t,atom*> > AtomSet;
 | 
|---|
| [51be2a] | 75 |   typedef ObservedContainer<std::map<moleculeId_t,molecule*> > MoleculeSet;
 | 
|---|
| [5d1611] | 76 | 
 | 
|---|
 | 77 |   /***** getter and setter *****/
 | 
|---|
| [354859] | 78 |   // reference to pointer is used for legacy reason... reference will be removed latter to keep encapsulation of World object
 | 
|---|
| [02ee15] | 79 |   /**
 | 
|---|
 | 80 |    * returns the periodentafel for the world.
 | 
|---|
 | 81 |    */
 | 
|---|
| [354859] | 82 |   periodentafel *&getPeriode();
 | 
|---|
| [02ee15] | 83 | 
 | 
|---|
| [8e1f7af] | 84 |   /**
 | 
|---|
 | 85 |    * returns the configuration for the world.
 | 
|---|
 | 86 |    */
 | 
|---|
 | 87 |   config *&getConfig();
 | 
|---|
 | 88 | 
 | 
|---|
| [02ee15] | 89 |   /**
 | 
|---|
 | 90 |    * returns the first atom that matches a given descriptor.
 | 
|---|
 | 91 |    * Do not rely on ordering for descriptors that match more than one atom.
 | 
|---|
 | 92 |    */
 | 
|---|
| [7a1ce5] | 93 |   atom* getAtom(AtomDescriptor descriptor);
 | 
|---|
| [02ee15] | 94 | 
 | 
|---|
 | 95 |   /**
 | 
|---|
 | 96 |    * returns a vector containing all atoms that match a given descriptor
 | 
|---|
 | 97 |    */
 | 
|---|
| [7a1ce5] | 98 |   std::vector<atom*> getAllAtoms(AtomDescriptor descriptor);
 | 
|---|
| [0e2a47] | 99 |   std::vector<atom*> getAllAtoms();
 | 
|---|
| [b54ac8] | 100 | 
 | 
|---|
| [02ee15] | 101 |   /**
 | 
|---|
 | 102 |    * returns a calculation that calls a given function on all atoms matching a descriptor.
 | 
|---|
 | 103 |    * the calculation is not called at this point and can be used as an action, i.e. be stored in
 | 
|---|
 | 104 |    * menus, be kept around for later use etc.
 | 
|---|
 | 105 |    */
 | 
|---|
| [0e2a47] | 106 |   template<typename T> AtomsCalculation<T>* calcOnAtoms(boost::function<T(atom*)>,std::string,AtomDescriptor);
 | 
|---|
 | 107 |   template<typename T> AtomsCalculation<T>* calcOnAtoms(boost::function<T(atom*)>,std::string);
 | 
|---|
| [b54ac8] | 108 | 
 | 
|---|
| [02ee15] | 109 |   /**
 | 
|---|
 | 110 |    * get the number of atoms in the World
 | 
|---|
 | 111 |    */
 | 
|---|
| [354859] | 112 |   int numAtoms();
 | 
|---|
| [02ee15] | 113 | 
 | 
|---|
| [1c51c8] | 114 |   /**
 | 
|---|
 | 115 |    * returns the first molecule that matches a given descriptor.
 | 
|---|
 | 116 |    * Do not rely on ordering for descriptors that match more than one molecule.
 | 
|---|
 | 117 |    */
 | 
|---|
 | 118 |   molecule *getMolecule(MoleculeDescriptor descriptor);
 | 
|---|
 | 119 | 
 | 
|---|
 | 120 |   /**
 | 
|---|
 | 121 |    * returns a vector containing all molecules that match a given descriptor
 | 
|---|
 | 122 |    */
 | 
|---|
 | 123 |   std::vector<molecule*> getAllMolecules(MoleculeDescriptor descriptor);
 | 
|---|
| [97ebf8] | 124 |   std::vector<molecule*> getAllMolecules();
 | 
|---|
| [1c51c8] | 125 | 
 | 
|---|
| [02ee15] | 126 |   /**
 | 
|---|
 | 127 |    * get the number of molecules in the World
 | 
|---|
 | 128 |    */
 | 
|---|
| [354859] | 129 |   int numMolecules();
 | 
|---|
 | 130 | 
 | 
|---|
| [5f612ee] | 131 |   /**
 | 
|---|
 | 132 |    * get the domain size as a symmetric matrix (6 components)
 | 
|---|
 | 133 |    */
 | 
|---|
| [84c494] | 134 |   Box& getDomain();
 | 
|---|
 | 135 | 
 | 
|---|
 | 136 |   /**
 | 
|---|
 | 137 |    * Set the domain size from a matrix object
 | 
|---|
 | 138 |    *
 | 
|---|
 | 139 |    * Matrix needs to be symmetric
 | 
|---|
 | 140 |    */
 | 
|---|
 | 141 |   void setDomain(const Matrix &mat);
 | 
|---|
| [5f612ee] | 142 | 
 | 
|---|
 | 143 |   /**
 | 
|---|
 | 144 |    * set the domain size as a symmetric matrix (6 components)
 | 
|---|
 | 145 |    */
 | 
|---|
 | 146 |   void setDomain(double * matrix);
 | 
|---|
 | 147 | 
 | 
|---|
 | 148 |   /**
 | 
|---|
 | 149 |    * get the default name
 | 
|---|
 | 150 |    */
 | 
|---|
| [387b36] | 151 |   std::string getDefaultName();
 | 
|---|
| [5f612ee] | 152 | 
 | 
|---|
 | 153 |   /**
 | 
|---|
 | 154 |    * set the default name
 | 
|---|
 | 155 |    */
 | 
|---|
| [387b36] | 156 |   void setDefaultName(std::string name);
 | 
|---|
| [5f612ee] | 157 | 
 | 
|---|
| [43dad6] | 158 |   /**
 | 
|---|
 | 159 |    * get pointer to World's ThermoStatContainer
 | 
|---|
 | 160 |    */
 | 
|---|
 | 161 |   ThermoStatContainer * getThermostats();
 | 
|---|
 | 162 | 
 | 
|---|
| [e4b5de] | 163 |   /*
 | 
|---|
 | 164 |    * get the ExitFlag
 | 
|---|
 | 165 |    */
 | 
|---|
 | 166 |   int getExitFlag();
 | 
|---|
 | 167 | 
 | 
|---|
 | 168 |   /*
 | 
|---|
 | 169 |    * set the ExitFlag
 | 
|---|
 | 170 |    */
 | 
|---|
 | 171 |   void setExitFlag(int flag);
 | 
|---|
 | 172 | 
 | 
|---|
| [354859] | 173 |   /***** Methods to work with the World *****/
 | 
|---|
| [02ee15] | 174 | 
 | 
|---|
 | 175 |   /**
 | 
|---|
 | 176 |    * create a new molecule. This method should be used whenever any kind of molecule is needed. Assigns a unique
 | 
|---|
 | 177 |    * ID to the molecule and stores it in the World for later retrieval. Do not create molecules directly.
 | 
|---|
 | 178 |    */
 | 
|---|
| [354859] | 179 |   molecule *createMolecule();
 | 
|---|
| [02ee15] | 180 | 
 | 
|---|
| [cbc5fb] | 181 |   void destroyMolecule(molecule*);
 | 
|---|
 | 182 |   void destroyMolecule(moleculeId_t);
 | 
|---|
 | 183 | 
 | 
|---|
| [02ee15] | 184 |   /**
 | 
|---|
 | 185 |    * Create a new atom. This method should be used whenever any atom is needed. Assigns a unique ID and stores
 | 
|---|
 | 186 |    * the atom in the World. If the atom is not destroyed it will automatically be destroyed when the world ends.
 | 
|---|
 | 187 |    */
 | 
|---|
| [46d958] | 188 |   atom *createAtom();
 | 
|---|
| [02ee15] | 189 | 
 | 
|---|
 | 190 |   /**
 | 
|---|
 | 191 |    * Registers a Atom unknown to world. Needed in some rare cases, e.g. when cloning atoms, or in some unittests.
 | 
|---|
 | 192 |    * Do not re-register Atoms already known to the world since this will cause double-frees.
 | 
|---|
 | 193 |    */
 | 
|---|
| [46d958] | 194 |   int registerAtom(atom*);
 | 
|---|
| [02ee15] | 195 | 
 | 
|---|
 | 196 |   /**
 | 
|---|
 | 197 |      * Delete some atom and erase it from the world. Use this whenever you need to destroy any atom. Do not call delete on
 | 
|---|
 | 198 |      * atom directly since this will leave the pointer inside the world.
 | 
|---|
 | 199 |    */
 | 
|---|
| [46d958] | 200 |   void destroyAtom(atom*);
 | 
|---|
| [02ee15] | 201 | 
 | 
|---|
 | 202 |   /**
 | 
|---|
 | 203 |    * Delete some atom and erase it from the world. Use this whenever you need to destroy any atom. Do not call delete on
 | 
|---|
 | 204 |    * atom directly since this will leave the pointer inside the world.
 | 
|---|
 | 205 |    */
 | 
|---|
| [cbc5fb] | 206 |   void destroyAtom(atomId_t);
 | 
|---|
| [865a945] | 207 | 
 | 
|---|
| [88d586] | 208 |   /**
 | 
|---|
 | 209 |    * used when changing an atom Id.
 | 
|---|
 | 210 |    * Unless you are calling this method from inside an atom don't fiddle with the third parameter.
 | 
|---|
 | 211 |    *
 | 
|---|
 | 212 |    * Return value indicates wether the change could be done or not.
 | 
|---|
 | 213 |    */
 | 
|---|
 | 214 |   bool changeAtomId(atomId_t oldId, atomId_t newId, atom* target=0);
 | 
|---|
 | 215 | 
 | 
|---|
| [02ee15] | 216 |   /**
 | 
|---|
 | 217 |    * Produces a process that calls a function on all Atoms matching a given descriptor. The process is not
 | 
|---|
 | 218 |    * called at this time, so it can be passed around, stored inside menuItems etc.
 | 
|---|
 | 219 |    */
 | 
|---|
| [7c4e29] | 220 |   ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string,AtomDescriptor);
 | 
|---|
| [0e2a47] | 221 |   ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string);
 | 
|---|
| [7c4e29] | 222 | 
 | 
|---|
| [fa0b18] | 223 |   /****
 | 
|---|
 | 224 |    * Iterators to use internal data structures
 | 
|---|
 | 225 |    * All these iterators are observed to track changes.
 | 
|---|
 | 226 |    * There is a corresponding protected section with unobserved iterators,
 | 
|---|
| [90c4280] | 227 |    * which can be used internally when the extra speed is needed
 | 
|---|
| [fa0b18] | 228 |    */
 | 
|---|
 | 229 | 
 | 
|---|
 | 230 |   typedef SelectiveIterator<atom*,AtomSet,AtomDescriptor>       AtomIterator;
 | 
|---|
 | 231 | 
 | 
|---|
 | 232 |   /**
 | 
|---|
 | 233 |    * returns an iterator over all Atoms matching a given descriptor.
 | 
|---|
 | 234 |    * This iterator is observed, so don't keep it around unnecessary to
 | 
|---|
 | 235 |    * avoid unintended blocking.
 | 
|---|
 | 236 |    */
 | 
|---|
 | 237 |   AtomIterator getAtomIter(AtomDescriptor descr);
 | 
|---|
 | 238 |   AtomIterator getAtomIter();
 | 
|---|
 | 239 | 
 | 
|---|
 | 240 |   AtomIterator atomEnd();
 | 
|---|
 | 241 | 
 | 
|---|
| [e3d865] | 242 |   typedef SelectiveIterator<molecule*,MoleculeSet,MoleculeDescriptor>   MoleculeIterator;
 | 
|---|
| [51be2a] | 243 | 
 | 
|---|
| [90c4280] | 244 |   /**
 | 
|---|
 | 245 |    * returns an iterator over all Molecules matching a given descriptor.
 | 
|---|
 | 246 |    * This iterator is observed, so don't keep it around unnecessary to
 | 
|---|
 | 247 |    * avoid unintended blocking.
 | 
|---|
 | 248 |    */
 | 
|---|
| [5d880e] | 249 |   MoleculeIterator getMoleculeIter(MoleculeDescriptor descr);
 | 
|---|
 | 250 |   MoleculeIterator getMoleculeIter();
 | 
|---|
 | 251 | 
 | 
|---|
 | 252 |   MoleculeIterator moleculeEnd();
 | 
|---|
 | 253 | 
 | 
|---|
| [90c4280] | 254 |   /******** Selections of molecules and Atoms *************/
 | 
|---|
 | 255 |   void clearAtomSelection();
 | 
|---|
 | 256 |   void selectAtom(atom*);
 | 
|---|
 | 257 |   void selectAtom(atomId_t);
 | 
|---|
 | 258 |   void selectAllAtoms(AtomDescriptor);
 | 
|---|
 | 259 |   void selectAtomsOfMolecule(molecule*);
 | 
|---|
 | 260 |   void selectAtomsOfMolecule(moleculeId_t);
 | 
|---|
| [61d655e] | 261 |   void unselectAtom(atom*);
 | 
|---|
 | 262 |   void unselectAtom(atomId_t);
 | 
|---|
 | 263 |   void unselectAllAtoms(AtomDescriptor);
 | 
|---|
 | 264 |   void unselectAtomsOfMolecule(molecule*);
 | 
|---|
 | 265 |   void unselectAtomsOfMolecule(moleculeId_t);
 | 
|---|
| [90c4280] | 266 | 
 | 
|---|
 | 267 |   void clearMoleculeSelection();
 | 
|---|
 | 268 |   void selectMolecule(molecule*);
 | 
|---|
 | 269 |   void selectMolecule(moleculeId_t);
 | 
|---|
 | 270 |   void selectAllMoleculess(MoleculeDescriptor);
 | 
|---|
 | 271 |   void selectMoleculeOfAtom(atom*);
 | 
|---|
 | 272 |   void selectMoleculeOfAtom(atomId_t);
 | 
|---|
| [61d655e] | 273 |   void unselectMolecule(molecule*);
 | 
|---|
 | 274 |   void unselectMolecule(moleculeId_t);
 | 
|---|
 | 275 |   void unselectAllMoleculess(MoleculeDescriptor);
 | 
|---|
 | 276 |   void unselectMoleculeOfAtom(atom*);
 | 
|---|
 | 277 |   void unselectMoleculeOfAtom(atomId_t);
 | 
|---|
| [90c4280] | 278 | 
 | 
|---|
| [3839e5] | 279 |   /******************** Iterators to selections *****************/
 | 
|---|
 | 280 |   typedef AtomSet::iterator AtomSelectionIterator;
 | 
|---|
 | 281 |   AtomSelectionIterator beginAtomSelection();
 | 
|---|
 | 282 |   AtomSelectionIterator endAtomSelection();
 | 
|---|
 | 283 | 
 | 
|---|
 | 284 |   typedef MoleculeSet::iterator MoleculeSelectionIterator;
 | 
|---|
 | 285 |   MoleculeSelectionIterator beginMoleculeSelection();
 | 
|---|
 | 286 |   MoleculeSelectionIterator endMoleculeSelection();
 | 
|---|
 | 287 | 
 | 
|---|
| [865a945] | 288 | protected:
 | 
|---|
| [fa0b18] | 289 |   /****
 | 
|---|
 | 290 |    * Iterators to use internal data structures
 | 
|---|
 | 291 |    * All these iterators are unobserved for speed reasons.
 | 
|---|
 | 292 |    * There is a corresponding public section to these methods,
 | 
|---|
 | 293 |    * which produce observed iterators.*/
 | 
|---|
| [1c51c8] | 294 | 
 | 
|---|
 | 295 |   // Atoms
 | 
|---|
| [e3d865] | 296 |   typedef SelectiveIterator<atom*,AtomSet::set_t,AtomDescriptor>        internal_AtomIterator;
 | 
|---|
| [865a945] | 297 | 
 | 
|---|
| [02ee15] | 298 |   /**
 | 
|---|
 | 299 |    * returns an iterator over all Atoms matching a given descriptor.
 | 
|---|
 | 300 |    * used for internal purposes, like AtomProcesses and AtomCalculations.
 | 
|---|
 | 301 |    */
 | 
|---|
| [fa0b18] | 302 |   internal_AtomIterator getAtomIter_internal(AtomDescriptor descr);
 | 
|---|
| [02ee15] | 303 | 
 | 
|---|
 | 304 |   /**
 | 
|---|
| [d2dbac0] | 305 |    * returns an iterator to the end of the AtomSet. Due to overloading this iterator
 | 
|---|
| [02ee15] | 306 |    * can be compared to iterators produced by getAtomIter (see the mis-matching types).
 | 
|---|
 | 307 |    * Thus it can be used to detect when such an iterator is at the end of the list.
 | 
|---|
 | 308 |    * used for internal purposes, like AtomProcesses and AtomCalculations.
 | 
|---|
 | 309 |    */
 | 
|---|
| [fa0b18] | 310 |   internal_AtomIterator atomEnd_internal();
 | 
|---|
| [865a945] | 311 | 
 | 
|---|
| [1c51c8] | 312 |   // Molecules
 | 
|---|
| [e3d865] | 313 |   typedef SelectiveIterator<molecule*,MoleculeSet::set_t,MoleculeDescriptor>   internal_MoleculeIterator;
 | 
|---|
| [51be2a] | 314 | 
 | 
|---|
| [1c51c8] | 315 | 
 | 
|---|
 | 316 |   /**
 | 
|---|
 | 317 |    * returns an iterator over all Molecules matching a given descriptor.
 | 
|---|
 | 318 |    * used for internal purposes, like MoleculeProcesses and MoleculeCalculations.
 | 
|---|
 | 319 |    */
 | 
|---|
| [e3d865] | 320 |   internal_MoleculeIterator getMoleculeIter_internal(MoleculeDescriptor descr);
 | 
|---|
| [1c51c8] | 321 | 
 | 
|---|
 | 322 |   /**
 | 
|---|
 | 323 |    * returns an iterator to the end of the MoleculeSet. Due to overloading this iterator
 | 
|---|
 | 324 |    * can be compared to iterators produced by getMoleculeIter (see the mis-matching types).
 | 
|---|
 | 325 |    * Thus it can be used to detect when such an iterator is at the end of the list.
 | 
|---|
 | 326 |    * used for internal purposes, like MoleculeProcesses and MoleculeCalculations.
 | 
|---|
 | 327 |    */
 | 
|---|
| [e3d865] | 328 |   internal_MoleculeIterator moleculeEnd_internal();
 | 
|---|
| [1c51c8] | 329 | 
 | 
|---|
 | 330 | 
 | 
|---|
| [afb47f] | 331 |   /******* Internal manipulation routines for double callback and Observer mechanism ******/
 | 
|---|
 | 332 |   void doManipulate(ManipulateAtomsProcess *);
 | 
|---|
 | 333 | 
 | 
|---|
| [5d1611] | 334 | private:
 | 
|---|
| [88d586] | 335 | 
 | 
|---|
 | 336 |   atomId_t getNextAtomId();
 | 
|---|
 | 337 |   void releaseAtomId(atomId_t);
 | 
|---|
 | 338 |   bool reserveAtomId(atomId_t);
 | 
|---|
| [127a8e] | 339 |   void defragAtomIdPool();
 | 
|---|
 | 340 | 
 | 
|---|
 | 341 |   moleculeId_t getNextMoleculeId();
 | 
|---|
 | 342 |   void releaseMoleculeId(moleculeId_t);
 | 
|---|
 | 343 |   bool reserveMoleculeId(moleculeId_t);
 | 
|---|
 | 344 |   void defragMoleculeIdPool();
 | 
|---|
| [88d586] | 345 | 
 | 
|---|
| [5d1611] | 346 |   periodentafel *periode;
 | 
|---|
| [8e1f7af] | 347 |   config *configuration;
 | 
|---|
| [84c494] | 348 |   Box *cell_size;
 | 
|---|
| [387b36] | 349 |   std::string defaultName;
 | 
|---|
| [43dad6] | 350 |   class ThermoStatContainer *Thermostats;
 | 
|---|
| [e4b5de] | 351 |   int ExitFlag;
 | 
|---|
| [6e97e5] | 352 | private:
 | 
|---|
| [127a8e] | 353 | 
 | 
|---|
| [1a76a6] | 354 |   AtomSet atoms;
 | 
|---|
| [90c4280] | 355 |   AtomSet selectedAtoms;
 | 
|---|
| [1a76a6] | 356 |   typedef std::set<std::pair<atomId_t, atomId_t> > atomIdPool_t;
 | 
|---|
| [127a8e] | 357 |   /**
 | 
|---|
 | 358 |    * stores the pool for all available AtomIds below currAtomId
 | 
|---|
 | 359 |    *
 | 
|---|
 | 360 |    * The pool contains ranges of free ids in the form [bottom,top).
 | 
|---|
 | 361 |    */
 | 
|---|
 | 362 |   atomIdPool_t atomIdPool;
 | 
|---|
| [cbc5fb] | 363 |   atomId_t currAtomId; //!< stores the next available Id for atoms
 | 
|---|
| [127a8e] | 364 |   size_t lastAtomPoolSize; //!< size of the pool after last defrag, to skip some defrags
 | 
|---|
 | 365 |   unsigned int numAtomDefragSkips;
 | 
|---|
 | 366 | 
 | 
|---|
| [d2dbac0] | 367 |   MoleculeSet molecules;
 | 
|---|
| [90c4280] | 368 |   MoleculeSet selectedMolecules;
 | 
|---|
| [127a8e] | 369 |   typedef std::set<std::pair<moleculeId_t, moleculeId_t> > moleculeIdPool_t;
 | 
|---|
| [1a76a6] | 370 |   /**
 | 
|---|
 | 371 |    * stores the pool for all available AtomIds below currAtomId
 | 
|---|
 | 372 |    *
 | 
|---|
 | 373 |    * The pool contains ranges of free ids in the form [bottom,top).
 | 
|---|
 | 374 |    */
 | 
|---|
| [127a8e] | 375 |   moleculeIdPool_t moleculeIdPool;
 | 
|---|
| [cbc5fb] | 376 |   moleculeId_t currMoleculeId;
 | 
|---|
| [127a8e] | 377 |   size_t lastMoleculePoolSize; //!< size of the pool after last defrag, to skip some defrags
 | 
|---|
 | 378 |   unsigned int numMoleculeDefragSkips;
 | 
|---|
| [5d1611] | 379 | private:
 | 
|---|
| [02ee15] | 380 |   /**
 | 
|---|
 | 381 |    * private constructor to ensure creation of the world using
 | 
|---|
 | 382 |    * the singleton pattern.
 | 
|---|
 | 383 |    */
 | 
|---|
| [5d1611] | 384 |   World();
 | 
|---|
| [02ee15] | 385 | 
 | 
|---|
 | 386 |   /**
 | 
|---|
 | 387 |    * private destructor to ensure destruction of the world using the
 | 
|---|
 | 388 |    * singleton pattern.
 | 
|---|
 | 389 |    */
 | 
|---|
| [5d1611] | 390 |   virtual ~World();
 | 
|---|
 | 391 | 
 | 
|---|
 | 392 |   /*****
 | 
|---|
 | 393 |    * some legacy stuff that is include for now but will be removed later
 | 
|---|
 | 394 |    *****/
 | 
|---|
 | 395 | public:
 | 
|---|
| [354859] | 396 |   MoleculeListClass *&getMolecules();
 | 
|---|
| [4d9c01] | 397 | 
 | 
|---|
| [5d1611] | 398 | private:
 | 
|---|
| [354859] | 399 |   MoleculeListClass *molecules_deprecated;
 | 
|---|
| [5d1611] | 400 | };
 | 
|---|
 | 401 | 
 | 
|---|
 | 402 | #endif /* WORLD_HPP_ */
 | 
|---|