equal
deleted
inserted
replaced
5 |
5 |
6 #include <object.h> |
6 #include <object.h> |
7 |
7 |
8 #include <iostream> |
8 #include <iostream> |
9 |
9 |
|
10 int refCounter = 0; |
|
11 |
10 Object::~Object () |
12 Object::~Object () |
11 { |
13 { |
12 #ifdef DEBUG |
14 #ifdef DEBUG |
13 std::cerr << "Freeing Object " << name << std::endl; |
15 std::cerr << "Freeing Object " << name << std::endl; |
14 #endif |
16 #endif |
|
17 refCounter--; |
15 } |
18 } |
16 |
19 |
17 std::string Object::getName () |
20 std::string Object::getName () |
18 { |
21 { |
19 return name; |
22 return name; |
21 |
24 |
22 Object Object::getClass () |
25 Object Object::getClass () |
23 { |
26 { |
24 return *this; |
27 return *this; |
25 } |
28 } |
|
29 |
|
30 int Object::getInstances () |
|
31 { |
|
32 return refCounter; |
|
33 } |