00001
00002
00003 #ifndef _included_DAGHMemoryTraces_h
00004 #define _included_DAGHMemoryTraces_h
00005
00011 #include <iostream>
00012
00018 class DAGHMemoryTrace
00019 {
00020
00021 public:
00022 static unsigned alloc_cnt;
00023 static unsigned free_cnt;
00024
00025 public:
00026 inline DAGHMemoryTrace()
00027 { std::cout << "**** DAGHMemoryTrace on ! ****" << std::endl; }
00028
00029 inline ~DAGHMemoryTrace()
00030 {
00031 std::cout << std::endl
00032 << "************************************************"
00033 << std::endl
00034 << "**** Memory Allocated:\t" << alloc_cnt << " ****"
00035 << std::endl
00036 << "**** Memory Free'd: \t" << free_cnt << " ****"
00037 << std::endl
00038 << "************************************************"
00039 << std::endl << std::flush;
00040 }
00041
00042 inline static void alloc(const unsigned size) { alloc_cnt += size; }
00043 inline static void free(const unsigned size) { free_cnt += size; }
00044
00045 };
00046
00047 #endif