Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/atom_particleinfo.cpp

    ra3696f r68f03d  
    1111/** Constructor of ParticleInfo.
    1212 */
    13 ParticleInfo::ParticleInfo() : nr(-1), Name(NULL) {};
     13ParticleInfo::ParticleInfo() : nr(-1), name("Unknown") {
     14};
     15
     16ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
     17    nr(pointer->nr),
     18    name(pointer->name)
     19    {}
     20
    1421
    1522/** Destructor of ParticleInfo.
    1623 */
    1724ParticleInfo::~ParticleInfo()
    18 {
    19   Free(&Name);
    20 };
     25{};
     26
     27const string& ParticleInfo::getName() const{
     28  return name;
     29}
     30
     31void ParticleInfo::setName(const string& _name){
     32  name = _name;
     33}
    2134
    2235ostream & operator << (ostream &ost, const ParticleInfo &a)
    2336{
    24   if (a.Name == NULL)
    25     ost << "[NULL]";
    26   else
    27     ost << "[" << a.Name << "|" << &a << "]";
     37  ost << "[" << a.getName() << "|" << &a << "]";
    2838  return ost;
    2939};
     
    3141ostream & ParticleInfo::operator << (ostream &ost) const
    3242{
    33   if (Name == NULL)
    34     ost << "[NULL]";
    35   else
    36     ost << "[" << Name << "|" << this << "]";
     43  ost << "[" << name << "|" << this << "]";
    3744  return ost;
    3845};
Note: See TracChangeset for help on using the changeset viewer.