00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00032
#ifndef __MEASURE_OBJECT_H
00033
#define __MEASURE_OBJECT_H
00034
00035
#ifdef DEBUG
00036
#include <iostream>
00037
#endif // DEBUG
00038
00039
#include <string>
00040
00042 class Object {
00044 std::string
className;
00046 unsigned int id;
00047
public:
00049 Object (std::string name) :
className (name) {
00050
static unsigned int newId = 0;
00051
id = ++newId;
00052
#ifdef DEBUG
00053
std::cerr <<
"+ " <<
className <<
" (" <<
id <<
")\n";
00054
#endif // DEBUG
00055
}
00057 unsigned int getId ()
const {
return id; }
00059 std::string
getName ()
const {
return className; }
00061 virtual ~Object () {
00062
#ifdef DEBUG
00063
std::cerr <<
"- " <<
className <<
" (" <<
id <<
")\n";
00064
#endif // DEBUG
00065
}
00066 };
00067
00068
#endif // __MEASURE_OBJECT_H