AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

DAGHMemoryTrace.h

Go to the documentation of this file.
00001 #ifndef _included_DAGHMemoryTraces_h
00002 #define _included_DAGHMemoryTraces_h
00003 
00009 #include <iostream.h>
00010 
00016 class DAGHMemoryTrace
00017   {
00018 
00019 public:
00020    static unsigned alloc_cnt;
00021    static unsigned free_cnt;
00022 
00023 public:
00024    inline DAGHMemoryTrace() 
00025     { cout << "**** DAGHMemoryTrace on ! ****" << endl; }
00026 
00027    inline ~DAGHMemoryTrace()
00028     {
00029       cout << endl 
00030            << "************************************************" << endl
00031            << "**** Memory Allocated:\t" << alloc_cnt << " ****" << endl
00032            << "**** Memory Free'd:   \t" << free_cnt << " ****" << endl
00033            << "************************************************" << endl
00034            << flush;
00035     }
00036 
00037    inline static void alloc(const unsigned size) { alloc_cnt += size; }
00038    inline static void free(const unsigned size)  { free_cnt += size; }
00039   
00040   };
00041 
00042 #endif


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04