Last change
on this file since e34098 was e760c1, checked in by Frederik Heber <heber@…>, 15 years ago |
ofstream operators now check for Name being NULL and print NULL in that case.
Signed-off-by: Frederik Heber <heber@…>
|
-
Property mode
set to
100644
|
File size:
678 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 | */
|
---|
13 | ParticleInfo::ParticleInfo() : nr(-1), Name(NULL) {};
|
---|
14 |
|
---|
15 | /** Destructor of ParticleInfo.
|
---|
16 | */
|
---|
17 | ParticleInfo::~ParticleInfo()
|
---|
18 | {
|
---|
19 | Free(&Name);
|
---|
20 | };
|
---|
21 |
|
---|
22 | ostream & operator << (ostream &ost, const ParticleInfo &a)
|
---|
23 | {
|
---|
24 | if (a.Name == NULL)
|
---|
25 | ost << "[NULL]";
|
---|
26 | else
|
---|
27 | ost << "[" << a.Name << "|" << &a << "]";
|
---|
28 | return ost;
|
---|
29 | };
|
---|
30 |
|
---|
31 | ostream & ParticleInfo::operator << (ostream &ost) const
|
---|
32 | {
|
---|
33 | if (Name == NULL)
|
---|
34 | ost << "[NULL]";
|
---|
35 | else
|
---|
36 | ost << "[" << Name << "|" << this << "]";
|
---|
37 | return ost;
|
---|
38 | };
|
---|
39 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.