00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _dgDebugExtra_h_
00027 #define _dgDebugExtra_h_
00028
00037 #define dgd_file (char*)__FILE__ << "(" << __LINE__ <<") "
00038
00039
00046 #define dgd_expand(s) #s " = " << DGD::dgd << (s)
00047
00054 #define dgd_expandp(s) #s " = " << DGD::dgd << DGD::ptr(s)
00055
00063 #define dgd_for(b,e) DGD::dgd << DGD::dgd_make_sequence((b),(e))
00064
00072 #define dgd_fors(b,e,s) DGD::dgd << DGD::dgd_make_sequence((b),(e),(s))
00073
00080 #define dgd_do(b) DGD::dgd << DGD::dgd_make_circle((b))
00081
00088 #define dgd_dos(b,s) DGD::dgd << DGD::dgd_make_circle((b),(s))
00089
00090
00096 #define dgd_channel(name) ((DGD::Debug::debug_factory->operator[](#name)))
00097
00108 #if defined(_TRACE)
00109 #define dgd_trace(name, arg) \
00110 if(DGD::Debug::debug_factory.get() != NULL) { \
00111 DGD::Debug::channel_ptr __cnl = dgd_channel(name); \
00112 (void)( __cnl.get() && __cnl->is_open() && ((*__cnl) << arg ) ); \
00113 }
00114 #else
00115 #define dgd_trace(name, arg)
00116 #endif
00117
00121 #if defined(_TRACE)
00122 #define dgd_flush_all \
00123 if(DGD::Debug::debug_factory.get() != NULL ) \
00124 DGD::Debug::debug_factory->flush();
00125 #else
00126 #define dgd_flush_all
00127 #endif
00128
00139 #if defined(_TRACE)
00140 #define dgd_start_scope(c, text) \
00141 DGD::Debug::channel_ptr __cnl; \
00142 if(DGD::Debug::debug_factory.get() != NULL) __cnl = dgd_channel(c); \
00143 (void)( __cnl.get() && __cnl->is_open() && ((*__cnl) << text << " {" << std::endl << DGD::incr) )
00144 #else
00145 #define dgd_start_scope(c, text)
00146 #endif
00147
00154 #if defined(_TRACE)
00155 #define dgd_scope(c, text) \
00156 (void) (__cnl.get() && __cnl->is_open() && ((*__cnl) << text << " {" << std::endl << DGD::incr) )
00157 #else
00158 #define dgd_scope(c, text)
00159 #endif
00160
00168 #if defined(_TRACE)
00169 #define dgd_echo( text ) \
00170 (void)( __cnl.get() && __cnl->is_open() && ((*__cnl) << text) )
00171 #else
00172 #define dgd_echo( text )
00173 #endif
00174
00178 #if defined(_TRACE)
00179 #define dgd_end_scope(c) \
00180 (void)( __cnl.get() && __cnl->is_open() && ((*__cnl) << DGD::decr << "}" << std::endl) )
00181 #else
00182 #define dgd_end_scope(c)
00183 #endif
00184
00188 #if defined(_TRACE)
00189 #define dgd_end_scope_text(c, text) \
00190 (void)( __cnl.get() && __cnl->is_open() && ((*__cnl) << DGD::decr<< text << "}" << std::endl) )
00191 #else
00192 #define dgd_end_scope_text(c, text)
00193 #endif
00194
00195 #endif
00196
00197
00198
00199
00200
00201
00202
00203