00001 // $Id: leakchecker_8h-source.html,v 1.2 2002/06/20 17:09:51 mkrohn5 Exp $ 00002 00003 // Leak Checker Header File 00004 // Written by: Marco Krohn <marco.krohn@gmx.de> 00005 00006 // Copyright (C) 2001 - , Marco Krohn, <marco.krohn@gmx.de> 00007 // 00008 // This program is free software; you can redistribute it and/or modify 00009 // it under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation; either version 2, or (at your option) 00011 // any later version. 00012 // 00013 // This program is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 // GNU General Public License for more details. 00017 00018 #ifndef __LEAK_CHECKER_INCLUDED 00019 #define __LEAK_CHECKER_INCLUDED 00020 00021 #ifdef SECURE_MODE 00022 00023 #include <iostream> 00024 00025 00026 00027 00028 00029 //---------------------------------------- class TLeakChecker ---------------------------------------- 00030 00040 class TLeakChecker 00041 { 00042 public: 00043 TLeakChecker() : iCounter(0) {}; 00044 ~TLeakChecker() { } 00045 00046 int Get() const { return iCounter; } 00047 void operator++(int) { iCounter++; } 00048 void operator--(int) { iCounter--; } 00049 void Print() const { std::cout << iCounter; } 00050 00051 private: 00052 int iCounter; 00053 }; 00054 00055 00056 00057 00058 00059 #endif // SECURE_MODE 00060 00061 #endif // __LEAK_CHECKER_INCLUDED