Ignore:
Timestamp:
Mar 3, 2010, 5:47:40 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
4938aa, f058ef
Parents:
14d898
Message:

Added mechanisms that allow reuse of IDs and changing Ids of Atoms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/atom.hpp

    r14d898 r3746aeb  
    4040 */
    4141class atom : public TesselPoint, public TrajectoryParticle, public GraphNode, public BondedParticle, public virtual ParticleInfo, public virtual AtomInfo {
    42   friend atom* NewAtom();
     42  friend atom* NewAtom(atomId_t);
    4343  friend void  DeleteAtom(atom*);
    4444  public:
     
    8080
    8181  virtual int getId();
    82   virtual void setId(int);
     82  virtual bool changeId(atomId_t newId);
     83
     84  /**
     85   * this function sets the Id without notifying the world. Only use it, if the world has already
     86   * gotten an ID for this Atom.
     87   */
     88   virtual void setId(atomId_t);
     89
    8390  protected:
    8491    /**
     
    101108  private:
    102109    World* world;
    103     int id;
     110    atomId_t id;
    104111};
    105112
     
    109116 * Use World::createAtom() instead.
    110117 */
    111 atom* NewAtom();
     118atom* NewAtom(atomId_t _id);
    112119
    113120/**
Note: See TracChangeset for help on using the changeset viewer.