00001 #ifndef _CTBtraceCounter_HXX 00002 #define _CTBtraceCounter_HXX 1 00003 00008 /*----------------------------------------------------------------------------*/ 00009 /* C Tool Box: Designed and implemented by: */ 00010 /* Walter F.J. Mueller Gesellschaft fuer Schwerionenforschung (GSI) */ 00011 /* Planckstrasse 1, D-64291 Darmstadt, Germany */ 00012 /* Email: W.F.J.Mueller@gsi.de */ 00013 /* WWW: http://www-kp3.gsi.de/www/kp3/people/mueller.html */ 00014 /*------------------------------------------+---------------------------------*/ 00015 00016 class CTBtraceCounter { 00017 00018 public: 00019 CTBtraceCounter(); 00020 CTBtraceCounter(const char* c_text, bool b_print = false); 00021 ~CTBtraceCounter(); 00022 00023 void Trace(); 00024 void ToStream(ostream& os = cout) const; 00025 00026 CTBtraceCounter& operator=(CTBint i_cnt); 00027 CTBtraceCounter& operator+=(CTBint i_inc); 00028 00029 CTBtraceCounter& operator++(); 00030 CTBtraceCounter& operator++(int); 00031 00032 operator CTBint(); 00033 00034 private: 00035 const char* mc_text; 00036 bool mb_autoprint; 00037 CTBint mi_cnt; 00038 }; 00039 00040 ostream& operator<<(ostream& os, const CTBtraceCounter& obj); 00041 00042 #if !(defined(CTB__OutLine) || defined(CTBtraceCounter__OutLine)) 00043 #include "CTBtraceCounter.icc" 00044 #endif 00045 00046 #endif