author | Markus Bröker <mbroeker@largo.dyndns.tv> |
Thu, 28 May 2009 16:51:26 +0200 | |
changeset 95 | d2a071bd1a60 |
parent 77 | 49e0babccb23 |
permissions | -rw-r--r-- |
42
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
1 |
/** |
77 | 2 |
* pmc/object.cc |
42
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
3 |
* Copyright (C) 2008 Markus Broeker |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
4 |
*/ |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
5 |
|
65
76514757b0d6
GNU Indent cannot handle C++ Source Files...
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
54
diff
changeset
|
6 |
#include <object.hpp> |
42
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
7 |
|
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
8 |
#include <iostream> |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
9 |
|
54
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
10 |
int refCounter = 0; |
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
11 |
|
42
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
12 |
Object::~Object () |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
13 |
{ |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
14 |
#ifdef DEBUG |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
15 |
std::cerr << "Freeing Object " << name << std::endl; |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
16 |
#endif |
54
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
17 |
refCounter--; |
42
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
18 |
} |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
19 |
|
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
20 |
std::string Object::getName () |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
21 |
{ |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
22 |
return name; |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
23 |
} |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
24 |
|
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
25 |
Object Object::getClass () |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
26 |
{ |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
27 |
return *this; |
83b8151b966d
Klassenhierarchie erneuert, Codebase erneuert
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
diff
changeset
|
28 |
} |
54
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
29 |
|
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
30 |
int Object::getInstances () |
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
31 |
{ |
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
32 |
return refCounter; |
c064ce9f40f5
Vector and PMC ChangeLog
Markus Bröker <mbroeker@largo.dyndns.tv>
parents:
42
diff
changeset
|
33 |
} |