diff options
Diffstat (limited to 'docs/doxygen/nel/debug_8h-source.html')
-rw-r--r-- | docs/doxygen/nel/debug_8h-source.html | 405 |
1 files changed, 405 insertions, 0 deletions
diff --git a/docs/doxygen/nel/debug_8h-source.html b/docs/doxygen/nel/debug_8h-source.html new file mode 100644 index 00000000..43f8cd13 --- /dev/null +++ b/docs/doxygen/nel/debug_8h-source.html @@ -0,0 +1,405 @@ +<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> +<HTML> +<HEAD> + <TITLE>nevrax.org : docs</TITLE> + <LINK REL=stylesheet TYPE="text/css" HREF="http://www.nevrax.org/inc/css/nevrax.css"> + <link href="doxygen.css" rel="stylesheet" type="text/css"> +</HEAD> +<BODY MARGINHEIGHT="0" MARGINWIDTH="0"> + +<!-- uplinks --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.org><b>Home</B></FONT></A> </TD> + <TD><IMG width=6 height=14 SRC="http://www.nevrax.org/inc/img/reddots.gif" ALT="#" VSPACE=2 HSPACE=2 BORDER=0 ></TD><TD VALIGN=middle> <A CLASS=uplinks HREF=http://www.nevrax.com><b>nevrax.com</B></FONT></A> </TD> + </TR> +</TABLE> + +<!-- banner Nevrax --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=100%> + <TR><TD BGCOLOR="#000000" BACKGROUND="http://www.nevrax.org/inc/img/black_banner.jpg"><A HREF="http://www.nevrax.org"><IMG SRC="http://www.nevrax.org/inc/img/nevrax.gif" WIDTH="170" HEIGHT="45" BORDER=0 ALT="Nevrax" ></A></TD></TR> +</TABLE> + +<!-- main table --> +<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 height=100%> + <TR> + <TD WIDTH=16><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="10" BORDER=0 ALT=""></TD> + <TD WIDTH=140 BGCOLOR=#dddddd VALIGN=TOP ALIGN=middle><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + + <!------ Begin Box ------> + <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 BGCOLOR=black><TR><TD><TABLE border=0 cellspacing=2 cellpadding=0 width=120><tr><TD ALIGN=middle bgcolor=black> + <FONT COLOR=white FACE="sans-serif"><B>Nevrax.org</B></FONT></TD></TR><tr><td colspan=2 bgcolor=#FFFFFF> + <TABLE cellspacing=0 cellpadding=1 border=0> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="Rubrique news"><img width=13 height=15 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-news.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/news/" TITLE="News">News</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Rubrique mail"><img width=15 height=11 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-mail.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/mail/" TITLE="Mailing list archive">Mailing-list</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Rubrique docs"><img width=14 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-docs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/docs/" TITLE="Documentation">Documentation</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="Rubrique cvs"><img width=13 height=17 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-cvs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/cvs/" TITLE="CVS Web">CVS</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Rubrique bugs"><img width=20 height=16 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-bugs.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/bugs/" TITLE="Bugtracking">Bugs</a></td></tr> + <tr><td ALIGN=middle><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="Rubrique license"><img width=18 height=12 hspace=5 border=0 src=http://www.nevrax.org/inc/img/picto-gpl.gif ALT=#></A></td><td><a class='linkbox' href="http://www.nevrax.org/GPL.php3" TITLE="License">License</a></td></tr> + </TABLE> + </TD></TR></TABLE></TD></TR></TABLE> + <!------ End Box ------> + + </TD> + <TD WIDTH=15><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="16" HEIGHT="16" BORDER=0 ALT=""></TD> + <TD ALIGN=left valign=top><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="140" HEIGHT="10" BORDER=0 ALT=""> + +<!-- title --> +<TABLE background="http://www.nevrax.org/inc/img/redline.gif" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td> +<A HREF="http://www.nevrax.org/docs/"><img src="http://www.nevrax.org/inc/img/t_docs.gif" ALT="Docs" HEIGHT=20 BORDER=0></A> +</td><td><IMG SRC="http://www.nevrax.org/inc/img/pixel.gif" WIDTH="1" HEIGHT="1" BORDER=0 ALT=""> +</td></tr></table> + + +<!-- block --> +<TABLE bgcolor="#dddddd" CELLSPACING=0 CELLPADDING=0 BORDER=0 width=100%><tr><td width=1% valign=middle><img width=6 height=14 hspace=2 vspace=2 src="http://www.nevrax.org/inc/img/reddots.gif"></TD> + <TD><B>Documentation</B></TD> + <TD ALIGN=RIGHT> </td> +</tr></table> +<!-- Generated by Doxygen 1.2.14 --> +<center> +<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="namespaces.html">Namespace List</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="namespacemembers.html">Namespace Members</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> <a class="qindex" href="pages.html">Related Pages</a> <a class="qindexRef" doxygen="_cgi:http://www.nevrax.org/cgi-bin/nel-search.cgi" href="http://www.nevrax.org/cgi-bin/nel-search.cgi">Search</a> </center> +<hr><h1>debug.h</h1><a href="debug_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 +00007 <font class="comment">/* Copyright, 2000 Nevrax Ltd.</font> +00008 <font class="comment"> *</font> +00009 <font class="comment"> * This file is part of NEVRAX NEL.</font> +00010 <font class="comment"> * NEVRAX NEL is free software; you can redistribute it and/or modify</font> +00011 <font class="comment"> * it under the terms of the GNU General Public License as published by</font> +00012 <font class="comment"> * the Free Software Foundation; either version 2, or (at your option)</font> +00013 <font class="comment"> * any later version.</font> +00014 <font class="comment"></font> +00015 <font class="comment"> * NEVRAX NEL is distributed in the hope that it will be useful, but</font> +00016 <font class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of</font> +00017 <font class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</font> +00018 <font class="comment"> * General Public License for more details.</font> +00019 <font class="comment"></font> +00020 <font class="comment"> * You should have received a copy of the GNU General Public License</font> +00021 <font class="comment"> * along with NEVRAX NEL; see the file COPYING. If not, write to the</font> +00022 <font class="comment"> * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,</font> +00023 <font class="comment"> * MA 02111-1307, USA.</font> +00024 <font class="comment"> */</font> +00025 +00026 <font class="preprocessor">#ifndef NL_DEBUG_H</font> +00027 <font class="preprocessor"></font><font class="preprocessor">#define NL_DEBUG_H</font> +00028 <font class="preprocessor"></font><font class="preprocessor">#include <stdio.h></font> +00029 +00030 <font class="preprocessor">#include "<a class="code" href="common_8h.html">nel/misc/common.h</a>"</font> +00031 <font class="preprocessor">#include "<a class="code" href="log_8h.html">nel/misc/log.h</a>"</font> +00032 <font class="preprocessor">#include "<a class="code" href="mutex_8h.html">nel/misc/mutex.h</a>"</font> +00033 <font class="preprocessor">#include "<a class="code" href="mem__displayer_8h.html">nel/misc/mem_displayer.h</a>"</font> +00034 <font class="preprocessor">#include "<a class="code" href="displayer_8h.html">nel/misc/displayer.h</a>"</font> +00035 +00036 <font class="keyword">namespace </font>NLMISC +00037 { +00038 +00039 <font class="comment">//</font> +00040 <font class="comment">// Externals</font> +00041 <font class="comment">//</font> +00042 +00043 <font class="keyword">extern</font> CLog *<a class="code" href="namespaceNLMISC.html#a8">ErrorLog</a>; +00044 <font class="keyword">extern</font> CLog *<a class="code" href="namespaceNLMISC.html#a9">WarningLog</a>; +00045 <font class="keyword">extern</font> CLog *<a class="code" href="namespaceNLMISC.html#a10">InfoLog</a>; +00046 <font class="keyword">extern</font> CLog *<a class="code" href="namespaceNLMISC.html#a11">DebugLog</a>; +00047 <font class="keyword">extern</font> CLog *<a class="code" href="namespaceNLMISC.html#a12">AssertLog</a>; +00048 +00049 <font class="keyword">extern</font> CMemDisplayer *<a class="code" href="namespaceNLMISC.html#a13">DefaultMemDisplayer</a>; +00050 <font class="keyword">extern</font> CMsgBoxDisplayer *<a class="code" href="namespaceNLMISC.html#a14">DefaultMsgBoxDisplayer</a>; +00051 +00052 <font class="comment">//</font> +00053 <font class="comment">// Functions</font> +00054 <font class="comment">//</font> +00055 +00057 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a245">nlFatalError</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *<a class="code" href="driver__opengl__extension__def_8h.html#a398">format</a>, ...); +00058 +00060 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a246">nlError</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *<a class="code" href="driver__opengl__extension__def_8h.html#a398">format</a>, ...); +00061 +00062 <font class="comment">// internal use only</font> +00063 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a247">createDebug</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *logPath = NULL, <font class="keywordtype">bool</font> logInFile = <font class="keyword">true</font>); +00064 +00065 <font class="comment">// internal breakpoint window</font> +00066 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a248">enterBreakpoint</a> (<font class="keyword">const</font> <font class="keywordtype">char</font> *message); +00067 +00068 <font class="comment">// Need a breakpoint in the assert / verify macro</font> +00069 <font class="keyword">extern</font> <font class="keywordtype">bool</font> <a class="code" href="namespaceNLMISC.html#a15">DebugNeedAssert</a>; +00070 +00071 <font class="comment">// Macros</font> +00072 +00073 +<a name="l00087"></a><a class="code" href="debug_8h.html#a0">00087</a> <font class="preprocessor">#define nldebug NLMISC::createDebug (), NLMISC::DebugLog->setPosition( __LINE__, __FILE__ ), NLMISC::DebugLog->displayNL</font> +00088 <font class="preprocessor"></font> +00089 +<a name="l00094"></a><a class="code" href="debug_8h.html#a1">00094</a> <font class="preprocessor">#define nlinfo NLMISC::createDebug (), NLMISC::InfoLog->setPosition( __LINE__, __FILE__ ), NLMISC::InfoLog->displayNL</font> +00095 <font class="preprocessor"></font> +00096 +<a name="l00114"></a><a class="code" href="debug_8h.html#a2">00114</a> <font class="preprocessor">#define nlwarning NLMISC::createDebug (), NLMISC::WarningLog->setPosition( __LINE__, __FILE__ ), NLMISC::WarningLog->displayNL</font> +00115 <font class="preprocessor"></font> +00116 +<a name="l00133"></a><a class="code" href="debug_8h.html#a3">00133</a> <font class="preprocessor">#define nlerror NLMISC::createDebug (), NLMISC::ErrorLog->setPosition( __LINE__, __FILE__ ), NLMISC::nlFatalError</font> +00134 <font class="preprocessor"></font> +00135 +<a name="l00141"></a><a class="code" href="debug_8h.html#a4">00141</a> <font class="preprocessor">#define nlerrornoex NLMISC::createDebug (), NLMISC::ErrorLog->setPosition( __LINE__, __FILE__ ), NLMISC::nlError</font> +00142 <font class="preprocessor"></font> +00143 +00245 <font class="comment">// removed because we always check assert (even in release mode) #if defined (NL_OS_WINDOWS) && defined (NL_DEBUG)</font> +00246 <font class="preprocessor">#if defined (NL_OS_WINDOWS)</font> +00247 <font class="preprocessor"></font><font class="preprocessor">#define NLMISC_BREAKPOINT _asm { int 3 }</font> +00248 <font class="preprocessor"></font><font class="preprocessor">#else</font> +<a name="l00249"></a><a class="code" href="debug_8h.html#a5">00249</a> <font class="preprocessor"></font><font class="preprocessor">#define NLMISC_BREAKPOINT abort()</font> +00250 <font class="preprocessor"></font><font class="preprocessor">#endif</font> +00251 <font class="preprocessor"></font> +00252 <font class="comment">// removed because we always check assert (even in release mode) #if defined(NL_DEBUG)</font> +00253 +<a name="l00254"></a><a class="code" href="debug_8h.html#a6">00254</a> <font class="preprocessor">#define nlassert(exp) \</font> +00255 <font class="preprocessor">{ \</font> +00256 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00257 <font class="preprocessor"> if (!ignoreNextTime && !(exp)) { \</font> +00258 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00259 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00260 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00261 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00262 <font class="preprocessor"> else \</font> +00263 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00264 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00265 <font class="preprocessor"> NLMISC::AssertLog->displayNL ("\"%s\" ", #exp); \</font> +00266 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00267 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00268 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00269 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00270 <font class="preprocessor"> } \</font> +00271 <font class="preprocessor">}</font> +00272 <font class="preprocessor"></font> +<a name="l00273"></a><a class="code" href="debug_8h.html#a7">00273</a> <font class="preprocessor">#define nlassertonce(exp) \</font> +00274 <font class="preprocessor">{ \</font> +00275 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00276 <font class="preprocessor"> if (!ignoreNextTime && !(exp)) { \</font> +00277 <font class="preprocessor"> ignoreNextTime = true; \</font> +00278 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00279 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00280 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00281 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00282 <font class="preprocessor"> else \</font> +00283 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00284 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00285 <font class="preprocessor"> NLMISC::AssertLog->displayNL ("\"%s\" ", #exp); \</font> +00286 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00287 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00288 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00289 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00290 <font class="preprocessor"> } \</font> +00291 <font class="preprocessor">}</font> +00292 <font class="preprocessor"></font> +<a name="l00293"></a><a class="code" href="debug_8h.html#a8">00293</a> <font class="preprocessor">#define nlassertex(exp, str) \</font> +00294 <font class="preprocessor">{ \</font> +00295 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00296 <font class="preprocessor"> if (!ignoreNextTime && !(exp)) { \</font> +00297 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00298 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00299 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00300 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00301 <font class="preprocessor"> else \</font> +00302 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00303 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00304 <font class="preprocessor"> NLMISC::AssertLog->display ("\"%s\" ", #exp); \</font> +00305 <font class="preprocessor"> NLMISC::AssertLog->displayRawNL str; \</font> +00306 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00307 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00308 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00309 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00310 <font class="preprocessor"> } \</font> +00311 <font class="preprocessor">}</font> +00312 <font class="preprocessor"></font> +<a name="l00313"></a><a class="code" href="debug_8h.html#a9">00313</a> <font class="preprocessor">#define nlverify(exp) \</font> +00314 <font class="preprocessor">{ \</font> +00315 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00316 <font class="preprocessor"> if (!ignoreNextTime && !(exp)) { \</font> +00317 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00318 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00319 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00320 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00321 <font class="preprocessor"> else \</font> +00322 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00323 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00324 <font class="preprocessor"> NLMISC::AssertLog->displayNL ("\"%s\" ", #exp); \</font> +00325 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00326 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00327 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00328 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00329 <font class="preprocessor"> } \</font> +00330 <font class="preprocessor">}</font> +00331 <font class="preprocessor"></font> +<a name="l00332"></a><a class="code" href="debug_8h.html#a10">00332</a> <font class="preprocessor">#define nlverifyonce(exp) \</font> +00333 <font class="preprocessor">{ \</font> +00334 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00335 <font class="preprocessor"> if (!ignoreNextTime && !(exp)) { \</font> +00336 <font class="preprocessor"> ignoreNextTime = true; \</font> +00337 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00338 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00339 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00340 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00341 <font class="preprocessor"> else \</font> +00342 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00343 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00344 <font class="preprocessor"> NLMISC::AssertLog->displayNL ("\"%s\" ", #exp); \</font> +00345 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00346 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00347 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00348 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00349 <font class="preprocessor"> } \</font> +00350 <font class="preprocessor">}</font> +00351 <font class="preprocessor"></font> +<a name="l00352"></a><a class="code" href="debug_8h.html#a11">00352</a> <font class="preprocessor">#define nlverifyex(exp, str) \</font> +00353 <font class="preprocessor">{ \</font> +00354 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00355 <font class="preprocessor"> if (!ignoreNextTime && !(exp)) { \</font> +00356 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00357 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00358 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00359 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00360 <font class="preprocessor"> else \</font> +00361 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00362 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00363 <font class="preprocessor"> NLMISC::AssertLog->display ("\"%s\" ", #exp); \</font> +00364 <font class="preprocessor"> NLMISC::AssertLog->displayRawNL str; \</font> +00365 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00366 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00367 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00368 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00369 <font class="preprocessor"> } \</font> +00370 <font class="preprocessor">}</font> +00371 <font class="preprocessor"></font> +00372 +00373 +<a name="l00374"></a><a class="code" href="debug_8h.html#a12">00374</a> <font class="preprocessor">#define nlstop \</font> +00375 <font class="preprocessor">{ \</font> +00376 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00377 <font class="preprocessor"> if (!ignoreNextTime) { \</font> +00378 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00379 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00380 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00381 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00382 <font class="preprocessor"> else \</font> +00383 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00384 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00385 <font class="preprocessor"> NLMISC::AssertLog->displayNL ("STOP"); \</font> +00386 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00387 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00388 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00389 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00390 <font class="preprocessor"> } \</font> +00391 <font class="preprocessor">}</font> +00392 <font class="preprocessor"></font> +<a name="l00393"></a><a class="code" href="debug_8h.html#a13">00393</a> <font class="preprocessor">#define nlstoponce \</font> +00394 <font class="preprocessor">{ \</font> +00395 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00396 <font class="preprocessor"> if (!ignoreNextTime) { \</font> +00397 <font class="preprocessor"> ignoreNextTime = true; \</font> +00398 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00399 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00400 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00401 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00402 <font class="preprocessor"> else \</font> +00403 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00404 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00405 <font class="preprocessor"> NLMISC::AssertLog->displayNL ("STOP"); \</font> +00406 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00407 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00408 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00409 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00410 <font class="preprocessor"> } \</font> +00411 <font class="preprocessor">}</font> +00412 <font class="preprocessor"></font> +00413 +<a name="l00414"></a><a class="code" href="debug_8h.html#a14">00414</a> <font class="preprocessor">#define nlstopex(str) \</font> +00415 <font class="preprocessor">{ \</font> +00416 <font class="preprocessor"> static bool ignoreNextTime = false; \</font> +00417 <font class="preprocessor"> if (!ignoreNextTime) { \</font> +00418 <font class="preprocessor"> NLMISC::DebugNeedAssert = false; \</font> +00419 <font class="preprocessor"> NLMISC::createDebug (); \</font> +00420 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00421 <font class="preprocessor"> NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime = ignoreNextTime; \</font> +00422 <font class="preprocessor"> else \</font> +00423 <font class="preprocessor"> NLMISC::DebugNeedAssert = true; \</font> +00424 <font class="preprocessor"> NLMISC::AssertLog->setPosition (__LINE__, __FILE__); \</font> +00425 <font class="preprocessor"> NLMISC::AssertLog->display ("STOP "); \</font> +00426 <font class="preprocessor"> NLMISC::AssertLog->displayRawNL str; \</font> +00427 <font class="preprocessor"> if (NLMISC::DefaultMsgBoxDisplayer) \</font> +00428 <font class="preprocessor"> ignoreNextTime = NLMISC::DefaultMsgBoxDisplayer->IgnoreNextTime; \</font> +00429 <font class="preprocessor"> if (NLMISC::DebugNeedAssert) \</font> +00430 <font class="preprocessor"> NLMISC_BREAKPOINT; \</font> +00431 <font class="preprocessor"> } \</font> +00432 <font class="preprocessor">}</font> +00433 <font class="preprocessor"></font> +00434 +00435 <font class="comment">/* removed because we always check assert (even in release mode) </font> +00436 <font class="comment">#else // NL_DEBUG</font> +00437 <font class="comment"></font> +00438 <font class="comment">#define nlassert(exp) \</font> +00439 <font class="comment">NULL</font> +00440 <font class="comment">#define nlassertonce(exp) \</font> +00441 <font class="comment">NULL</font> +00442 <font class="comment">#define nlassertex(exp, str) \</font> +00443 <font class="comment">NULL</font> +00444 <font class="comment">#define nlverify(exp) \</font> +00445 <font class="comment">{ exp; }</font> +00446 <font class="comment">#define nlverifyonce(exp) \</font> +00447 <font class="comment">{ exp; }</font> +00448 <font class="comment">#define nlverifyex(exp, str) \</font> +00449 <font class="comment">{ exp; }</font> +00450 <font class="comment">#define nlstop \</font> +00451 <font class="comment">NULL</font> +00452 <font class="comment">#define nlstoponce \</font> +00453 <font class="comment">NULL</font> +00454 <font class="comment">#define nlstopex(str) \</font> +00455 <font class="comment">NULL</font> +00456 <font class="comment"></font> +00457 <font class="comment">#endif // NL_DEBUG</font> +00458 <font class="comment">*/</font> +00459 +<a name="l00460"></a><a class="code" href="structNLMISC_1_1EFatalError.html">00460</a> <font class="keyword">struct </font>EFatalError : <font class="keyword">public</font> Exception +00461 { +<a name="l00462"></a><a class="code" href="structNLMISC_1_1EFatalError.html#a0">00462</a> <a class="code" href="structNLMISC_1_1EFatalError.html#a0">EFatalError</a>() : <a class="code" href="classNLMISC_1_1Exception.html#a0">Exception</a>( "<a class="code" href="debug_8h.html#a3">nlerror</a>() called" ) {} +00463 }; +00464 +<a name="l00465"></a><a class="code" href="classNLMISC_1_1ETrapDebug.html">00465</a> <font class="keyword">class </font>ETrapDebug : <font class="keyword">public</font> Exception +00466 { +00467 }; +00468 +00469 <font class="comment">// undef default assert to force people to use nlassert() instead of assert()</font> +00470 <font class="preprocessor">#ifdef assert</font> +00471 <font class="preprocessor"></font><font class="preprocessor">#undef assert</font> +00472 <font class="preprocessor"></font><font class="preprocessor">#endif</font> +<a name="l00473"></a><a class="code" href="debug_8h.html#a15">00473</a> <font class="preprocessor"></font><font class="preprocessor">#define assert(a) you_must_not_use_assert___use_nl_assert___read_debug_h_file</font> +00474 <font class="preprocessor"></font> +00475 +00477 <font class="keywordtype">void</font> <a class="code" href="namespaceNLMISC.html#a249">getCallStackAndLog</a> (std::string &result, sint skipNFirst = 0); +00478 +00483 <font class="keyword">template</font><<font class="keyword">class</font> T, <font class="keyword">class</font> U> <font class="keyword">inline</font> T <a class="code" href="namespaceNLMISC.html#a250">safe_cast</a>(U o) +00484 { +00485 <font class="comment">// NB: must check debug because assert may still be here in release</font> +00486 <font class="preprocessor">#ifdef NL_DEBUG</font> +00487 <font class="preprocessor"></font> <a class="code" href="debug_8h.html#a6">nlassert</a>(dynamic_cast<T>(o)); +00488 <font class="preprocessor">#endif</font> +00489 <font class="preprocessor"></font> <font class="keywordflow">return</font> static_cast<T>(o); +00490 } +00491 +<a name="l00494"></a><a class="code" href="debug_8h.html#a16">00494</a> <font class="preprocessor">#define nlctassert(cond) sizeof(uint[(cond) ? 1 : 0]);</font> +00495 <font class="preprocessor"></font> +00496 } <font class="comment">// NLMISC</font> +00497 +00498 +00499 <font class="preprocessor">#endif // NL_DEBUG_H</font> +00500 <font class="preprocessor"></font> +00501 <font class="comment">/* End of debug.h */</font> +</pre></div> + +<!-- footer --> +<BR><FONT Size=+5> </FONT> +</TD> +<TD WIDTH=15><IMG SRC=http://www.nevrax.org/inc/img/pixel.gif WIDTH=15 HEIGHT=15 BORDER=0 ALT=""></TD> +</TR> +</TABLE> +</BODY> +</HTML> |