Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

debug.hpp

Go to the documentation of this file.
00001 /****************************************************************************\ 00002 * VRVis * 00003 * http://vrvis.sourceforge.net * 00004 * (C) 2004 by Alex Loeffler * 00005 * mailto:aloeffler@users.sourceforge.net * 00006 **************************************************************************** 00007 * License * 00008 * * 00009 * This library is free software; you can redistribute it and/or modify it * 00010 * under the terms of the GNU Library General Public License as published * 00011 * by the Free Software Foundation, version 2. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, but * 00014 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Library General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Library General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00021 \****************************************************************************/ 00022 00023 #ifndef DEBUG_HPP 00024 #define DEBUG_HPP 00025 00026 #ifdef DEBUG 00027 00028 #include <iostream> 00029 00030 // ------------------------------------------------------------- Debug Output. 00031 00032 #define DBG_MSG1(__msg__) std::cout << "[DBG] " << (__msg__) << std::endl; 00033 00034 #define DBG_MSG2(__msg1__, __msg2__) \ 00035 std::cout << "[DBG] " << (__msg1__) << " " \ 00036 << (__msg2__) << std::endl; 00037 00038 #define DBG_MSG3(__msg1__, __msg2__, __msg3__) \ 00039 std::cout << "[DBG] " << (__msg1__) << " " \ 00040 << (__msg2__) << " " \ 00041 << (__msg3__) << std::endl; 00042 00043 #define DBG_MSG4(__msg1__, __msg2__, __msg3__, __msg4__) \ 00044 std::cout << "[DBG] " << (__msg1__) << " " \ 00045 << (__msg2__) << " " \ 00046 << (__msg3__) << " " \ 00047 << (__msg4__) << std::endl; 00048 00049 #define DBG_DUMP(__expr__) \ 00050 std::cout << "[DBG] Dump -> " \ 00051 << (#__expr__) << " = " << (__expr__) \ 00052 << std::endl; 00053 00054 #define DBG_DUMP_VEC(__iterator__, __vec__) \ 00055 std::cout << "[DBG] Vector Dump -> " << (#__vec__) << std::endl; \ 00056 for ((__iterator__) = (__vec__).begin(); \ 00057 (__iterator__) != (__vec__).end(); (__iterator__)++) \ 00058 { \ 00059 std::cout << " [DBG] val: " << *(__iterator__) << std::endl; \ 00060 } 00061 00062 #define DBG_DUMP_MAP(__iterator__, __map__) \ 00063 std::cout << "[DBG] Map Dump -> " << (#__map__) << std::endl; \ 00064 for ((__iterator__) = (__map__).begin(); \ 00065 (__iterator__) != (__map__).end(); (__iterator__)++) \ 00066 { \ 00067 std::cout << " [DBG] key: " << (__iterator__)->first \ 00068 << ", val: " << (__iterator__)->second << std::endl; \ 00069 } 00070 00071 00072 #else // DEBUG not defined 00073 00074 #define DBG_MSG1(__msg__) 00075 #define DBG_MSG2(__msg1__, __msg2__) 00076 #define DBG_MSG3(__msg1__, __msg2__, __msg3__) 00077 #define DBG_MSG3(__msg1__, __msg2__, __msg3__, __msg4__) 00078 #define DBG_DUMP(__expr__) 00079 #define DBG_DUMP_VEC(__iterator__, __vec__) 00080 #define DBG_DUMP_MAP(__iterator__, __map__) 00081 00082 #endif // DEBUG 00083 00084 #endif // DEBUG_HPP

Generated on Tue Sep 21 07:31:08 2004 for VRVis by doxygen 1.3.8