debug.hpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
#ifndef DEBUG_HPP
00024
#define DEBUG_HPP
00025
00026
#ifdef DEBUG
00027
00028
#include <iostream>
00029
00030
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
1.3.8