source: molecuilder/src/atom_particleinfo.cpp@ ffb6bf

CommandLineUI_start
Last change on this file since ffb6bf 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
Line 
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 */
13ParticleInfo::ParticleInfo() : nr(-1), name("Unknown") {
14};
15
16ParticleInfo::ParticleInfo(ParticleInfo *pointer) :
17 nr(pointer->nr),
18 name(pointer->name)
19 {}
20
21
22/** Destructor of ParticleInfo.
23 */
24ParticleInfo::~ParticleInfo()
25{};
26
27const string& ParticleInfo::getName() const{
28 return name;
29}
30
31void ParticleInfo::setName(const string& _name){
32 name = _name;
33}
34
35ostream & operator << (ostream &ost, const ParticleInfo &a)
36{
37 ost << "[" << a.getName() << "|" << &a << "]";
38 return ost;
39};
40
41ostream & ParticleInfo::operator << (ostream &ost) const
42{
43 ost << "[" << name << "|" << this << "]";
44 return ost;
45};
46
Note: See TracBrowser for help on using the repository browser.