DGD Library
Version: 0.1.0.14 | Updated: Thu Aug 10 16:58:40 2006
Home
DGD News
FAQ
Code Documentation
DGD Installation Guide
Bugs-n-Features
DGD at Sourceforge.net
Download DGD
Subversion
Code Documentation
Documentation
Namespaces
Class Hierarchy
Class List
File List
Namespace Members
Functions
Globals
Tutorial
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

dgDebugExtra.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 //
00003 // 
00004 //
00005 // This program is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 //
00019 // This file is part of Depression Glass library.
00020 //
00021 // Copyright (c) 2002. Dimitry Kloper <kloper@users.sf.net> . 
00022 //
00023 // dgDebugExtra.h -- couple of useful macro definitions
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 /* _dgDebugExtra_h_ */
00196 
00197 /* 
00198  * Local Variables:
00199  * compile-command: "make dgDebugExtra.obj"
00200  * End:
00201  */
00202 
00203 

Generated on Thu Aug 10 16:48:28 2006 for DGD Library by doxygen1.3

SourceForge.net Logo Powered by Mason Powered by Perl
Web design derived from Pasilda design found on www.oswd.org.
Copyright (c) 2002, 2003. Dimitry Kloper <kloper@users.sourceforge.net>