Ignore:
Timestamp:
Feb 25, 2010, 4:43:02 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
3db67e
Parents:
2e6496
Message:

Made the world solely responsible for creating and erasing molecules.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/molecule.hpp

    r2e6496 r8d9d38  
    2929#include <string>
    3030
     31#include "defs.hpp"
    3132#include "graph.hpp"
    3233#include "stackclass.hpp"
     
    8586 */
    8687class molecule : public PointCloud , public Observable {
     88  friend molecule *NewMolecule();
     89  friend void DeleteMolecule(molecule *);
    8790  public:
    8891    double cell_size[6];//!< cell size
     
    108111  private:
    109112    Cacheable<string> formula;
     113    moleculeId_t id;
     114  protected:
     115    molecule(const periodentafel * const teil);
     116    virtual ~molecule();
     117
    110118
    111119public:
    112   molecule(const periodentafel * const teil);
    113   virtual ~molecule();
    114 
    115120  //getter and setter
    116121  const std::string getName();
     122  moleculeId_t getId();
     123  void setId(moleculeId_t);
    117124  void setName(const std::string);
    118125  const std::string getFormula();
    119126  std::string calcFormula();
     127
    120128
    121129  // re-definition of virtual functions from PointCloud
     
    321329};
    322330
     331molecule *NewMolecule();
     332void DeleteMolecule(molecule* mol);
     333
    323334#include "molecule_template.hpp"
    324335
     
    330341    int MaxIndex;
    331342
    332   MoleculeListClass();
     343  MoleculeListClass(World *world);
    333344  ~MoleculeListClass();
    334345
     
    363374
    364375  private:
     376  World *world; //!< The world this List belongs to. Needed to avoid deadlocks in the destructor
    365377};
    366378
Note: See TracChangeset for help on using the changeset viewer.