Ignore:
Timestamp:
Feb 24, 2010, 4:21:12 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
5bf941
Parents:
01d28a
git-author:
Tillmann Crueger <crueger@…> (02/24/10 15:29:12)
git-committer:
Tillmann Crueger <crueger@…> (02/24/10 16:21:12)
Message:

Made the world solely responsible for creating and destroying atoms.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/World.hpp

    r01d28a r7bfc19  
    5858  /***** Methods to work with the World *****/
    5959  molecule *createMolecule();
     60  atom *createAtom();
     61  int registerAtom(atom*);
     62  void destroyAtom(atom*);
     63  void destroyAtom(int);
    6064
    6165  ManipulateAtomsProcess* manipulateAtoms(boost::function<void(atom*)>,std::string,AtomDescriptor);
     
    9599  periodentafel *periode;
    96100  AtomList atoms;
     101  int currAtomId; //!< stores the next available Id for atoms
    97102  std::set<molecule*> molecules;
    98103
     
    120125  MoleculeListClass *&getMolecules();
    121126
    122   // functions used for the WorldContent template mechanism
    123   void registerAtom(atom *theAtom);
    124   void unregisterAtom(atom *theAtom);
    125127private:
    126   // this function cleans up anything that cannot be cleaned while the lock is active
    127   // at a later point all these cleanups have to be moved to the World Class so the deadlock and
    128   // race condition can both be avoided.
    129   void destroyLegacy();
    130 
    131128  MoleculeListClass *molecules_deprecated;
    132 
    133   // this is needed to assign unique IDs to atoms... so far
    134   // IDs are not assigned upon Atom creation, so we cannot query the ID
    135   // during construction. By using the dummy ID we can make sure all atoms
    136   // are actually stored in the map and don't overwrite each other.
    137   int dummyId;
    138129};
    139130
Note: See TracChangeset for help on using the changeset viewer.