Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/atom_particleinfo.cpp

    r68f03d ra3696f  
    1111/** Constructor of ParticleInfo.
    1212 */
    13 ParticleInfo::ParticleInfo() : nr(-1), name("Unknown") {
    14 };
    15 
    16 ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
    17     nr(pointer->nr),
    18     name(pointer->name)
    19     {}
    20 
     13ParticleInfo::ParticleInfo() : nr(-1), Name(NULL) {};
    2114
    2215/** Destructor of ParticleInfo.
    2316 */
    2417ParticleInfo::~ParticleInfo()
    25 {};
    26 
    27 const string& ParticleInfo::getName() const{
    28   return name;
    29 }
    30 
    31 void ParticleInfo::setName(const string& _name){
    32   name = _name;
    33 }
     18{
     19  Free(&Name);
     20};
    3421
    3522ostream & operator << (ostream &ost, const ParticleInfo &a)
    3623{
    37   ost << "[" << a.getName() << "|" << &a << "]";
     24  if (a.Name == NULL)
     25    ost << "[NULL]";
     26  else
     27    ost << "[" << a.Name << "|" << &a << "]";
    3828  return ost;
    3929};
     
    4131ostream & ParticleInfo::operator << (ostream &ost) const
    4232{
    43   ost << "[" << name << "|" << this << "]";
     33  if (Name == NULL)
     34    ost << "[NULL]";
     35  else
     36    ost << "[" << Name << "|" << this << "]";
    4437  return ost;
    4538};
Note: See TracChangeset for help on using the changeset viewer.