source: molecuilder/src/atom_particleinfo.cpp@ 0341a9

Last change on this file since 0341a9 was 1de701, checked in by Tillmann Crueger <crueger@…>, 16 years ago

FIX: Memory corruption in particleInfo class

  • Property mode set to 100644
File size: 808 bytes
RevLine 
[2e2a70]1/*
2 * atom_particleinfo.cpp
3 *
4 * Created on: Oct 19, 2009
5 * Author: heber
6 */
7
8#include "atom_particleinfo.hpp"
9#include "memoryallocator.hpp"
10
11/** Constructor of ParticleInfo.
12 */
[1de701]13ParticleInfo::ParticleInfo() : nr(-1), name("Unknown") {
14};
[2e2a70]15
[7bfc19]16ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
[98a2987]17 nr(pointer->nr),
[1de701]18 name(pointer->name)
[7bfc19]19 {}
20
21
[2e2a70]22/** Destructor of ParticleInfo.
23 */
24ParticleInfo::~ParticleInfo()
[1de701]25{};
26
27const string& ParticleInfo::getName() const{
28 return name;
29}
30
31void ParticleInfo::setName(const string& _name){
32 name = _name;
33}
[2e2a70]34
[94d0ad]35ostream & operator << (ostream &ost, const ParticleInfo &a)
36{
[1de701]37 ost << "[" << a.getName() << "|" << &a << "]";
[94d0ad]38 return ost;
39};
40
41ostream & ParticleInfo::operator << (ostream &ost) const
42{
[1de701]43 ost << "[" << name << "|" << this << "]";
[94d0ad]44 return ost;
45};
46
Note: See TracBrowser for help on using the repository browser.