pmc/object.cc
changeset 54 c064ce9f40f5
parent 42 83b8151b966d
child 65 76514757b0d6
equal deleted inserted replaced
53:6b3d7e3418c1 54:c064ce9f40f5
     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 }